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 / Progress2 / Generator.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  24.0 KB  |  615 lines

  1. <?php
  2. /**
  3.  * Copyright (c) 2005-2008, Laurent Laville <pear@laurent-laville.org>
  4.  *
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  *     * Redistributions of source code must retain the above copyright
  12.  *       notice, this list of conditions and the following disclaimer.
  13.  *     * Redistributions in binary form must reproduce the above copyright
  14.  *       notice, this list of conditions and the following disclaimer in the
  15.  *       documentation and/or other materials provided with the distribution.
  16.  *     * Neither the name of the authors nor the names of its contributors
  17.  *       may be used to endorse or promote products derived from this software
  18.  *       without specific prior written permission.
  19.  *
  20.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21.  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23.  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  24.  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27.  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28.  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30.  * POSSIBILITY OF SUCH DAMAGE.
  31.  *
  32.  * PHP versions 4 and 5
  33.  *
  34.  * @category  HTML
  35.  * @package   HTML_Progress2
  36.  * @author    Laurent Laville <pear@laurent-laville.org>
  37.  * @copyright 2005-2008 Laurent Laville
  38.  * @license   http://www.opensource.org/licenses/bsd-license.php  New BSD License
  39.  * @version   CVS: $Id: Generator.php,v 1.11 2008/03/20 21:27:55 farell Exp $
  40.  * @link      http://pear.php.net/package/HTML_Progress2
  41.  * @since     File available since Release 2.0.0RC1
  42.  */
  43.  
  44. require_once 'HTML/QuickForm/Controller.php';
  45. require_once 'HTML/QuickForm/Action/Submit.php';
  46. require_once 'HTML/QuickForm/Action/Jump.php';
  47. require_once 'HTML/QuickForm/Action/Display.php';
  48. require_once 'HTML/QuickForm/Action/Direct.php';
  49. require_once 'HTML/Progress2.php';
  50. require_once 'HTML/Progress2/Generator/pages.php';
  51.  
  52. /**
  53.  * The HTML_Progress2_Generator class provides an easy way to build
  54.  * progress bar, show a preview, and save php/css code for a later reuse.
  55.  *
  56.  * @category  HTML
  57.  * @package   HTML_Progress2
  58.  * @author    Laurent Laville <pear@laurent-laville.org>
  59.  * @copyright 2005-2008 Laurent Laville
  60.  * @license   http://www.opensource.org/licenses/bsd-license.php  New BSD License
  61.  * @version   Release: 2.4.0
  62.  * @link      http://pear.php.net/package/HTML_Progress2
  63.  * @since     Class available since Release 2.0.0RC1
  64.  */
  65.  
  66. class HTML_Progress2_Generator extends HTML_QuickForm_Controller
  67. {
  68.     /**
  69.      * The progress object renders into this generator.
  70.      *
  71.      * @var        object
  72.      * @since      2.0.0
  73.      * @access     private
  74.      */
  75.     var $_progress;
  76.  
  77.     /**
  78.      * All default wizard pages definition
  79.      *
  80.      * @var        array
  81.      * @since      2.1.0
  82.      * @access     private
  83.      */
  84.     var $_tabs = array(
  85.         array('@' => array(
  86.                   'class' => 'Property1',
  87.                   'id' => 'page1',
  88.                   'name' => 'Progress')
  89.             ),
  90.         array('@' => array(
  91.                   'class' => 'Property2',
  92.                   'id' => 'page2',
  93.                   'name' => 'Cell')
  94.             ),
  95.         array('@' => array(
  96.                   'class' => 'Property3',
  97.                   'id' => 'page3',
  98.                   'name' => 'Border')
  99.             ),
  100.         array('@' => array(
  101.                   'class' => 'Property4',
  102.                   'id' => 'page4',
  103.                   'name' => 'String')
  104.             ),
  105.         array('@' => array(
  106.                   'class' => 'Preview',
  107.                   'id' => 'page5',
  108.                   'name' => 'Preview')
  109.             ),
  110.         array('@' => array(
  111.                   'class' => 'Save',
  112.                   'id' => 'page6',
  113.                   'name' => 'Save')
  114.             )
  115.         );
  116.  
  117.     /**
  118.      * All default wizard controller actions definition
  119.      *
  120.      * @var        array
  121.      * @since      2.1.0
  122.      * @access     private
  123.      */
  124.     var $_act = array(
  125.         'preview' => 'ActionPreview',
  126.         'display' => 'ActionDisplay',
  127.         'process' => 'ActionProcess',
  128.         'dump'    => false
  129.     );
  130.  
  131.     /**
  132.      * Constructor (ZE1)
  133.      *
  134.      * @param string $controllerName (optional) Name of generator wizard (QuickForm)
  135.      * @param array  $attributes     (optional) List of renderer options
  136.      * @param array  $errorPrefs     (optional) Hash of parameters
  137.      *                                          to configure error handler
  138.      *
  139.      * @since      version 2.0.0 (2005-10-01)
  140.      * @access     public
  141.      */
  142.     function HTML_Progress2_Generator($controllerName = 'ProgressGenerator',
  143.                                       $attributes = array(),
  144.                                       $errorPrefs = array())
  145.     {
  146.         $this->__construct($controllerName, $attributes, $errorPrefs);
  147.     }
  148.  
  149.     /**
  150.      * Constructor (ZE2) Summary
  151.      *
  152.      * o Creates a standard progress bar generator wizard.
  153.      *   <code>
  154.      *   $generator = new HTML_Progress2_Generator();
  155.      *   </code>
  156.      *
  157.      * o Creates a progress bar generator wizard with
  158.      *   customized actions: progress bar preview, form rendering, buttons manager
  159.      *   <code>
  160.      *   $controllerName = 'myPrivateGenerator';
  161.      *   $attributes = array(
  162.      *        'preview' => name of a HTML_QuickForm_Action instance
  163.      *                     (default 'ActionPreview',
  164.      *                      see 'HTML/Progress2/Generator/Preview.php')
  165.      *        'display' => name of a HTML_QuickForm_Action_Display instance
  166.      *                     (default 'ActionDisplay',
  167.      *                      see 'HTML/Progress2/Generator/Default.php')
  168.      *        'process' => name of a HTML_QuickForm_Action instance
  169.      *                     (default 'ActionProcess',
  170.      *                      see 'HTML/Progress2/Generator/Process.php')
  171.      *   );
  172.      *   $generator = new HTML_Progress2_Generator($controllerName, $attributes);
  173.      *   </code>
  174.      *
  175.      * @param string $controllerName (optional) Name of generator wizard (QuickForm)
  176.      * @param array  $attributes     (optional) List of renderer options
  177.      * @param array  $errorPrefs     (optional) Hash of parameters
  178.      *                                          to configure error handler
  179.      *
  180.      * @since      version 2.0.0 (2005-10-01)
  181.      * @access     protected
  182.      * @throws     HTML_PROGRESS2_ERROR_INVALID_INPUT
  183.      */
  184.     function __construct($controllerName = 'ProgressGenerator',
  185.                          $attributes = array(),
  186.                          $errorPrefs = array())
  187.     {
  188.         $this->_progress = new HTML_Progress2($errorPrefs,
  189.                                               HTML_PROGRESS2_BAR_HORIZONTAL,
  190.                                               0, 100);
  191.  
  192.         if (!is_string($controllerName)) {
  193.             return $this->_progress->raiseError(HTML_PROGRESS2_ERROR_INVALID_INPUT,
  194.                 'exception',
  195.                 array('var' => '$controllerName',
  196.                       'was' => gettype($controllerName),
  197.                       'expected' => 'string',
  198.                       'paramnum' => 1));
  199.  
  200.         } elseif (!is_array($attributes)) {
  201.             return $this->_progress->raiseError(HTML_PROGRESS2_ERROR_INVALID_INPUT,
  202.                 'exception',
  203.                 array('var' => '$attributes',
  204.                       'was' => gettype($attributes),
  205.                       'expected' => 'array',
  206.                       'paramnum' => 2));
  207.         }
  208.  
  209.         // build a new modal controller
  210.         parent::HTML_QuickForm_Controller($controllerName, true);
  211.  
  212.         // add all wizard default pages
  213.         $this->addPages();
  214.  
  215.         // add all wizard default actions
  216.         $this->addActions($attributes);
  217.  
  218.         // set ProgressBar default values on first run
  219.         $sess =& $this->container();
  220.  
  221.         if (count($sess['defaults']) == 0) {
  222.             $this->setDefaults(array(
  223.                 'shape'         => HTML_PROGRESS2_BAR_HORIZONTAL,
  224.                 'way'           => 'natural',
  225.                 'autosize'      => true,
  226.                 'progresssize'  => array('left' => 10, 'top' => 25,
  227.                                          'position' => 'relative',
  228.                                          'bgcolor' => '#FFFFFF'),
  229.                 'rAnimSpeed'    => 100,
  230.  
  231.                 'borderpainted' => false,
  232.                 'borderclass'   => 'progressBorder%s',
  233.                 'borderstyle'   => array('style' => 'solid', 'width' => 0,
  234.                                          'color' => '#000000'),
  235.  
  236.                 'cellid'        => 'pcel%01s',
  237.                 'cellclass'     => 'cell%s',
  238.                 'cellvalue'     => array('min' => 0, 'max' => 100, 'inc' => 1),
  239.                 'cellsize'      => array('width' => 15, 'height' => 20,
  240.                                          'spacing' => 2, 'count' => 10),
  241.                 'cellcolor'     => array('active' => '#006600',
  242.                                          'inactive' => '#CCCCCC',
  243.                                          'bgcolor' => '#FFFFFF'),
  244.                 'cellfont'      => array('family' => 'Courier, Verdana',
  245.                                          'size' => 8, 'color' => '#000000'),
  246.  
  247.                 'stringpainted' => false,
  248.                 'stringid'      => 'txt1',
  249.                 'stringclass'   => 'progressTextLabel%s',
  250.                 'stringvalue'   => 'something to display',
  251.                 'stringsize'    => array('left' => 5, 'top' => 5),
  252.                 'stringvalign'  => 'top',
  253.                 'stringalign'   => 'left',
  254.                 'stringfont'    => array('family' => 'Verdana, Tahoma, Arial',
  255.                                          'size' => 11, 'color' => '#000000'),
  256.                 'stringweight'  => 'normal',
  257.  
  258.                 'phpcss'        => array('P' => true)
  259.             ));
  260.         }
  261.     }
  262.  
  263.     /**
  264.      * Returns a unique instance of the given progress generator wizard.
  265.      *
  266.      * @param string $controllerName (optional) Name of generator wizard (QuickForm)
  267.      * @param array  $attributes     (optional) List of renderer options
  268.      * @param array  $errorPrefs     (optional) Hash of parameters
  269.      *                                          to configure error handler
  270.      *
  271.      * @return     object    HTML_Progress2_Generator
  272.      * @since      version 2.1.0 (2006-08-12)
  273.      * @access     public
  274.      */
  275.     function &singleton($controllerName = 'ProgressGenerator',
  276.                         $attributes = array(),
  277.                         $errorPrefs = array())
  278.     {
  279.         static $generator;
  280.  
  281.         if (!isset($generator)) {
  282.             $generator =& new HTML_Progress2_Generator($controllerName,
  283.                                                        $attributes,
  284.                                                        $errorPrefs);
  285.         }
  286.  
  287.         return $generator;
  288.     }
  289.  
  290.     /**
  291.      * Adds all pages of wizard at once
  292.      *
  293.      * @param mixed $pages Wizard pages definition array or null if used defaults
  294.      *
  295.      * @return void
  296.      * @access public
  297.      * @since  version 2.1.0 (2006-08-12)
  298.      */
  299.     function addPages($pages = null)
  300.     {
  301.         if (!isset($pages)) {
  302.             // default wizard pages
  303.             $pages = $this->_tabs;
  304.         }
  305.  
  306.         foreach ($pages as $page) {
  307.             $this->addPage($page);
  308.         }
  309.     }
  310.  
  311.     /**
  312.      * Add a specific page to wizard or each page one by one
  313.      *
  314.      * @param array $page a single Wizard page definition
  315.      *
  316.      * @return void
  317.      * @access public
  318.      * @since  version 2.1.0 (2006-08-12)
  319.      */
  320.     function addPage($page)
  321.     {
  322.         $className = $page['@']['class'];
  323.         $pageName  = $page['@']['name'];
  324.  
  325.         $qfcPage =& new $className($pageName);
  326.         parent::addPage($qfcPage);
  327.  
  328.         // adds additional action
  329.         foreach ($page as $action => $attr) {
  330.             if ($action == '#' || $action == '@') {
  331.                 continue;
  332.             }
  333.             $qfcPage->addAction($action, new $attr['@']['class']);
  334.         }
  335.  
  336.         // adds common action on each page
  337.         $this->addAction($pageName, new HTML_QuickForm_Action_Direct());
  338.     }
  339.  
  340.     /**
  341.      * Adds common actions for the frontend wizard
  342.      *
  343.      * @param mixed $actions (optional) Identify for each action a class handler
  344.      *
  345.      * @return void
  346.      * @access public
  347.      * @since  version 2.1.0 (2006-08-12)
  348.      */
  349.     function addActions($actions = null)
  350.     {
  351.         if (isset($actions) && is_array($actions)) {
  352.             $this->_act = array_merge($this->_act, $actions);
  353.         }
  354.  
  355.         // adds preview action
  356.         $ActionPreview = $this->_act['preview'];
  357.         if (!class_exists($ActionPreview)) {
  358.             include_once 'HTML/Progress2/Generator/Preview.php';
  359.             $ActionPreview = 'ActionPreview';
  360.         }
  361.         $this->addAction('apply', new $ActionPreview());
  362.  
  363.         // adds display driver
  364.         $ActionDisplay = $this->_act['display'];
  365.         if (!class_exists($ActionDisplay)) {
  366.             include_once 'HTML/Progress2/Generator/Default.php';
  367.             $ActionDisplay = 'ActionDisplay';
  368.         }
  369.         $this->addAction('display', new $ActionDisplay());
  370.  
  371.         // adds basic actions (abort, commit, reset)
  372.         $ActionProcess = $this->_act['process'];
  373.         if (!class_exists($ActionProcess)) {
  374.             include_once 'HTML/Progress2/Generator/Process.php';
  375.             $ActionProcess = 'ActionProcess';
  376.         }
  377.         $this->addAction('cancel', new $ActionProcess());
  378.         $this->addAction('process', new $ActionProcess());
  379.  
  380.         // adds dump class action (if necessary)
  381.         $ActionDump = $this->_act['dump'];
  382.         if ($ActionDump) {
  383.             if (!class_exists($ActionDump)) {
  384.                 include_once 'HTML/Progress2/Generator/Dump.php';
  385.                 $ActionDump = 'ActionDump';
  386.             }
  387.             $this->addAction('dump', new $ActionDump());
  388.         }
  389.     }
  390.  
  391.     /**
  392.      * Registers a handler for a specific action.
  393.      *
  394.      * @param string $actionName name of the action
  395.      * @param object &$action    the handler for the action
  396.      *
  397.      * @return     void
  398.      * @access     public
  399.      * @since      version 2.1.0 (2006-08-12)
  400.      */
  401.     function addAction($actionName, &$action)
  402.     {
  403.         $this->_act[$actionName] = get_class($action);
  404.         parent::addAction($actionName, $action);
  405.     }
  406.  
  407.     /**
  408.      * Returns whether or not a file is in the include path.
  409.      *
  410.      * @param string $file filename to test
  411.      *
  412.      * @access     public
  413.      * @return     boolean   true if the file is in the include path.
  414.      * @since      version 2.1.0 (2006-08-12)
  415.      * @static
  416.      */
  417.     function isIncludeable($file)
  418.     {
  419.         foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) {
  420.             if (file_exists($path . DIRECTORY_SEPARATOR . $file)
  421.                 && is_readable($path . DIRECTORY_SEPARATOR . $file)) {
  422.                 return true;
  423.             }
  424.         }
  425.         return false;
  426.     }
  427.  
  428.     /**
  429.      * Creates a progress bar with options choosen on all wizard tabs.
  430.      *
  431.      * @return     object
  432.      * @since      version 2.0.0 (2005-10-01)
  433.      * @access     public
  434.      */
  435.     function createProgressBar()
  436.     {
  437.         $structure = $this->createProgressStructure();
  438.  
  439.         $this->_progress->setIdent('PB1');
  440.         // indeterminate
  441.         $this->_progress->setBorderPainted($structure['borderpainted']);
  442.  
  443.         $this->_progress->setAnimSpeed($structure['animspeed']);
  444.         $this->_progress->setOrientation($structure['orientation']);
  445.         $this->_progress->setFillWay($structure['fillway']);
  446.         $this->_progress->setCellAttributes($structure['cell']);
  447.         $this->_progress->setCellCount($structure['cellcount']);
  448.         $this->_progress->setBorderAttributes($structure['border']);
  449.         // string
  450.         if ($structure['stringpainted']) {
  451.             $labelID = $structure['string']['name'];
  452.             unset($structure['string']['name']);
  453.             $this->_progress->addLabel(HTML_PROGRESS2_LABEL_TEXT, $labelID);
  454.             $this->_progress->setLabelAttributes($labelID, $structure['string']);
  455.         }
  456.         $this->_progress->setProgressAttributes($structure['progress']);
  457.         // script
  458.         $this->_progress->setMinimum($structure['minimum']);
  459.         $this->_progress->setMaximum($structure['maximum']);
  460.         $this->_progress->setIncrement($structure['increment']);
  461.  
  462.         return $this->_progress;
  463.     }
  464.  
  465.     /**
  466.      * Creates a progress bar structure
  467.      * with options choosen on all wizard tabs.
  468.      *
  469.      * @return     array
  470.      * @since      version 2.0.0 (2005-10-01)
  471.      * @access     public
  472.      * @see        HTML_Progress2::toArray()
  473.      */
  474.     function createProgressStructure()
  475.     {
  476.         $structure = array();
  477.         $progress  = $this->exportValues();
  478.  
  479.         $structure['animspeed']     = intval($progress['rAnimSpeed']);
  480.         $structure['borderpainted'] = ($progress['borderpainted'] == '1');
  481.         $structure['stringpainted'] = ($progress['stringpainted'] == '1');
  482.  
  483.         /* Page 1: Progress attributes ****************************************/
  484.         if (strlen(trim($progress['progresssize']['bgcolor'])) > 0) {
  485.             $structure['progress']['background-color']
  486.                 = $progress['progresssize']['bgcolor'];
  487.         }
  488.         if (strlen(trim($progress['progresssize']['width'])) > 0) {
  489.             $structure['progress']['width'] = $progress['progresssize']['width'];
  490.         }
  491.         if (strlen(trim($progress['progresssize']['height'])) > 0) {
  492.             $structure['progress']['height'] = $progress['progresssize']['height'];
  493.         }
  494.         if (strlen(trim($progress['progresssize']['left'])) > 0) {
  495.             $structure['progress']['left'] = $progress['progresssize']['left'];
  496.         }
  497.         if (strlen(trim($progress['progresssize']['top'])) > 0) {
  498.             $structure['progress']['top'] = $progress['progresssize']['top'];
  499.         }
  500.         $structure['progress']['auto-size'] = ($progress['autosize'] == '1');
  501.         $structure['orientation']
  502.             = ($progress['shape'] == '1') ?
  503.                   HTML_PROGRESS2_BAR_HORIZONTAL : HTML_PROGRESS2_BAR_VERTICAL;
  504.         $structure['fillway'] = $progress['way'];
  505.  
  506.         /* Page 2: Cell attributes ********************************************/
  507.         if (strlen(trim($progress['cellid'])) > 0) {
  508.             $structure['cell']['id'] = $progress['cellid'];
  509.         }
  510.         if (strlen(trim($progress['cellclass'])) > 0) {
  511.             $structure['cell']['class'] = $progress['cellclass'];
  512.         }
  513.         if (strlen(trim($progress['cellvalue']['min'])) > 0) {
  514.             $structure['minimum'] = intval($progress['cellvalue']['min']);
  515.         }
  516.         if (strlen(trim($progress['cellvalue']['max'])) > 0) {
  517.             $structure['maximum'] = intval($progress['cellvalue']['max']);
  518.         }
  519.         if (strlen(trim($progress['cellvalue']['inc'])) > 0) {
  520.             $structure['increment'] = intval($progress['cellvalue']['inc']);
  521.         }
  522.         if (strlen(trim($progress['cellsize']['width'])) > 0) {
  523.             $structure['cell']['width'] = $progress['cellsize']['width'];
  524.         }
  525.         if (strlen(trim($progress['cellsize']['height'])) > 0) {
  526.             $structure['cell']['height'] = $progress['cellsize']['height'];
  527.         }
  528.         if (strlen(trim($progress['cellsize']['spacing'])) > 0) {
  529.             $structure['cell']['spacing'] = $progress['cellsize']['spacing'];
  530.         }
  531.         if (strlen(trim($progress['cellsize']['count'])) > 0) {
  532.             $structure['cellcount'] = intval($progress['cellsize']['count']);
  533.         }
  534.         if (strlen(trim($progress['cellcolor']['active'])) > 0) {
  535.             $structure['cell']['active-color'] = $progress['cellcolor']['active'];
  536.         }
  537.         if (strlen(trim($progress['cellcolor']['inactive'])) > 0) {
  538.             $structure['cell']['inactive-color']
  539.                 = $progress['cellcolor']['inactive'];
  540.         }
  541.         if (strlen(trim($progress['cellcolor']['bgcolor'])) > 0) {
  542.             $structure['cell']['background-color']
  543.                 = $progress['cellcolor']['bgcolor'];
  544.         }
  545.         if (strlen(trim($progress['cellfont']['family'])) > 0) {
  546.             $structure['cell']['font-family'] = $progress['cellfont']['family'];
  547.         }
  548.         if (strlen(trim($progress['cellfont']['size'])) > 0) {
  549.             $structure['cell']['font-size'] = $progress['cellfont']['size'];
  550.         }
  551.         if (strlen(trim($progress['cellfont']['color'])) > 0) {
  552.             $structure['cell']['color'] = $progress['cellfont']['color'];
  553.         }
  554.  
  555.         /* Page 3: Border attributes ******************************************/
  556.         if (strlen(trim($progress['borderclass'])) > 0) {
  557.             $structure['border']['class'] = $progress['borderclass'];
  558.         }
  559.         if (strlen(trim($progress['borderstyle']['width'])) > 0) {
  560.             $structure['border']['width'] = $progress['borderstyle']['width'];
  561.         }
  562.         if (strlen(trim($progress['borderstyle']['style'])) > 0) {
  563.             $structure['border']['style'] = $progress['borderstyle']['style'];
  564.         }
  565.         if (strlen(trim($progress['borderstyle']['color'])) > 0) {
  566.             $structure['border']['color'] = $progress['borderstyle']['color'];
  567.         }
  568.  
  569.         /* Page 4: Label attributes *******************************************/
  570.         if (strlen(trim($progress['stringid'])) > 0) {
  571.             $structure['string']['name'] = $progress['stringid'];
  572.         }
  573.         if (strlen(trim($progress['stringclass'])) > 0) {
  574.             $structure['string']['class'] = $progress['stringclass'];
  575.         }
  576.         if (strlen(trim($progress['stringvalue'])) > 0) {
  577.             $structure['string']['value'] = $progress['stringvalue'];
  578.         }
  579.         if (strlen(trim($progress['stringsize']['width'])) > 0) {
  580.             $structure['string']['width'] = $progress['stringsize']['width'];
  581.         }
  582.         if (strlen(trim($progress['stringsize']['height'])) > 0) {
  583.             $structure['string']['height'] = $progress['stringsize']['height'];
  584.         }
  585.         if (strlen(trim($progress['stringsize']['left'])) > 0) {
  586.             $structure['string']['left'] = $progress['stringsize']['left'];
  587.         }
  588.         if (strlen(trim($progress['stringsize']['top'])) > 0) {
  589.             $structure['string']['top'] = $progress['stringsize']['top'];
  590.         }
  591.         if (strlen(trim($progress['stringsize']['bgcolor'])) > 0) {
  592.             $structure['string']['background-color']
  593.                 = $progress['stringsize']['bgcolor'];
  594.         }
  595.         if (strlen(trim($progress['stringalign'])) > 0) {
  596.             $structure['string']['align'] = $progress['stringalign'];
  597.         }
  598.         if (strlen(trim($progress['stringvalign'])) > 0) {
  599.             $structure['string']['valign'] = $progress['stringvalign'];
  600.         }
  601.         if (strlen(trim($progress['stringfont']['family'])) > 0) {
  602.             $structure['string']['font-family'] = $progress['stringfont']['family'];
  603.         }
  604.         if (strlen(trim($progress['stringfont']['size'])) > 0) {
  605.             $structure['string']['font-size'] = $progress['stringfont']['size'];
  606.         }
  607.         if (strlen(trim($progress['stringfont']['color'])) > 0) {
  608.             $structure['string']['color'] = $progress['stringfont']['color'];
  609.         }
  610.         $structure['string']['font-weight'] = $progress['stringweight'];
  611.  
  612.         return $structure;
  613.     }
  614. }
  615. ?>