Source for file half_monitor.php
Documentation is available at half_monitor.php
@include '../include_path.php';
* Horizontal ProgressBar in indeterminate mode
* using the Progress_Monitor V2 solution (with QF renderer).
* @version $Id: half_monitor.php,v 1.1 2004/06/27 13:36:44 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
require_once 'HTML/Progress/monitor.php';
$obj->setCaption (" completed $c out of 400" );
$bar = & $obj->getProgressElement ();
/* rules to determine when switch back from indeterminate to determinate mode */
if ($c >= 240 && $bar->isIndeterminate ()) {
$bar->setIndeterminate (false );
$bar->setString (null ); // show percent-info
if ($bar->getPercentComplete () == 1 ) {
if ($bar->isIndeterminate ()) {
$bar->setString (''); // hide percent-info
$monitor = new HTML_Progress_Monitor ('frmMonitor',
array ( 'button' => array ('style' => 'width:80px;'),
'title' => 'Progress ...' )
// your custom user process goes here !
$monitor->setProgressHandler ('myProgressHandler');
// Attach a progress bar custom model
$progress = new HTML_Progress ();
$ui = & $progress->getUI ();
$ui->setProgressAttributes (array (
'background-color' => '#e0e0e0'
$ui->setStringAttributes (array (
'background-color' => '#CCCC99'
$ui->setCellAttributes (array (
$progress->setAnimSpeed (100 );
$progress->setIncrement (10 );
$progress->setStringPainted (true ); // get space for the string
$progress->setString (""); // but don't paint it
$progress->setIndeterminate (true ); // Progress start in indeterminate mode
$monitor->setProgressElement ($progress);
<title>Indeterminate Mode Progress example</title>
background-color: #444444;
font-family: Verdana, Arial;
a:visited, a:active, a:link {
<?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);
// Display progress monitor dialog box
echo $renderer->toHtml ();
<p><< <a href="../index.html">Back examples TOC</a></p>
Documentation generated on Mon, 11 Mar 2019 13:52:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|