cvs: pear /HTML_Progress2/examples/monitor monitordyn.php

From: Date: Mon, 01 Aug 2005 08:35:03 +0000
Subject: cvs: pear /HTML_Progress2/examples/monitor monitordyn.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33499@lists.php.net to get a copy of this message
farell Mon Aug 1 04:35:03 2005 EDT Modified files: /pear/HTML_Progress2/examples/monitor monitordyn.php Log: - respect new progress monitor interface - use template sigma rather than ITX http://cvs.php.net/diff.php/pear/HTML_Progress2/examples/monitor/monitordyn.php?r1=1.1&r2=1.2&ty=u Index: pear/HTML_Progress2/examples/monitor/monitordyn.php diff -u pear/HTML_Progress2/examples/monitor/monitordyn.php:1.1 pear/HTML_Progress2/examples/monitor/monitordyn.php:1.2 --- pear/HTML_Progress2/examples/monitor/monitordyn.php:1.1 Sun Jun 12 17:05:38 2005 +++ pear/HTML_Progress2/examples/monitor/monitordyn.php Mon Aug 1 04:35:03 2005 @@ -1,9 +1,9 @@ <?php /** - * Progress2 Monitor using ITDynamic QF renderer, + * Progress2 Monitor using ITDynamic QF renderer, * and a class-method as user callback. * - * @version $Id: monitordyn.php,v 1.1 2005/06/12 21:05:38 farell Exp $ + * @version $Id: monitordyn.php,v 1.2 2005/08/01 08:35:03 farell Exp $ * @author Laurent Laville <pear@laurent-laville.org> * @package HTML_Progress2 * @subpackage Examples @@ -11,12 +11,14 @@ */ require_once 'HTML/Progress2/Monitor.php'; require_once 'HTML/QuickForm/Renderer/ITDynamic.php'; -require_once 'HTML/Template/ITX.php'; +require_once 'HTML/Template/Sigma.php'; class myClassHandler { - function myMethod($pValue, &$pMon) + function myMethod($pValue, &$pb) { + global $pm; + switch ($pValue) { case 10: $pic = 'picture1.jpg'; @@ -31,13 +33,12 @@ $pic = null; } if (!is_null($pic)) { - $pMon->setCaption('upload %file% in progress ... ' - . 'Start at %percent%%', - array('file' => $pic, 'percent' => $pValue) - ); + $pm->setCaption('upload %file% in progress ... ' + . 'Start at %percent%%', + array('file' => $pic, 'percent' => $pValue) + ); } - $bar =& $pMon->getProgressElement(); - $bar->sleep(); + $pb->sleep(); } } @@ -46,9 +47,7 @@ 'start' => 'Upload', 'cancel' => 'Stop', 'button' => array('style' => 'width:80px;') - ) -); -$pm->setProgressHandler(array('myClassHandler','myMethod')); +)); $pb =& $pm->getProgressElement(); $pb->setAnimSpeed(50); @@ -57,15 +56,16 @@ $pb->setCellAttributes('inactive-color=#FFF active-color=#444444'); $pb->setLabelAttributes('pct1', 'color=navy'); $pb->setLabelAttributes('monitorStatus', 'color=navy font-size=10'); +$pb->setProgressHandler(array('myClassHandler','myMethod')); $pm->setProgressElement($pb); -$tpl =& new HTML_Template_ITX('.'); +$tpl =& new HTML_Template_Sigma('.'); $tpl->loadTemplateFile('itdynamic.html'); $tpl->setVariable(array( 'qf_style' => $pm->getStyle(), - 'qf_script' => $pm->getScript() + 'qf_script' => $pm->getScript(false) ) ); @@ -76,4 +76,7 @@ $tpl->show(); $pm->run(); -?> \ No newline at end of file +?> + +</body> +</html> \ No newline at end of file

« previous php.pear.cvs (#33499) next »