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

  1. <?php
  2. /**
  3.  * Monitor example using ITDynamic QF renderer, and 
  4.  * a class-method as user callback.
  5.  *
  6.  * @version    $Id: monitor_itdynamic.php,v 1.2 2004/02/14 21:56:13 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. require_once 'HTML/QuickForm/Renderer/ITDynamic.php';
  15. // can use either HTML_Template_Sigma or HTML_Template_ITX
  16. require_once 'HTML/Template/ITX.php';
  17. //require_once 'HTML/Template/Sigma.php';
  18.  
  19.  
  20. $monitor = new HTML_Progress_Monitor('frmMonitor5', array(
  21.     'title'  => 'Upload your pictures',
  22.     'start'  => 'Upload',
  23.     'cancel' => 'Stop',
  24.     'button' => array('style' => 'width:80px;')
  25.     )
  26. );
  27. $monitor->setAnimSpeed(100);
  28. $monitor->setProgressHandler(array('my2ClassHandler','my1Method'));
  29.  
  30. // Attach a progress ui-model (see file progressModels.php for attributes definition)
  31. $progress = new HTML_Progress();
  32. $progress->setUI('Progress_ITDynamic');
  33. $monitor->setProgressElement($progress);
  34.  
  35. // can use either HTML_Template_Sigma or HTML_Template_ITX
  36. $tpl =& new HTML_Template_ITX('./templates');
  37. // $tpl =& new HTML_Template_Sigma('./templates');
  38.  
  39.  
  40. $tpl->loadTemplateFile('itdynamic_monitor.html');
  41.  
  42. $tpl->setVariable(array(
  43.     'qf_style'  => "body {font-family: Verdana, Arial; } \n" . $monitor->getStyle(),
  44.     'qf_script' => $monitor->getScript()
  45.     )
  46. );
  47.  
  48. $renderer =& new HTML_QuickForm_Renderer_ITDynamic($tpl);
  49. $renderer->setElementBlock(array(
  50.     'buttons'     => 'qf_buttons'
  51. ));
  52.  
  53. $monitor->accept($renderer);
  54.  
  55. // Display progress uploader dialog box
  56. $tpl->show();
  57.  
  58.  
  59. $monitor->run();   
  60.  
  61. echo '<p><< <a href="index.html">Back examples TOC</a></p>';
  62. echo '<p><b><i>href: examples/'.basename(__FILE__).'</i></b></p>';
  63. ?>