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

Source for file monitor_function_callback.php

Documentation is available at monitor_function_callback.php

  1. <?php
  2. @include '../../include_path.php';
  3. /**
  4.  * Monitor example with a new form template and progress bar
  5.  * color scheme. Used a function as user callback.
  6.  *
  7.  * @version    $Id: monitor_function_callback.php,v 1.2 2004/04/18 13:25:43 farell Exp $
  8.  * @author     Laurent Laville <pear@laurent-laville.org>
  9.  * @package    HTML_Progress
  10.  */
  11.  
  12. require_once 'HTML/Progress/monitor.php';
  13. require_once 'progressModels.php';
  14. require_once 'progressHandler.php';
  15.  
  16.  
  17. $monitor = new HTML_Progress_Monitor('frmMonitor4'array(
  18.     'button' => array('style' => 'width:80px;')
  19.     )
  20. );
  21. $monitor->setProgressHandler('myFunctionHandler');
  22.  
  23. // Attach a progress ui-model (see file progressModels.php for attributes definition)
  24. $progress = new HTML_Progress();
  25. $progress->setAnimSpeed(50);
  26. $progress->setUI('Progress_ITDynamic');
  27. $progress->setStringPainted(true);     // get space for the string
  28. $progress->setString("");              // but don't paint it
  29. $progress->setIndeterminate(true);     // Progress start in indeterminate mode
  30. $monitor->setProgressElement($progress);
  31. ?>
  32. <html>
  33. <head>
  34. <title>ProgressBar Monitor - Default renderer </title>
  35. <style type="text/css">
  36. <!--
  37. body {
  38.     background-color: lightgrey;
  39.     font-family: Verdana, Arial;
  40. }
  41. .progressStatus {
  42.     color: navy; 
  43.     font-size:10px;
  44. }
  45. <?php echo $monitor->getStyle()?>
  46. // -->
  47. </style>
  48. <script type="text/javascript">
  49. <!--
  50. <?php echo $monitor->getScript()?>
  51. //-->
  52. </script>
  53. </head>
  54. <body>
  55. <h1><?php echo basename(__FILE__)?></h1>
  56.  
  57. <?php 
  58. $renderer =HTML_QuickForm::defaultRenderer();
  59. $renderer->setFormTemplate('
  60.     <table width="450" border="0" cellpadding="3" cellspacing="2" bgcolor="#EEEEEE">
  61.     <form{attributes}>{content}
  62.     </form>
  63.     </table>
  64.     ');
  65. $renderer->setHeaderTemplate('
  66.     <tr>
  67.         <td style="white-space:nowrap;background:#7B7B88;color:#ffc;" align="left" colspan="2"><b>{header}</b></td>
  68.     </tr>
  69.     ');
  70. $monitor->accept($renderer);
  71.  
  72. echo $renderer->toHtml();
  73.  
  74. $monitor->run();   
  75. ?>
  76.  
  77. <p>&lt;&lt; <a href="index.html">Back examples TOC</a></p>
  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.