home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / monitor_method_callback.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  2.2 KB  |  83 lines

  1. <?php
  2. /**
  3.  * Monitor example with a new form template and progress bar
  4.  * color scheme. Used a class-method as user callback.
  5.  *
  6.  * @version    $Id: monitor_method_callback.php,v 1.1 2004/02/10 11:55:41 farell Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  */
  10.  
  11. require_once 'HTML/Progress/monitor.php';
  12. require_once 'progressModels.php';
  13. require_once 'progressHandler.php';
  14.  
  15.  
  16. $monitor = new HTML_Progress_Monitor('frmMonitor3', array(
  17.     'button' => array('style' => 'width:80px;')
  18.     )
  19. );
  20. $monitor->setAnimSpeed(100);
  21. $monitor->setProgressHandler(array('myClassHandler','myMethodHandler'));
  22.  
  23.  
  24. // Attach a progress ui-model (see file progressModels.php for attributes definition)
  25. $progress = new HTML_Progress();
  26. $progress->setUI('Progress_Default2');
  27. $monitor->setProgressElement($progress);
  28. ?>
  29. <!DOCTYPE html
  30.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  31.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  32.  
  33. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  34. <head>
  35. <title>ProgressBar Monitor - Default renderer </title>
  36. <style type="text/css">
  37. <!--
  38. .progressStatus {
  39.     color:#000000; 
  40.     font-size:10px;
  41. }
  42. <?php echo $monitor->getStyle(); ?>
  43. // -->
  44. </style>
  45. <script type="text/javascript">
  46. <!--
  47. <?php echo $monitor->getScript(); ?>
  48. //-->
  49. </script>
  50. </head>
  51. <body>
  52.  
  53. <h1>Monitor handled by class-method user callback</h1>
  54. <p>Used default QuickForm renderer with a non-standard color scheme
  55. for form template and progress bar.</p>
  56.  
  57. <?php 
  58. $renderer =& HTML_QuickForm::defaultRenderer();
  59. $renderer->setFormTemplate('
  60.     <table width="450" border="0" cellpadding="3" cellspacing="2" bgcolor="#CCCC99">
  61.     <form{attributes}>{content}
  62.     </form>
  63.     </table>
  64.     ');
  65. $renderer->setHeaderTemplate('
  66.     <tr>
  67.         <td style="white-space:nowrap;background:#996;color:#ffc;" align="left" colspan="2"><b>{header}</b></td>
  68.     </tr>
  69.     ');
  70. $monitor->accept($renderer);
  71.  
  72. // Display progress monitor dialog box
  73. echo $renderer->toHtml();
  74.  
  75.  
  76. $monitor->run();   
  77. ?>
  78.  
  79. <p><< <a href="index.html">Back examples TOC</a></p>
  80. <p><b><i>href: examples/<?php echo basename(__FILE__); ?></i></b></p>
  81.  
  82. </body>
  83. </html>