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

Source for file horizontal_string.php

Documentation is available at horizontal_string.php

  1. <?php 
  2. @include '../../include_path.php';
  3. /**
  4.  * Horizontal String ProgressBar example.
  5.  * 
  6.  * @version    $Id: horizontal_string.php,v 1.2 2004/04/18 13:25:43 farell Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  */
  10.  
  11. require_once 'HTML/Progress.php';
  12.  
  13. $bar = new HTML_Progress();
  14. $bar->setAnimSpeed(100);
  15. $bar->setIncrement(5);
  16. $bar->setStringPainted(true);          // get space for the string
  17. $bar->setString('');                   // but don't paint it
  18.  
  19. $ui =$bar->getUI();
  20. $ui->setStringAttributes('width=350 align=left');
  21. ?>
  22. <html>
  23. <head>
  24. <title>Horizontal String ProgressBar example</title>
  25. <style type="text/css">
  26. <!--
  27. <?php echo $bar->getStyle()?>
  28.  
  29. body {
  30.     background-color: #FFFFFF;
  31.     color: #000000;
  32.     font-family: Verdana, Arial;
  33. }
  34.  
  35. a:visited, a:active, a:link {
  36.     color: navy;
  37. }
  38. // -->
  39. </style>
  40. <script type="text/javascript">
  41. <!--
  42. <?php echo $bar->getScript()?>
  43. //-->
  44. </script>
  45. </head>
  46. <body>
  47. <h1><?php echo basename(__FILE__)?></h1>
  48.  
  49. <?php 
  50. echo $bar->toHtml()
  51.  
  52. $pkg = array('PEAR''Archive_Tar''Config'
  53.     'HTML_QuickForm''HTML_CSS''HTML_Page''HTML_Template_Sigma'
  54.     'Log''MDB''PHPUnit');
  55.  
  56. do {
  57.     $val $bar->getValue();
  58.     $i floor($val / 10);
  59.     $msg ($val == 100'' : "&nbsp; installing package ($val %) ... : ".$pkg[$i];
  60.     $bar->setString($msg);
  61.  
  62.     $bar->display();
  63.     if ($bar->getPercentComplete(== 1{
  64.         break;   // the progress bar has reached 100%
  65.     }
  66.     $bar->incValue();
  67. while(1);
  68. ?>
  69.  
  70. <p>&lt;&lt; <a href="index.html">Back examples TOC</a></p>
  71.  
  72. <h2>print_r </h2>
  73. <pre>
  74. <?php 
  75. print_r($bar->toArray())
  76. ?>
  77. </pre>
  78.  
  79. </body>
  80. </html>

Documentation generated on Mon, 11 Mar 2019 10:15:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.