HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]

Source for file default.php

Documentation is available at default.php

  1. <?php 
  2. @include '../include_path.php';
  3. /**
  4.  * Observer ProgressBar example. Uses the default observer class.
  5.  * 
  6.  * @version    $Id: default.php,v 1.1 2004/06/27 13:08:28 farell Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  */
  10.  
  11. require_once 'HTML/Progress.php';
  12. require_once 'HTML/Progress/observer.php';
  13.  
  14. // 1. Creates ProgressBar
  15. $bar = new HTML_Progress();
  16. $bar->setAnimSpeed(100);
  17. $bar->setBorderPainted(true);
  18. $bar->setIncrement(10);
  19.  
  20. // 2. Creates and attach a listener 
  21. $observer = new HTML_Progress_Observer();
  22.  
  23. $ok $bar->addListener($observer);
  24. if (!$ok{
  25.     die ("Cannot add a valid listener to progress bar !");
  26. }
  27.  
  28. // 3. Changes look-and-feel of ProgressBar
  29. $ui =$bar->getUI();
  30. $ui->setBorderAttributes('width = 2');                     // border: 2px, solid, #000000
  31. $ui->setComment('Standard Observer ProgressBar example');
  32. ?>
  33. <!DOCTYPE html
  34.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  35.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  36.  
  37. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  38. <head>
  39. <title>Standard Observer ProgressBar example</title>
  40. <style type="text/css">
  41. <!--
  42. <?php echo $bar->getStyle()?>
  43.  
  44. body {
  45.     background-color: #FFFFFF;
  46.     color: #000000;
  47.     font-family: Verdana, Arial;
  48. }
  49.  
  50. a:visited, a:active, a:link {
  51.     color: navy;
  52. }
  53. // -->
  54. </style>
  55. <script type="text/javascript">
  56. <!--
  57. <?php echo $bar->getScript()?>
  58. //-->
  59. </script>
  60. </head>
  61. <body>
  62. <h1><?php echo basename(__FILE__)?></h1>
  63.  
  64. <?php 
  65. echo $bar->toHTML()
  66. $bar->run();
  67. ?>
  68.  
  69. <form>
  70. Contents of file 'progress_observer.log' generated by HTML_Progress_Observer class
  71. <textarea readOnly="true" rows="12" cols="80" wrap="virtual">
  72. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:10;} 
  73. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:20;} 
  74. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:30;} 
  75. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:40;} 
  76. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:50;} 
  77. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:60;} 
  78. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:70;} 
  79. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:80;} 
  80. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:90;} 
  81. a:2:{s:3:"log";s:8:"incValue";s:5:"value";i:100;} 
  82. </textarea>
  83. </form>
  84.  
  85. <p>&lt;&lt; <a href="../index.html">Back examples TOC</a></p>
  86.  
  87. </body>
  88. </html>

Documentation generated on Mon, 11 Mar 2019 13:52:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.