global $pkg; $obj->sleep(); $i = floor($progressValue / 10); if ($progressValue == 100) { $msg = ''; } else { $msg = " installing package ({$progressValue} %) ... : " . $pkg[$i]; } $obj->setString($msg); } $bar = new HTML_Progress(); $bar->setAnimSpeed(100); $bar->setIncrement(5); $bar->setStringPainted(true); // get space for the string $bar->setString(''); // but don't paint it $bar->setProgressHandler('myFunctionHandler'); $ui =& $bar->getUI(); $ui->setTab(' '); $ui->setStringAttributes('width=350 align=left'); ?> <html> <head> <title>Horizontal String ProgressBar example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?>
} } } // // 2. defines the progress meter // $meter = new HTML_Progress(); $ui =& $meter->getUI(); $ui->setProgressAttributes(array('background-color' => '#e0e0e0')); $ui->setStringAttributes(array('color' => '#996', 'background-color' => '#CCCC99')); $ui->setCellAttributes(array('active-color' => '#996')); $meter->setAnimSpeed(200); $meter->setIncrement(10); $meter->setStringPainted(true); // get space for the string $meter->setString(""); // but don't paint it $meter->setIndeterminate(true); // progress meter start in indeterminate mode ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>FTP/Progress Observer example</title> <style type="text/css"> <!-- body { background-color: #CCCC99; color: #996; font-family: Verdana, Arial;
$ui->setStringAttributes('width=350 align=left'); ?> <html> <head> <title>setStringPainted example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $bar->getScript(); ?> //--> </script> </head> <body> <?php echo $bar->toHtml(); $msg = " installing package (25 %) ... : Config"; $bar->setString($msg); $bar->display(); ?> </body> </html>
/* Which version of html_progress: (stable)1.1 or (beta)1.2.0 RC1, RC2 or RC3 */ $version = _methodExists('run') ? 1.2 : 1.1; $progress = new HTML_Progress(); $observer = new logsUpload(); // prepare the progress meter to logs all upload operations $progress->addListener($observer); $progress->setIncrement(10); $progress->setAnimSpeed(100); $progress->setIndeterminate(true); // progress bar run in indeterminate mode $progress->setStringPainted(true); // get space for the string $progress->setBorderPainted(true); $progress->setString(""); // but don't paint it if ($version > 1.1) { // set a progress handler required at least version 1.2.0RC3 $progress->setProgressHandler('myFunctionHandler'); } $ui =& $progress->getUI(); $ui->setBorderAttributes('width=1 style=inset color=white'); $ui->setCellAttributes(array('active-color' => '#000084', 'inactive-color' => '#3A6EA5', 'width' => 25, 'spacing' => 0, 'background-image' => 'download.gif')); $ui->setStringAttributes(array('width' => 60, 'font-size' => 10, 'background-color' => '#C3C6C3')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL); $bar->setAnimSpeed(80); $bar->setIdent('PB1'); $bar->setIncrement(10); $bar->setBorderPainted(true); $bar->setStringPainted(true); // get space for the string $bar->setString(""); // but don't paint it $bar->setIndeterminate(true); // progress start in indeterminate mode $ui =& $bar->getUI(); $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=50 height=13'); $ui->setBorderAttributes('width=1 color=#000000'); $ui->setStringAttributes(array('font-size' => 8, 'color' => '#FF0000', 'background-color' => '#C3C6C3', 'align' => 'center', 'valign' => 'bottom')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>setIndeterminate example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?>
<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(); $bar->setAnimSpeed(100); $bar->setIncrement(5); $bar->setStringPainted(true); // get space for the string $bar->setString(''); // but don't paint it $ui =& $bar->getUI(); $ui->setStringAttributes('width=350 align=left'); ?> <html> <head> <title>setString example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $bar->getScript(); ?> //--> </script> </head>