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

  1. <?php
  2. /**
  3.  * Monitor example with a new form template and progress bar
  4.  * color scheme. Used a function as user callback.
  5.  *
  6.  * @version    $Id: monitor_function_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('frmMonitor4', array(
  17.     'button' => array('style' => 'width:80px;')
  18.     )
  19. );
  20. $monitor->setAnimSpeed(100);
  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->setUI('Progress_ITDynamic');
  26. $progress->setStringPainted(true);     // get space for the string
  27. $progress->setString("");              // but don't paint it
  28. $progress->setIndeterminate(true);     // Progress start in indeterminate mode
  29. $monitor->setProgressElement($progress);
  30. ?>
  31. <!DOCTYPE html
  32.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  33.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  34.  
  35. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  36. <head>
  37. <title>ProgressBar Monitor - Default renderer </title>
  38. <style type="text/css">
  39. <!--
  40. body {
  41.     background-color: lightgrey;
  42.     font-family: Verdana, Arial;
  43. }
  44. .progressStatus {
  45.     color: navy; 
  46.     font-size:10px;
  47. }
  48. <?php echo $monitor->getStyle(); ?>
  49. // -->
  50. </style>
  51. <script type="text/javascript">
  52. <!--
  53. <?php echo $monitor->getScript(); ?>
  54. //-->
  55. </script>
  56. </head>
  57. <body>
  58.  
  59. <h1>Monitor handled by function user callback</h1>
  60. <p>Used default QuickForm renderer with another non-standard color scheme
  61. for form template and progress bar.</p>
  62.  
  63.  
  64. <?php 
  65. $renderer =& HTML_QuickForm::defaultRenderer();
  66. $renderer->setFormTemplate('
  67.     <table width="450" border="0" cellpadding="3" cellspacing="2" bgcolor="#EEEEEE">
  68.     <form{attributes}>{content}
  69.     </form>
  70.     </table>
  71.     ');
  72. $renderer->setHeaderTemplate('
  73.     <tr>
  74.         <td style="white-space:nowrap;background:#7B7B88;color:#ffc;" align="left" colspan="2"><b>{header}</b></td>
  75.     </tr>
  76.     ');
  77. $monitor->accept($renderer);
  78.  
  79. // Display progress monitor dialog box
  80. echo $renderer->toHtml();
  81.  
  82.  
  83. $monitor->run();   
  84. ?>
  85.  
  86. <p><< <a href="index.html">Back examples TOC</a></p>
  87. <p><b><i>href: examples/<?php echo basename(__FILE__); ?></i></b></p>
  88.  
  89. </body>
  90. </html>