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

Source for file string.php

Documentation is available at string.php

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

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