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

Source for file monitor_method_callback.php

Documentation is available at monitor_method_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 class-method as user callback.
  6.  *
  7.  * @version    $Id: monitor_method_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('frmMonitor3'array(
  18.     'button' => array('style' => 'width:80px;')
  19.     )
  20. );
  21. $monitor->setProgressHandler(array('myClassHandler','myMethodHandler'));
  22.  
  23. // Attach a progress ui-model (see file progressModels.php for attributes definition)
  24. $progress = new HTML_Progress();
  25. $progress->setUI('Progress_Default2');
  26. $progress->setAnimSpeed(50);
  27. $monitor->setProgressElement($progress);
  28. ?>
  29. <html>
  30. <head>
  31. <title>ProgressBar Monitor - Default renderer </title>
  32. <style type="text/css">
  33. <!--
  34. .progressStatus {
  35.     color:#000000; 
  36.     font-size:10px;
  37. }
  38. <?php echo $monitor->getStyle()?>
  39. // -->
  40. </style>
  41. <script type="text/javascript">
  42. <!--
  43. <?php echo $monitor->getScript()?>
  44. //-->
  45. </script>
  46. </head>
  47. <body>
  48. <h1><?php echo basename(__FILE__)?></h1>
  49.  
  50. <?php 
  51. $renderer =HTML_QuickForm::defaultRenderer();
  52. $renderer->setFormTemplate('
  53.     <table width="450" border="0" cellpadding="3" cellspacing="2" bgcolor="#CCCC99">
  54.     <form{attributes}>{content}
  55.     </form>
  56.     </table>
  57.     ');
  58. $renderer->setHeaderTemplate('
  59.     <tr>
  60.         <td style="white-space:nowrap;background:#996;color:#ffc;" align="left" colspan="2"><b>{header}</b></td>
  61.     </tr>
  62.     ');
  63. $monitor->accept($renderer);
  64.  
  65. echo $renderer->toHtml();
  66.  
  67. $monitor->run();   
  68. ?>
  69.  
  70. <p>&lt;&lt; <a href="index.html">Back examples TOC</a></p>
  71.  
  72. </body>
  73. </html>

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