cvs: pear /HTML_Progress/examples/preload hidden.html hidden.php
| From: | Laurent Laville | Date: | Sun, 27 Jun 2004 18:30:57 +0000 |
| Subject: | cvs: pear /HTML_Progress/examples/preload hidden.html hidden.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21200@lists.php.net to get a copy of this message | ||
farell Sun Jun 27 14:30:57 2004 EDT
Added files:
/pear/HTML_Progress/examples/preload hidden.html hidden.php
Log:
example on new function HTML_Progress::hide() in version 1.2.0RC3
http://cvs.php.net/co.php/pear/HTML_Progress/examples/preload/hidden.html?r=1.1&p=1
Index: pear/HTML_Progress/examples/preload/hidden.html
+++ pear/HTML_Progress/examples/preload/hidden.html
<!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>
<meta name="robots" content="index,nofollow" >
<meta name="keywords" content"="HTML_Progress, preload, hide, progress
meter" />
<meta name="description" content"="Hide progress meter at end of a initialize
process" />
<meta name="author" content="Laurent Laville" />
<title>PEAR::HTML::Progress example: Hide progress bar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../examples.css" />
</head>
<body>
<a name="top">
<p><a href="../index.html"><img src="../images/home.gif"
alt="Examples TOC"/>examples</a></p>
<h1><span class="chapter">Hide progress bar </span></h1>
<p align="right">$Date: 2004/06/27 18:30:54 $</p>
<div class="toc"> Table of contents </div>
<ul>
<li><a href="#intro">Introduction<a>
<li><a href="#render">Render options<a>
<li><a href="#source">PHP source syntax highlight<a>
<li><a href="#run">Play demo<a>
</ul>
<a name="intro">
<h2><img src="../images/info.gif"/> Introduction</h2>
<p>This example requires :
<ul>
<li>PEAR::HTML_Progress 1.2.0RC3 or better (see source at line 11).</li>
</ul>
</p>
<hr/>
<p><b>This example will hide a progress meter at end of a initialize
process.</b></p>
<p>The initialize process is simulate by the user callback defined on lines 16 to 19.
This callback is attached on the progress bar at line 24.</p>
<p>Finally when process is over, we hide the progress bar at line 54.</p>
<p>[<a href="#top">Top</a>]</p>
<a name="render">
<h2><img src="../images/config.gif"/> Render options </h2>
<ul>
<li>Animation speed is set to 100 (see source at line 22).
<li>Increment is set to 10 (see source at line 23).
</ul>
<p>[<a href="#top">Top</a>]</p>
<a name="source">
<h2><img src="../images/source.gif"/> PHP source syntax
highlight</h2>
<a target="_blank"
href="../highlighter.php?file=preload/hidden.php">Open</a> source listing in a
new window.
<p>[<a href="#top">Top</a>]</p>
<a name="run">
<h2><img src="../images/run.gif"/> Play demo</h2>
<p><a href="hidden.php">Run</a> the script.</p>
<p>[<a href="#top">Top</a>]</p>
</body>
</html>
http://cvs.php.net/co.php/pear/HTML_Progress/examples/preload/hidden.php?r=1.1&p=1
Index: pear/HTML_Progress/examples/preload/hidden.php
+++ pear/HTML_Progress/examples/preload/hidden.php
<?php
@include '../include_path.php';
/**
* Simple example that hide a progress meter at end of process.
*
* @version $Id: hidden.php,v 1.1 2004/06/27 18:30:54 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_Progress
*/
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 {
color: yellow;
}
<?php echo $progress->getStyle(); ?>
// -->
</style>
<script type="text/javascript">
<!--
<?php echo $progress->getScript(); ?>
//-->
</script>
</head>
<body>
<?php
echo $progress->toHtml();
$progress->run();
$progress->hide();
?>
<h1>Your job is finished ! </h1>
<p>The progress meter is now hidden.</p>
<p><< <a href="../index.html">Back examples
TOC</a></p>
</body>
</html>