Ejemplo n.º 1
0
function InitProgressBar($increment = 1)
{
    global $progress_bar;
    $progress_bar = new HTML_Progress();
    $progress_bar->setAnimSpeed(100);
    //$progress_bar->setIncrement( (int)$increment );
    //$progress_bar->setIndeterminate(true);
    $progress_bar->setBorderPainted(true);
    $ui =& $progress_bar->getUI();
    $ui->setCellAttributes('active-color=#3874B4 inactive-color=#CCCCCC width=10');
    $ui->setBorderAttributes('width=1 color=navy');
    $ui->setStringAttributes('width=60 font-size=14 background-color=#FFFFFF align=center');
    ?>
	<html>
	<head>
	<style type="text/css">
	<!--
	<?php 
    echo $progress_bar->getStyle();
    ?>

	body {
			background-color: #FFFFFF;
			color: #FFFFFF;
			font-family: Verdana, freesans;
	}

	a:visited, a:active, a:link {
			color: yellow;
	}
	// -->
	</style>
	<script type="text/javascript">
	<!--
	<?php 
    echo $progress_bar->getScript();
    ?>
	//-->
	</script>
	</head>
	<body>

	<div align="center">
	<?php 
    echo $progress_bar->toHtml();
}
Ejemplo n.º 2
0
<?php

