HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next
HTML_Progress_UI::setProgressAttributes
sets main look and feel of progress meter

Synopsis

require_once 'HTML/Progress/UI.php';

void HTML_Progress_UI::setProgressAttributes( mixed $attributes)

Description

This method is used to give a look and feel, such as size and color, to the core of progress meter.

$attributes is an associative array or string of HTML tag attributes.

Parameter

    mixed $attributes
  • the new cell attributes of the progress meter.

    Key-values allowed are:

    Attribute Format Default value
    class string progressBar
    background-color string #FFFFFF
    auto-size boolean true
    width integer (compute)
    height integer (compute)

Note

( HTML_Progress >= 1.0 )

This function can not be called statically.

See

HTML_Progress_UI::getProgressAttributes, HTML_Progress_UI::setBorderAttributes, HTML_Progress_UI::setStringAttributes, HTML_Progress_UI::setCellAttributes

Example

Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a plain progress bar. It's a dynamic example, the progress bar will run.

  1. <?php
  2. require_once 'HTML/Progress.php';
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setAnimSpeed(100);
  6. $bar->setIncrement(10);
  7. $bar->setBorderPainted(true);
  8.  
  9. $ui =& $bar->getUI();
  10. $ui->setCellAttributes(array(
  11. 'active-color' => '#000084',
  12. 'inactive-color' => '#3A6EA5',
  13. 'width' => 20,
  14. 'spacing' => 0
  15. ));
  16. $ui->setBorderAttributes('width=1 style=inset color=white');
  17. $ui->setStringAttributes(array(
  18. 'width' => 200,
  19. 'height' => 20,
  20. 'font-size' => 14,
  21. 'background-color' => '#C3C6C3',
  22. 'valign' => 'top'
  23. ));
  24. ?>
  25. <!DOCTYPE html
  26. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  27. "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  28.  
  29. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  30. <head>
  31. <title>setProgressAttributes example</title>
  32. <style type="text/css">
  33. <!--
  34. <?php echo $bar->getStyle(); ?>
  35. // -->
  36. </style>
  37. <script type="text/javascript">
  38. <!--
  39. <?php echo $bar->getScript(); ?>
  40. //-->
  41. </script>
  42. </head>
  43. <body bgcolor="#C3C6C3">
  44.  
  45. <?php
  46. echo $bar->toHtml();
  47. $bar->run();
  48. ?>
  49.  
  50. </body>
  51. </html>

Prev Up Next
HTML_Progress_UI::getProgressAttributes Reference Guide HTML_Progress_UI::getScript

Documentation generated on Sun, 12 Sep 2004 20:23:28 +0200 by phpDocumentor 1.3.0RC3