home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / HTML / Progress / generator.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  24.1 KB  |  561 lines

  1. <?php
  2. /**
  3.  * The HTML_Progress_Generator class provides an easy way to
  4.  * dynamic build Progress bar, show a preview,
  5.  * and save php/css code for a later reuse.
  6.  *
  7.  * PHP versions 4 and 5
  8.  *
  9.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  10.  * that is available through the world-wide-web at the following URI:
  11.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  12.  * the PHP License and are unable to obtain it through the web, please
  13.  * send a note to license@php.net so we can mail you a copy immediately.
  14.  *
  15.  * @category   HTML
  16.  * @package    HTML_Progress
  17.  * @subpackage Progress_UI
  18.  * @author     Laurent Laville <pear@laurent-laville.org>
  19.  * @copyright  1997-2005 The PHP Group
  20.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  21.  * @version    CVS: $Id: generator.php,v 1.8 2005/07/25 13:06:58 farell Exp $
  22.  * @link       http://pear.php.net/package/HTML_Progress
  23.  */
  24.  
  25. require_once 'HTML/QuickForm/Controller.php';
  26. require_once 'HTML/QuickForm/Action/Submit.php';
  27. require_once 'HTML/QuickForm/Action/Jump.php';
  28. require_once 'HTML/QuickForm/Action/Display.php';
  29. require_once 'HTML/QuickForm/Action/Direct.php';
  30. require_once 'HTML/Progress.php';
  31. require_once 'HTML/Progress/generator/pages.php';
  32.  
  33. /**
  34.  * The HTML_Progress_Generator class provides an easy way to
  35.  * dynamic build Progress bar, show a preview,
  36.  * and save php/css code for a later reuse.
  37.  *
  38.  * PHP versions 4 and 5
  39.  *
  40.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  41.  * that is available through the world-wide-web at the following URI:
  42.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  43.  * the PHP License and are unable to obtain it through the web, please
  44.  * send a note to license@php.net so we can mail you a copy immediately.
  45.  *
  46.  * @category   HTML
  47.  * @package    HTML_Progress
  48.  * @subpackage Progress_UI
  49.  * @author     Laurent Laville <pear@laurent-laville.org>
  50.  * @copyright  1997-2005 The PHP Group
  51.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  52.  * @version    Release: 1.2.5
  53.  * @link       http://pear.php.net/package/HTML_Progress
  54.  */
  55.  
  56. class HTML_Progress_Generator extends HTML_QuickForm_Controller
  57. {
  58.     /**#@+
  59.      * Attributes of wizard form.
  60.      *
  61.      * @var        mixed
  62.      * @since      1.1
  63.      * @access     private
  64.      */
  65.     var $_buttonBack   = '<< Back';
  66.     var $_buttonNext   = 'Next >>';
  67.     var $_buttonCancel = 'Cancel';
  68.     var $_buttonReset  = 'Reset';
  69.     var $_buttonApply  = 'Preview';
  70.     var $_buttonSave   = 'Save';
  71.     var $_buttonAttr   = array('style'=>'width:80px;');
  72.     /**#@-*/
  73.  
  74.     /**
  75.      * Tabs element of wizard form.
  76.      *
  77.      * @var        array
  78.      * @since      1.1
  79.      * @access     private
  80.      */
  81.     var $_tabs;
  82.  
  83.     /**
  84.      * The progress object renders into this generator.
  85.      *
  86.      * @var        object
  87.      * @since      1.2.0
  88.      * @access     private
  89.      */
  90.     var $_progress;
  91.  
  92.  
  93.     /**
  94.      * Constructor Summary
  95.      *
  96.      * o Creates a standard progress bar generator wizard.
  97.      *   <code>
  98.      *   $generator = new HTML_Progress_Generator();
  99.      *   </code>
  100.      *
  101.      * o Creates a progress bar generator wizard with
  102.      *   customized actions: progress bar preview, form rendering, buttons manager
  103.      *   <code>
  104.      *   $controllerName = 'myPrivateGenerator';
  105.      *   $attributes = array(
  106.      *        'preview' => name of a HTML_QuickForm_Action instance
  107.      *                     (default 'ActionPreview', see 'HTML/Progress/generator/preview.php')
  108.      *        'display' => name of a HTML_QuickForm_Action_Display instance
  109.      *                     (default 'ActionDisplay', see 'HTML/Progress/generator/default.php')
  110.      *        'process' => name of a HTML_QuickForm_Action instance
  111.      *                     (default 'ActionProcess', see 'HTML/Progress/generator/process.php')
  112.      *   );
  113.      *   $generator = new HTML_Progress_Generator($controllerName, $attributes);
  114.      *   </code>
  115.      *
  116.      * @param      string    $controllerName(optional) Name of generator wizard (QuickForm)
  117.      * @param      array     $attributes    (optional) List of renderer options
  118.      * @param      array     $errorPrefs    (optional) Hash of params to configure error handler
  119.      *
  120.      * @since      1.1
  121.      * @access     public
  122.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  123.      */
  124.     function HTML_Progress_Generator($controllerName = 'ProgressGenerator', $attributes = array(), $errorPrefs = array())
  125.     {
  126.         $this->_progress = new HTML_Progress($errorPrefs);
  127.  
  128.         if (!is_string($controllerName)) {
  129.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  130.                 array('var' => '$controllerName',
  131.                       'was' => gettype($controllerName),
  132.                       'expected' => 'string',
  133.                       'paramnum' => 1));
  134.  
  135.         } elseif (!is_array($attributes)) {
  136.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  137.                 array('var' => '$attributes',
  138.                       'was' => gettype($attributes),
  139.                       'expected' => 'array',
  140.                       'paramnum' => 2));
  141.         }
  142.         parent::HTML_QuickForm_Controller($controllerName);
  143.  
  144.         // Check if Action(s) are customized
  145.         $ActionPreview = isset($attributes['preview'])? $attributes['preview']: 'ActionPreview';
  146.         $ActionDisplay = isset($attributes['display'])? $attributes['display']: 'ActionDisplay';
  147.         $ActionProcess = isset($attributes['process'])? $attributes['process']: 'ActionProcess';
  148.  
  149.         $this->_tabs = array(
  150.             0 => array('page1', 'Property1', 'Progress'),
  151.             1 => array('page2', 'Property2', 'Cell'),
  152.             2 => array('page3', 'Property3', 'Border'),
  153.             3 => array('page4', 'Property4', 'String'),
  154.             4 => array('page5', 'Preview',   'Preview'),
  155.             5 => array('page6', 'Save',      'Save')
  156.         );
  157.  
  158.         foreach ($this->_tabs as $tab) {
  159.             list($pageName, $className, $tabName) = $tab;
  160.             // Add each tab of the wizard
  161.             $this->addPage(new $className($pageName));
  162.  
  163.             // These actions manage going directly to the pages with the same name
  164.             $this->addAction($pageName, new HTML_QuickForm_Action_Direct());
  165.         }
  166.         $preview =& $this->getPage('page5');
  167.  
  168.         // The customized actions
  169.         if (!class_exists($ActionPreview)) {
  170.             include_once 'HTML/Progress/generator/preview.php';
  171.             $ActionPreview = 'ActionPreview';
  172.         }
  173.         if (!class_exists($ActionDisplay)) {
  174.             include_once 'HTML/Progress/generator/default.php';
  175.             $ActionDisplay = 'ActionDisplay';
  176.         }
  177.         if (!class_exists($ActionProcess)) {
  178.             include_once 'HTML/Progress/generator/process.php';
  179.             $ActionProcess = 'ActionProcess';
  180.         }
  181.         $preview->addAction('apply', new $ActionPreview());
  182.         $this->addAction('display', new $ActionDisplay());
  183.         $this->addAction('process', new $ActionProcess());
  184.         $this->addAction('cancel',  new $ActionProcess());
  185.  
  186.         // set ProgressBar default values on first run
  187.         $sess = $this->container();
  188.         $defaults = $sess['defaults'];
  189.  
  190.         if (count($sess['defaults']) == 0) {
  191.             $this->setDefaults(array(
  192.                 'progressclass' => 'progressBar',
  193.                 'shape'         => HTML_PROGRESS_BAR_HORIZONTAL,
  194.                 'way'           => 'natural',
  195.                 'autosize'      => true,
  196.                 'progresssize'  => array('bgcolor' => '#FFFFFF'),
  197.                 'rAnimSpeed'    => 100,
  198.  
  199.                 'borderpainted' => false,
  200.                 'borderclass'   => 'progressBarBorder',
  201.                 'borderstyle'   => array('style' => 'solid', 'width' => 0, 'color' => '#000000'),
  202.  
  203.                 'cellid'        => 'progressCell%01s',
  204.                 'cellclass'     => 'cell',
  205.                 'cellvalue'     => array('min' => 0, 'max' => 100, 'inc' => 1),
  206.                 'cellsize'      => array('width' => 15, 'height' => 20, 'spacing' => 2, 'count' => 10),
  207.                 'cellcolor'     => array('active' => '#006600', 'inactive' => '#CCCCCC'),
  208.                 'cellfont'      => array('family' => 'Courier, Verdana', 'size' => 8, 'color' => '#000000'),
  209.  
  210.                 'stringpainted' => false,
  211.                 'stringid'      => 'installationProgress',
  212.                 'stringsize'    => array('width' => 50, 'height' => '', 'bgcolor' => '#FFFFFF'),
  213.                 'stringvalign'  => 'right',
  214.                 'stringalign'   => 'right',
  215.                 'stringfont'    => array('family' => 'Verdana, Arial, Helvetica, sans-serif', 'size' => 12, 'color' => '#000000'),
  216.                 'strings'       => implode(";\n", array(
  217.                                        0 => '10,Hello world',
  218.                                        1 => '20,Welcome',
  219.                                        2 => '30,to',
  220.                                        3 => '40,HTML_Progress v1',
  221.                                        4 => '60,by',
  222.                                        5 => '70,Laurent Laville',
  223.                                        6 => '100,Have a nice day !'
  224.                                     )),
  225.  
  226.                 'phpcss'        => array('P'=>true)
  227.             ));
  228.         }
  229.     }
  230.  
  231.     /**
  232.      * Adds all necessary tabs to the given page object.
  233.      *
  234.      * @param      object    $page          Page where to put the button
  235.      * @param      mixed     $attributes    (optional) Either a typical HTML attribute string
  236.      *                                      or an associative array.
  237.      * @return     void
  238.      * @since      1.1
  239.      * @access     public
  240.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  241.      */
  242.     function createTabs(&$page, $attributes = null)
  243.     {
  244.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  245.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  246.                 array('var' => '$page',
  247.                       'was' => gettype($page),
  248.                       'expected' => 'HTML_QuickForm_Page object',
  249.                       'paramnum' => 1));
  250.  
  251.         } elseif (!is_array($attributes) && !is_string($attributes) && !is_null($attributes)) {
  252.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  253.                 array('var' => '$attributes',
  254.                       'was' => gettype($attributes),
  255.                       'expected' => 'array | string',
  256.                       'paramnum' => 2));
  257.         }
  258.  
  259.         $here = $attributes = HTML_Common::_parseAttributes($attributes);
  260.         $here['disabled'] = 'disabled';
  261.         $pageName = $page->getAttribute('name');
  262.         $jump = array();
  263.  
  264.         foreach ($this->_tabs as $tab) {
  265.             list($event, $cls, $label) = $tab;
  266.             $attrs = ($pageName == $event) ? $here : $attributes;
  267.             $jump[] =& $page->createElement('submit', $page->getButtonName($event), $label, HTML_Common::_getAttrString($attrs));
  268.         }
  269.         $page->addGroup($jump, 'tabs', '', ' ', false);
  270.     }
  271.  
  272.     /**
  273.      * Adds all necessary buttons to the given page object.
  274.      *
  275.      * @param      object    $page          Page where to put the button
  276.      * @param      array     $buttons       Key/label of each button/event to handle
  277.      * @param      mixed     $attributes    (optional) Either a typical HTML attribute string
  278.      *                                      or an associative array.
  279.      * @return     void
  280.      * @since      1.1
  281.      * @access     public
  282.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  283.      */
  284.     function createButtons(&$page, $buttons, $attributes = null)
  285.     {
  286.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  287.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  288.                 array('var' => '$page',
  289.                       'was' => gettype($page),
  290.                       'expected' => 'HTML_QuickForm_Page object',
  291.                       'paramnum' => 1));
  292.  
  293.         } elseif (!is_array($buttons)) {
  294.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  295.                 array('var' => '$buttons',
  296.                       'was' => gettype($buttons),
  297.                       'expected' => 'array',
  298.                       'paramnum' => 2));
  299.  
  300.         } elseif (!is_array($attributes) && !is_string($attributes) && !is_null($attributes)) {
  301.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  302.                 array('var' => '$attributes',
  303.                       'was' => gettype($attributes),
  304.                       'expected' => 'array | string',
  305.                       'paramnum' => 3));
  306.         }
  307.  
  308.         $confirm = $attributes = HTML_Common::_parseAttributes($attributes);
  309.         $confirm['onClick'] = "return(confirm('Are you sure ?'));";
  310.  
  311.         $prevnext = array();
  312.  
  313.         foreach ($buttons as $event => $label) {
  314.             if ($event == 'cancel') {
  315.                 $type = 'submit';
  316.                 $attrs = $confirm;
  317.             } elseif ($event == 'reset') {
  318.                 $type = 'reset';
  319.                 $attrs = $confirm;
  320.             } else {
  321.                 $type = 'submit';
  322.                 $attrs = $attributes;
  323.             }
  324.             $prevnext[] =& $page->createElement($type, $page->getButtonName($event), $label, HTML_Common::_getAttrString($attrs));
  325.         }
  326.         $page->addGroup($prevnext, 'buttons', '', ' ', false);
  327.     }
  328.  
  329.     /**
  330.      * Enables certain buttons for a page.
  331.      *
  332.      * Buttons [ = events] : back, next, cancel, reset, apply, help
  333.      *
  334.      * @param      object    $page          Page where you want to activate buttons
  335.      * @param      array     $events        (optional) List of buttons
  336.      *
  337.      * @since      1.1
  338.      * @access     public
  339.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  340.      * @see        disableButton()
  341.      */
  342.     function enableButton(&$page, $events = array())
  343.     {
  344.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  345.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  346.                 array('var' => '$page',
  347.                       'was' => gettype($page),
  348.                       'expected' => 'HTML_QuickForm_Page object',
  349.                       'paramnum' => 1));
  350.  
  351.         } elseif (!is_array($events)) {
  352.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  353.                 array('var' => '$events',
  354.                       'was' => gettype($events),
  355.                       'expected' => 'array',
  356.                       'paramnum' => 2));
  357.         }
  358.         static $all;
  359.         if (!isset($all)) {
  360.             $all = array('back','next','cancel','reset','apply','help');
  361.         }
  362.         $buttons = (count($events) == 0) ? $all : $events;
  363.  
  364.         foreach ($buttons as $event) {
  365.             $group    =& $page->getElement('buttons');
  366.             $elements =& $group->getElements();
  367.             foreach (array_keys($elements) as $key) {
  368.                 if ($group->getElementName($key) == $page->getButtonName($event)) {
  369.                     $elements[$key]->updateAttributes(array('disabled'=>'false'));
  370.                 }
  371.             }
  372.         }
  373.     }
  374.  
  375.     /**
  376.      * Disables certain buttons for a page.
  377.      *
  378.      * Buttons [ = events] : back, next, cancel, reset, apply, help
  379.      *
  380.      * @param      object    $page          Page where you want to activate buttons
  381.      * @param      array     $events        (optional) List of buttons
  382.      *
  383.      * @since      1.1
  384.      * @access     public
  385.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  386.      * @see        enableButton()
  387.      */
  388.     function disableButton(&$page, $events = array())
  389.     {
  390.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  391.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  392.                 array('var' => '$page',
  393.                       'was' => gettype($page),
  394.                       'expected' => 'HTML_QuickForm_Page object',
  395.                       'paramnum' => 1));
  396.  
  397.         } elseif (!is_array($events)) {
  398.             return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  399.                 array('var' => '$events',
  400.                       'was' => gettype($events),
  401.                       'expected' => 'array',
  402.                       'paramnum' => 2));
  403.         }
  404.         static $all;
  405.         if (!isset($all)) {
  406.             $all = array('back','next','cancel','reset','apply','help');
  407.         }
  408.         $buttons = (count($events) == 0) ? $all : $events;
  409.  
  410.         foreach ($buttons as $event) {
  411.             $group    =& $page->getElement('buttons');
  412.             $elements =& $group->getElements();
  413.             foreach (array_keys($elements) as $key) {
  414.                 if ($group->getElementName($key) == $page->getButtonName($event)) {
  415.                     $elements[$key]->updateAttributes(array('disabled'=>'true'));
  416.                 }
  417.             }
  418.         }
  419.     }
  420.  
  421.     /**
  422.      * Creates a progress bar with options choosen on all wizard tabs.
  423.      *
  424.      * @return     object    HTML_Progress instance
  425.      * @since      1.1
  426.      * @access     public
  427.      */
  428.     function createProgressBar()
  429.     {
  430.         $progress = $this->exportValues();
  431.  
  432.         $this->_progress->setIdent('PB1');
  433.         $this->_progress->setAnimSpeed(intval($progress['rAnimSpeed']));
  434.  
  435.         if ($progress['model'] != '') {
  436.             $this->_progress->setModel($progress['model'], 'iniCommented');
  437.             $this->_progress->setIncrement(10);
  438.             $ui =& $this->_progress->getUI();
  439.         } else {
  440.             $this->_progress->setBorderPainted(($progress['borderpainted'] == '1'));
  441.             $this->_progress->setStringPainted(($progress['stringpainted'] == '1'));
  442.             $ui =& $this->_progress->getUI();
  443.  
  444.             $structure = array();
  445.  
  446.             /* Page 1: Progress attributes **************************************************/
  447.             if (strlen(trim($progress['progressclass'])) > 0) {
  448.                 $structure['progress']['class'] = $progress['progressclass'];
  449.             }
  450.             if (strlen(trim($progress['progresssize']['bgcolor'])) > 0) {
  451.                 $structure['progress']['background-color'] = $progress['progresssize']['bgcolor'];
  452.             }
  453.             if (strlen(trim($progress['progresssize']['width'])) > 0) {
  454.                 $structure['progress']['width'] = $progress['progresssize']['width'];
  455.             }
  456.             if (strlen(trim($progress['progresssize']['height'])) > 0) {
  457.                 $structure['progress']['height'] = $progress['progresssize']['height'];
  458.             }
  459.             $structure['progress']['auto-size'] = ($progress['autosize'] == '1');
  460.  
  461.             $ui->setProgressAttributes($structure['progress']);
  462.             $orient = ($progress['shape'] == '1') ? HTML_PROGRESS_BAR_HORIZONTAL : HTML_PROGRESS_BAR_VERTICAL;
  463.             $ui->setOrientation($orient);
  464.             $ui->setFillWay($progress['way']);
  465.  
  466.             /* Page 2: Cell attributes ******************************************************/
  467.             if (strlen(trim($progress['cellid'])) > 0) {
  468.                 $structure['cell']['id'] = $progress['cellid'];
  469.             }
  470.             if (strlen(trim($progress['cellclass'])) > 0) {
  471.                 $structure['cell']['class'] = $progress['cellclass'];
  472.             }
  473.             if (strlen(trim($progress['cellvalue']['min'])) > 0) {
  474.                 $this->_progress->setMinimum(intval($progress['cellvalue']['min']));
  475.             }
  476.             if (strlen(trim($progress['cellvalue']['max'])) > 0) {
  477.                 $this->_progress->setMaximum(intval($progress['cellvalue']['max']));
  478.             }
  479.             if (strlen(trim($progress['cellvalue']['inc'])) > 0) {
  480.                 $this->_progress->setIncrement(intval($progress['cellvalue']['inc']));
  481.             }
  482.             if (strlen(trim($progress['cellsize']['width'])) > 0) {
  483.                 $structure['cell']['width'] = $progress['cellsize']['width'];
  484.             }
  485.             if (strlen(trim($progress['cellsize']['height'])) > 0) {
  486.                 $structure['cell']['height'] = $progress['cellsize']['height'];
  487.             }
  488.             if (strlen(trim($progress['cellsize']['spacing'])) > 0) {
  489.                 $structure['cell']['spacing'] = $progress['cellsize']['spacing'];
  490.             }
  491.             if (strlen(trim($progress['cellsize']['count'])) > 0) {
  492.                 $ui->setCellCount(intval($progress['cellsize']['count']));
  493.             }
  494.             if (strlen(trim($progress['cellcolor']['active'])) > 0) {
  495.                 $structure['cell']['active-color'] = $progress['cellcolor']['active'];
  496.             }
  497.             if (strlen(trim($progress['cellcolor']['inactive'])) > 0) {
  498.                 $structure['cell']['inactive-color'] = $progress['cellcolor']['inactive'];
  499.             }
  500.             if (strlen(trim($progress['cellfont']['family'])) > 0) {
  501.                 $structure['cell']['font-family'] = $progress['cellfont']['family'];
  502.             }
  503.             if (strlen(trim($progress['cellfont']['size'])) > 0) {
  504.                 $structure['cell']['font-size'] = $progress['cellfont']['size'];
  505.             }
  506.             if (strlen(trim($progress['cellfont']['color'])) > 0) {
  507.                 $structure['cell']['color'] = $progress['cellfont']['color'];
  508.             }
  509.             $ui->setCellAttributes($structure['cell']);
  510.  
  511.             /* Page 3: Border attributes ****************************************************/
  512.             if (strlen(trim($progress['borderclass'])) > 0) {
  513.                 $structure['border']['class'] = $progress['borderclass'];
  514.             }
  515.             if (strlen(trim($progress['borderstyle']['width'])) > 0) {
  516.                 $structure['border']['width'] = $progress['borderstyle']['width'];
  517.             }
  518.             if (strlen(trim($progress['borderstyle']['style'])) > 0) {
  519.                 $structure['border']['style'] = $progress['borderstyle']['style'];
  520.             }
  521.             if (strlen(trim($progress['borderstyle']['color'])) > 0) {
  522.                 $structure['border']['color'] = $progress['borderstyle']['color'];
  523.             }
  524.             $ui->setBorderAttributes($structure['border']);
  525.  
  526.             /* Page 4: String attributes ****************************************************/
  527.             if (strlen(trim($progress['stringid'])) > 0) {
  528.                 $structure['string']['id'] = $progress['stringid'];
  529.             }
  530.             if (strlen(trim($progress['stringsize']['width'])) > 0) {
  531.                 $structure['string']['width'] = $progress['stringsize']['width'];
  532.             }
  533.             if (strlen(trim($progress['stringsize']['height'])) > 0) {
  534.                 $structure['string']['height'] = $progress['stringsize']['height'];
  535.             }
  536.             if (strlen(trim($progress['stringsize']['bgcolor'])) > 0) {
  537.                 $structure['string']['background-color'] = $progress['stringsize']['bgcolor'];
  538.             }
  539.             if (strlen(trim($progress['stringalign'])) > 0) {
  540.                 $structure['string']['align'] = $progress['stringalign'];
  541.             }
  542.             if (strlen(trim($progress['stringvalign'])) > 0) {
  543.                 $structure['string']['valign'] = $progress['stringvalign'];
  544.             }
  545.             if (strlen(trim($progress['stringfont']['family'])) > 0) {
  546.                 $structure['string']['font-family'] = $progress['stringfont']['family'];
  547.             }
  548.             if (strlen(trim($progress['stringfont']['size'])) > 0) {
  549.                 $structure['string']['font-size'] = $progress['stringfont']['size'];
  550.             }
  551.             if (strlen(trim($progress['stringfont']['color'])) > 0) {
  552.                 $structure['string']['color'] = $progress['stringfont']['color'];
  553.             }
  554.             $ui->setStringAttributes($structure['string']);
  555.  
  556.         } // end-if-no-model
  557.  
  558.         return $this->_progress;
  559.     }
  560. }
  561. ?>