/**
 * Natural Horizontal with background images ProgressBar example.
 * See also ProgressMaker usage with pre-set UI model 'BgImages'.
 *
 * @version    $Id: bgimages.php,v 1.2 2005/07/25 10:25:30 farell Exp $
 * @author     Laurent Laville <*****@*****.**>
 * @package    HTML_Progress
 * @subpackage Examples
 */
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setAnimSpeed(100);
$bar->setIncrement(10);
$bar->setBorderPainted(true);
$ui =& $bar->getUI();
$ui->setTab('    ');
$ui->setCellAttributes(array('active-color' => '#000084', 'inactive-color' => '#3A6EA5', 'width' => 25, 'spacing' => 0, 'background-image' => 'download.gif'));
$ui->setBorderAttributes('width=1 style=inset color=white');
$ui->setStringAttributes(array('width' => 60, 'font-size' => 10, 'background-color' => '#C3C6C3', 'align' => 'center', 'valign' => 'left'));
?>
<!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>BgImages Progress example</title>
<style type="text/css">
<!--
Ejemplo n.º 3
0
 /**
  * Creates a progress bar with options choosen on all wizard tabs.
  *
  * @since      1.1
  * @access     public
  */
 function createProgressBar()
 {
     $progress = $this->exportValues();
     $bar = new HTML_Progress();
     $bar->setIdent('PB1');
     $bar->setAnimSpeed(intval($progress['rAnimSpeed']));
     if ($progress['model'] != '') {
         $bar->setModel($progress['model'], 'iniCommented');
         $bar->setIncrement(10);
         $ui =& $bar->getUI();
     } else {
         $bar->setBorderPainted($progress['borderpainted'] == '1');
         $bar->setStringPainted($progress['stringpainted'] == '1');
         $ui =& $bar->getUI();
         $structure = array();
         /* Page 1: Progress attributes **************************************************/
         if (strlen(trim($progress['progressclass'])) > 0) {
             $structure['progress']['class'] = $progress['progressclass'];
         }
         if (strlen(trim($progress['progresssize']['bgcolor'])) > 0) {
             $structure['progress']['background-color'] = $progress['progresssize']['bgcolor'];
         }
         if (strlen(trim($progress['progresssize']['width'])) > 0) {
             $structure['progress']['width'] = $progress['progresssize']['width'];
         }
         if (strlen(trim($progress['progresssize']['height'])) > 0) {
             $structure['progress']['height'] = $progress['progresssize']['height'];
         }
         $structure['progress']['auto-size'] = $progress['autosize'] == '1';
         $ui->setProgressAttributes($structure['progress']);
         $orient = $progress['shape'] == '1' ? HTML_PROGRESS_BAR_HORIZONTAL : HTML_PROGRESS_BAR_VERTICAL;
         $ui->setOrientation($orient);
         $ui->setFillWay($progress['way']);
         /* Page 2: Cell attributes ******************************************************/
         if (strlen(trim($progress['cellid'])) > 0) {
             $structure['cell']['id'] = $progress['cellid'];
         }
         if (strlen(trim($progress['cellclass'])) > 0) {
             $structure['cell']['class'] = $progress['cellclass'];
         }
         if (strlen(trim($progress['cellvalue']['min'])) > 0) {
             $bar->setMinimum(intval($progress['cellvalue']['min']));
         }
         if (strlen(trim($progress['cellvalue']['max'])) > 0) {
             $bar->setMaximum(intval($progress['cellvalue']['max']));
         }
         if (strlen(trim($progress['cellvalue']['inc'])) > 0) {
             $bar->setIncrement(intval($progress['cellvalue']['inc']));
         }
         if (strlen(trim($progress['cellsize']['width'])) > 0) {
             $structure['cell']['width'] = $progress['cellsize']['width'];
         }
         if (strlen(trim($progress['cellsize']['height'])) > 0) {
             $structure['cell']['height'] = $progress['cellsize']['height'];
         }
         if (strlen(trim($progress['cellsize']['spacing'])) > 0) {
             $structure['cell']['spacing'] = $progress['cellsize']['spacing'];
         }
         if (strlen(trim($progress['cellsize']['count'])) > 0) {
             $ui->setCellCount(intval($progress['cellsize']['count']));
         }
         if (strlen(trim($progress['cellcolor']['active'])) > 0) {
             $structure['cell']['active-color'] = $progress['cellcolor']['active'];
         }
         if (strlen(trim($progress['cellcolor']['inactive'])) > 0) {
             $structure['cell']['inactive-color'] = $progress['cellcolor']['inactive'];
         }
         if (strlen(trim($progress['cellfont']['family'])) > 0) {
             $structure['cell']['font-family'] = $progress['cellfont']['family'];
         }
         if (strlen(trim($progress['cellfont']['size'])) > 0) {
             $structure['cell']['font-size'] = $progress['cellfont']['size'];
         }
         if (strlen(trim($progress['cellfont']['color'])) > 0) {
             $structure['cell']['color'] = $progress['cellfont']['color'];
         }
         $ui->setCellAttributes($structure['cell']);
         /* Page 3: Border attributes ****************************************************/
         if (strlen(trim($progress['borderclass'])) > 0) {
             $structure['border']['class'] = $progress['borderclass'];
         }
         if (strlen(trim($progress['borderstyle']['width'])) > 0) {
             $structure['border']['width'] = $progress['borderstyle']['width'];
         }
         if (strlen(trim($progress['borderstyle']['style'])) > 0) {
             $structure['border']['style'] = $progress['borderstyle']['style'];
         }
         if (strlen(trim($progress['borderstyle']['color'])) > 0) {
             $structure['border']['color'] = $progress['borderstyle']['color'];
         }
         $ui->setBorderAttributes($structure['border']);
         /* Page 4: String attributes ****************************************************/
         if (strlen(trim($progress['stringid'])) > 0) {
             $structure['string']['id'] = $progress['stringid'];
         }
         if (strlen(trim($progress['stringsize']['width'])) > 0) {
             $structure['string']['width'] = $progress['stringsize']['width'];
         }
         if (strlen(trim($progress['stringsize']['height'])) > 0) {
             $structure['string']['height'] = $progress['stringsize']['height'];
         }
         if (strlen(trim($progress['stringsize']['bgcolor'])) > 0) {
             $structure['string']['background-color'] = $progress['stringsize']['bgcolor'];
         }
         if (strlen(trim($progress['stringalign'])) > 0) {
             $structure['string']['align'] = $progress['stringalign'];
         }
         if (strlen(trim($progress['stringvalign'])) > 0) {
             $structure['string']['valign'] = $progress['stringvalign'];
         }
         if (strlen(trim($progress['stringfont']['family'])) > 0) {
             $structure['string']['font-family'] = $progress['stringfont']['family'];
         }
         if (strlen(trim($progress['stringfont']['size'])) > 0) {
             $structure['string']['font-size'] = $progress['stringfont']['size'];
         }
         if (strlen(trim($progress['stringfont']['color'])) > 0) {
             $structure['string']['color'] = $progress['stringfont']['color'];
         }
         $ui->setStringAttributes($structure['string']);
     }
     // end-if-no-model
     return $bar;
 }
Ejemplo n.º 4
0
}
/*
   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">