Source for file method_callback.php
Documentation is available at method_callback.php
@include '../include_path.php';
* Monitor example with a new form template and progress bar
* color scheme. Used a class-method as user callback.
* @version $Id: method_callback.php,v 1.1 2004/06/27 13:08:50 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
require_once 'HTML/Progress/monitor.php';
class Progress_Default2 extends HTML_Progress_UI
function Progress_Default2 ()
parent ::HTML_Progress_UI ();
$this->setProgressAttributes (array ('background-color' => '#e0e0e0'));
$this->setStringAttributes (array ('color' => '#996', 'background-color' => '#CCCC99'));
$this->setCellAttributes (array ('active-color' => '#996'));
function myMethodHandler ($progressValue, &$obj)
if (fmod($progressValue,10 ) == 0 ) {
echo " myMethodHandler -> progress value is = $progressValue <br/>\n";
$bar = & $obj->getProgressElement ();
$monitor = new HTML_Progress_Monitor ('frmMonitor3', array (
'button' => array ('style' => 'width:80px;')
$monitor->setProgressHandler (array ('myClassHandler','myMethodHandler'));
$progress = new HTML_Progress ();
$progress->setUI ('Progress_Default2'); // Attach a progress ui-model
$progress->setAnimSpeed (20 );
$monitor->setProgressElement ($progress);
<title>ProgressBar Monitor - Default renderer </title>
<?php echo $monitor->getStyle (); ?>
<script type="text/javascript">
<?php echo $monitor->getScript (); ?>
<h1> <?php echo basename(__FILE__ ); ?></h1>
$renderer = & HTML_QuickForm ::defaultRenderer ();
$renderer->setFormTemplate ('
<table width="450" border="0" cellpadding="3" cellspacing="2" bgcolor="#CCCC99">
<form{attributes}>{content}
$renderer->setHeaderTemplate ('
<td style="white-space:nowrap;background:#996;color:#ffc;" align="left" colspan="2"><b>{header}</b></td>
$monitor->accept ($renderer);
echo $renderer->toHtml ();
<p><< <a href="../index.html">Back examples TOC</a></p>
Documentation generated on Mon, 11 Mar 2019 13:52:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|