break; case 70: $pic = 'picture3.jpg'; break; default: $pic = null; } if (!is_null($pic)) { $obj->setCaption('upload <b>%file%</b> in progress ... Start at %percent%%', array('file' => $pic, 'percent' => $progressValue)); } $bar =& $obj->getProgressElement(); $bar->sleep(); // slow animation because we do noting else } } $monitor = new HTML_Progress_Monitor('frmMonitor5', array('title' => 'Upload your pictures', 'start' => 'Upload', 'cancel' => 'Stop', 'button' => array('style' => 'width:80px;'))); $monitor->setProgressHandler(array('my2ClassHandler', 'my1Method')); $progress = new HTML_Progress(); $progress->setUI('Progress_ITDynamic'); $progress->setAnimSpeed(50); $monitor->setProgressElement($progress); $tpl =& new HTML_Template_ITX('../templates'); $tpl->loadTemplateFile('itdynamic_monitor.html'); $tpl->setVariable(array('qf_style' => "body {font-family: Verdana, Arial; } \n" . $monitor->getStyle(), 'qf_script' => $monitor->getScript())); $renderer =& new HTML_QuickForm_Renderer_ITDynamic($tpl); $renderer->setElementBlock(array('buttons' => 'qf_buttons')); $monitor->accept($renderer); // Display progress uploader dialog box $tpl->show(); $monitor->run(); echo '<p><< <a href="../index.html">Back examples TOC</a></p>';
$monitor = new HTML_Progress_Monitor(); $bar =& $monitor->getProgressElement(); $bar->setAnimSpeed(50); $bar->setIncrement(10); ?> <html> <head> <title>ProgressBar Monitor - Default renderer </title> <style type="text/css"> <!-- .progressStatus { color:#000000; font-size:10px; } <?php echo $monitor->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $monitor->getScript(); ?> //--> </script> </head> <body> <?php echo $monitor->toHtml();
<?php @(include '../include_path.php'); /** * PEAR::HTML_Page package made it easy to build * a very simple ProgressBar Monitor. * * @version $Id: htmlpage.php,v 1.1 2004/06/27 13:08:50 farell Exp $ * @author Laurent Laville <*****@*****.**> * @package HTML_Progress */ require_once 'HTML/Progress/monitor.php'; require_once 'HTML/Page.php'; $p = new HTML_Page(array('charset' => 'utf-8', 'lineend' => OS_WINDOWS ? 'win' : 'unix', 'doctype' => "XHTML 1.0 Strict", 'language' => 'en', 'cache' => 'false')); $p->setTitle("PEAR::HTML_Progress - Simple Monitor demo"); $p->setMetaData("author", "Laurent Laville"); $progressMonitor = new HTML_Progress_Monitor(); $bar =& $progressMonitor->getProgressElement(); $bar->setAnimSpeed(20); $p->addStyleDeclaration($progressMonitor->getStyle()); $p->addScriptDeclaration($progressMonitor->getScript()); $p->addBodyContent('<h1>PEAR::HTML_Page renderer without user-callback</h1>'); $p->addBodyContent($progressMonitor->toHtml()); $p->addBodyContent('<p><< <a href="../index.html">Back examples TOC</a></p>'); $p->display(); $progressMonitor->run();