Examples TOCexamples

HTMLPage basic Monitor

$Date: 2005/07/25 12:15:50 $

 Table of contents

Introduction

This example requires :

Be aware that:


Used PEAR::HTML_Page package as QF renderer to display ProgressBar Monitor.

[Top]

 Render options

None used. Only default values.

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

  1. <?php
  2. /**
  3.  * PEAR::HTML_Page package made it easy to build
  4.  * a very simple ProgressBar Monitor.
  5.  *
  6.  * @version    $Id: htmlpage.php,v 1.2 2005/07/25 12:15:50 farell Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  * @subpackage Examples
  10.  */
  11.  
  12. require_once 'HTML/Progress/monitor.php';
  13. require_once 'HTML/Page.php';
  14.  
  15. $p = new HTML_Page(array(
  16.         'charset'  => 'utf-8',
  17.         'lineend'  => OS_WINDOWS ? 'win' : 'unix',
  18.         'doctype'  => "XHTML 1.0 Strict",
  19.         'language' => 'en',
  20.         'cache'    => 'false'
  21.      ));
  22.  
  23. $p->setTitle("PEAR::HTML_Progress - Simple Monitor demo");
  24. $p->setMetaData("author", "Laurent Laville");
  25.  
  26. $progressMonitor = new HTML_Progress_Monitor();
  27.  
  28. $bar =& $progressMonitor->getProgressElement();
  29. $bar->setAnimSpeed(20);
  30.  
  31. $p->addStyleDeclaration(
  32.     $progressMonitor->getStyle()
  33.     );
  34. $p->addScriptDeclaration(
  35.     $progressMonitor->getScript()
  36.     );
  37. $p->addBodyContent(
  38.     '<h1>PEAR::HTML_Page renderer without user-callback</h1>'
  39.     );
  40. $p->addBodyContent(
  41.     $progressMonitor->toHtml()
  42.     );
  43. $p->display();
  44.  
  45. $progressMonitor->run();
  46. ?>

[Top]