Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 49 lines (38 sloc) 1.313 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<?PHP
/**
* Simple example that builds two progress bars,
* one determined and one undetermined.
*
* @author Stephan Schmidt <schst@php.net>
* @package XML_XUL
* @subpackage Examples
*/

/**
* require XML_XUL package
*/
require_once 'XML/XUL.php';
 
$doc = &XML_XUL::createDocument();

$doc->addStylesheet('chrome://global/skin/');
 
$win = &$doc->createElement('window', array('title'=> 'Example for PEAR::XML_XUL'));
$doc->addRoot($win);

$box = &$doc->createElement( 'Groupbox' );
$win->appendChild($box);

$box->setCaption( 'Using a progressmeter' );

$box->addDescription( 'Progressmeters can either be determined...' );

$meter = &$doc->createElement( 'Progressmeter', array( 'mode' => 'determined', 'value' => '30%', 'height' => 20 ) );
$box->appendChild( $meter );

$box->addDescription( '...or undetermined.' );

$meter2 = &$doc->createElement( 'Progressmeter', array( 'mode' => 'undetermined', 'height' => 20 ) );
$box->appendChild( $meter2 );

if ($_GET['mode'] == 'debug') {
    require_once 'XML/Beautifier.php';
    $fmt = &new XML_Beautifier( array( 'indent' => ' ' ) );
    echo '<pre>';
    echo htmlspecialchars( $fmt->formatString($doc->serialize()) );
    echo '</pre>';
} elseif ($_GET['mode'] == 'source') {
    highlight_file( __FILE__ );
} else {
    $doc->send();
}
?>
Something went wrong with that request. Please try again.