本文整理汇总了PHP中HTML_Progress类的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Progress类的具体用法?PHP HTML_Progress怎么用?PHP HTML_Progress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTML_Progress类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTML_Progress_Model
/**
* The progress bar's UI extended model class constructor
*
* @param string $file file name of model properties
* @param string $type type of external ressource (phpArray, iniFile, XML ...)
*
* @since 1.0
* @access public
* @throws HTML_PROGRESS_ERROR_INVALID_INPUT
*/
function HTML_Progress_Model($file, $type)
{
$this->_package = 'HTML_Progress';
if (!file_exists($file)) {
return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'error', array('var' => '$file', 'was' => $file, 'expected' => 'file exists', 'paramnum' => 1));
}
$conf = new Config();
if (!$conf->isConfigTypeRegistered($type)) {
return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'error', array('var' => '$type', 'was' => $type, 'expected' => implode(" | ", array_keys($GLOBALS['CONFIG_TYPES'])), 'paramnum' => 2));
}
$data = $conf->parseConfig($file, $type);
$structure = $data->toArray(false);
$this->_progress =& $structure['root'];
if (is_array($this->_progress['cell']['font-family'])) {
$this->_progress['cell']['font-family'] = implode(",", $this->_progress['cell']['font-family']);
}
if (is_array($this->_progress['string']['font-family'])) {
$this->_progress['string']['font-family'] = implode(",", $this->_progress['string']['font-family']);
}
$this->_orientation = $this->_progress['orientation']['shape'];
$this->_fillWay = $this->_progress['orientation']['fillway'];
if (isset($this->_progress['script']['file'])) {
$this->_script = $this->_progress['script']['file'];
} else {
$this->_script = null;
}
if (isset($this->_progress['cell']['count'])) {
$this->_cellCount = $this->_progress['cell']['count'];
} else {
$this->_cellCount = 10;
}
$this->_updateProgressSize();
}
示例2: InitProgressBar
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();
}
示例3: HTML_Progress
<?php
// listing-2.2.2.php
require_once 'HTML/Progress.php';
$progress = new HTML_Progress();
$ui =& $progress->getUI();
$ui->setCellCount(20);
$ui->setBorderAttributes('width=1 color=#000000');
$ui->setCellAttributes(array('active-color' => '#970038', 'inactive-color' => '#FFDDAA', 'width' => 20, 'height' => 20));
?>
<!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>
<style type="text/css">
<!--
<?php
echo $progress->getStyle();
?>
body {
background-color: #FFFFFF;
color: #000000;
font-family: Verdana, Arial;
}
// -->
</style>
<script type="text/javascript">
<!--
示例4: HTML_Progress
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setValue(50);
$bar->setBorderPainted(true);
$ui =& $bar->getUI();
$ui->setFillWay('reverse');
$ui->setCellCount(5);
$ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
$ui->setBorderAttributes('width=1 color=#000000');
$ui->setStringAttributes('font-size=14 color=#FF0000 align=left 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>setStringAttributes example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
// -->
</style>
<script type="text/javascript">
<!--
<?php
echo $ui->getScript();
示例5: header
if (file_exists($filename)) {
// Send binary filetype HTTP header
header('Content-Type: application/octet-stream');
// Send content-length HTTP header
header('Content-Length: ' . filesize($filename));
// Send content-disposition with save file name HTTP header
header('Content-Disposition: attachment; filename="' . $saveasname . '"');
// Output file
readfile($filename);
// Done
exit;
}
/* END Archive Download */
}
// Set up progress bar
$bar = new HTML_Progress();
$bar->setAnimSpeed(100);
$bar->setIncrement(1);
$bar->setBorderPainted(true);
$ui =& $bar->getUI();
$ui->setCellAttributes('active-color=#000084 inactive-color=#3A6EA5 width=4 spacing=0');
$ui->setBorderAttributes('width=1 style=inset color=white');
$ui->setStringAttributes(array('width' => 200, 'height' => 20, 'font-size' => 14, 'valign' => 'top'));
$ui->setCellCount(100);
// Start building archive
require_once $php_root_path . "/includes/pear/Tar.php";
require_once $php_root_path . "/includes/pear/Zip.php";
//State the current part of zip file that is being extracted
if (empty($_POST["currentZipPart"])) {
$currentZipPart = 1;
}
示例6: disableButton
/**
* Disables certain buttons for a page.
*
* Buttons [ = events] : back, next, cancel, reset, apply, help
*
* @param object $page Page where you want to activate buttons
* @param array $events (optional) List of buttons
*
* @since 1.1
* @access public
* @throws HTML_PROGRESS_ERROR_INVALID_INPUT
* @see enableButton()
*/
function disableButton(&$page, $events = array())
{
if (!is_a($page, 'HTML_QuickForm_Page')) {
return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception', array('var' => '$page', 'was' => gettype($page), 'expected' => 'HTML_QuickForm_Page object', 'paramnum' => 1));
} elseif (!is_array($events)) {
return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception', array('var' => '$events', 'was' => gettype($events), 'expected' => 'array', 'paramnum' => 2));
}
static $all;
if (!isset($all)) {
$all = array('back', 'next', 'cancel', 'reset', 'apply', 'help');
}
$buttons = count($events) == 0 ? $all : $events;
foreach ($buttons as $event) {
$group = $page->getElement('buttons');
$elements = $group->getElements();
foreach (array_keys($elements) as $key) {
if ($group->getElementName($key) == $page->getButtonName($event)) {
$elements[$key]->updateAttributes(array('disabled' => 'true'));
}
}
}
}
示例7: HTML_Progress
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
printf('direct way: maximum = %d <br/>', $bar->getMaximum());
$dm =& $bar->getDM();
printf('another way: maximum = %d <br/>', $dm->getMaximum());
示例8: HTML_Progress
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$ui =& $bar->getUI();
$css =& $ui->getStyle();
print '<pre>';
echo '<h1>object</h1>';
print_r($css);
echo '<h1>plain text</h1><br/>';
print_r($css->toString());
print '</pre>';
示例9: unlink
$obj->display();
unlink($semaphore);
}
// sleep a bit ...
if ($version > 1.1) {
$obj->sleep();
} else {
for ($i = 0; $i < $obj->_anim_speed * 1000; $i++) {
}
}
}
/*
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');
示例10: myFunctionHandler
*
* @version $Id: hidden.php,v 1.2 2005/07/25 11:23:37 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_Progress
* @subpackage Examples
*/
require_once 'HTML/Progress.php';
/*
user callback: job to do while the progress meter is visible
*/
function myFunctionHandler($progressValue, &$obj)
{
$obj->sleep();
// nothing to do here, except sleep a bit ...
}
$progress = new HTML_Progress();
$progress->setAnimSpeed(100);
$progress->setIncrement(10);
$progress->setProgressHandler('myFunctionHandler');
?>
<html>
<head>
<style type="text/css">
<!--
body {
background-color: #CCCC99;
color: #996;
font-family: Verdana, Arial;
}
a:visited, a:active, a:link {
示例11: HTML_Progress
<?php
@(include '../include_path.php');
/**
* Horizontal no String ProgressBar example.
*
* @version $Id: nostring.php,v 1.1 2004/07/05 21:32:09 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_Progress
*/
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setAnimSpeed(100);
$bar->setIncrement(10);
$bar->setStringPainted(true);
// get space for the string
$bar->setString('');
// but don't paint it
?>
<html>
<head>
<title>Horizontal no String ProgressBar example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
body {
background-color: #FFFFFF;
color: #000000;
示例12: HTML_Progress
* @package HTML_Progress
* @subpackage Examples
*/
require_once 'HTML/Progress.php';
$bar1 = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
$bar1->setAnimSpeed(20);
$bar1->setIdent('PB1');
$bar1->setIncrement(10);
$bar1->setBorderPainted(true);
$ui1 =& $bar1->getUI();
$ui1->setFillWay('natural');
$ui1->setCellCount(15);
$ui1->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=50 height=13');
$ui1->setBorderAttributes('width=1 color=#000000');
$ui1->setStringAttributes(array('font-size' => 8, 'color' => '#FF0000', 'background-color' => '#C3C6C3', 'align' => 'center', 'valign' => 'bottom'));
$bar2 = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
$bar2->setAnimSpeed(20);
$bar2->setIdent('PB2');
$bar2->setIncrement(5);
$bar2->setBorderPainted(true);
$ui2 =& $bar2->getUI();
$ui2->setFillWay('reverse');
$ui2->setCellCount(15);
$ui2->setCellAttributes('active-color=#3874B4 inactive-color=#FFDDAA width=50 height=13');
$ui2->setBorderAttributes('width=1 style=dashed color=#000000');
$ui2->setStringAttributes(array('font-size' => 8, 'color' => 'navy', '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">
示例13: HTML_Progress
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$test = "\$res = \$bar->isIndeterminate() ? 'yes':'no';";
eval($test);
printf('try 1: progress bar in indeterminate mode ? %s <br/>', $res);
$bar->setIndeterminate(true);
eval($test);
printf('try 2: progress bar in indeterminate mode ? %s <br/>', $res);
示例14: myMethodHandler
/**
* @ignore
*/
class myClassHandler
{
function myMethodHandler($progressValue, &$bar)
{
if (fmod($progressValue, 10) == 0) {
echo "myMethodHandler -> progress value is = {$progressValue} <br/>\n";
}
$bar->sleep();
}
}
$obs = new myClassHandler();
$monitor = new HTML_Progress_Monitor('frmMonitor3', array('button' => array('style' => 'width:80px;')));
$progress = new HTML_Progress();
$progress->setUI('Progress_Default2');
// Attach a progress ui-model
$progress->setAnimSpeed(20);
$progress->setProgressHandler(array(&$obs, 'myMethodHandler'));
$monitor->setProgressElement($progress);
?>
<html>
<head>
<title>ProgressBar Monitor - Default renderer </title>
<style type="text/css">
<!--
.progressStatus {
color:#000000;
font-size:10px;
}
示例15: HTML_Progress
<?php
require_once 'HTML/Progress/monitor.php';
$bar = new HTML_Progress();
$mon = new HTML_Progress_Monitor();
$bar->addListener($mon);
$li = $bar->getListeners();
printf("%d listener(s) <br/>", count($li));