Example #1
0
 function Progress_Default2()
 {
     parent::HTML_Progress_UI();
     $this->setProgressAttributes(array('background-color' => '#e0e0e0'));
     $this->setStringAttributes(array('color' => '#996', 'background-color' => '#CCCC99'));
     $this->setCellAttributes(array('active-color' => '#996'));
 }
 function Progress_ITDynamic()
 {
     parent::HTML_Progress_UI();
     $this->setCellCount(20);
     $this->setProgressAttributes('background-color=#EEE');
     $this->setStringAttributes('background-color=#EEE color=navy');
     $this->setCellAttributes('inactive-color=#FFF active-color=#444444');
 }
Example #3
0
 /**
  * Sets the look-and-feel model that renders the progress bar.
  *
  * @param      string    $file          file name of model properties
  * @param      string    $type          type of external ressource (phpArray, iniFile, XML ...)
  *
  * @return     void
  * @since      1.0
  * @access     public
  * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  * @see        setUI()
  */
 function setModel($file, $type)
 {
     if (!file_exists($file)) {
         return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'error', array('var' => '$file', 'was' => $file, 'expected' => 'file exists', 'paramnum' => 1));
     }
     include_once 'Config.php';
     $conf = new Config();
     if (!$conf->isConfigTypeRegistered($type)) {
         return HTML_Progress::raiseError(HTML_PROGRESS_ERROR_INVALID_INPUT, 'error', array('var' => '$type', 'was' => $type, 'expected' => implode(" | ", array_keys($GLOBALS['CONFIG_TYPES'])), 'paramnum' => 2));
     }
     $data = $conf->parseConfig($file, $type);
     $structure = $data->toArray(false);
     $progress = $structure['root'];
     $ui = new HTML_Progress_UI();
     if (isset($progress['core']['speed'])) {
         $this->setAnimSpeed(intval($progress['core']['speed']));
     }
     if (isset($progress['core']['indeterminate'])) {
         $mode = strtolower(trim($progress['core']['indeterminate'])) == 'true';
         $this->setIndeterminate($mode);
     }
     if (isset($progress['core']['increment'])) {
         $this->setIncrement(intval($progress['core']['increment']));
     }
     if (isset($progress['core']['javascript']) && file_exists($progress['core']['javascript'])) {
         $ui->setScript($progress['core']['javascript']);
     }
     if (isset($progress['orientation']['shape'])) {
         $ui->setOrientation(intval($progress['orientation']['shape']));
     }
     if (isset($progress['orientation']['fillway'])) {
         $ui->setFillWay($progress['orientation']['fillway']);
     }
     if (isset($progress['cell']['count'])) {
         $ui->setCellCount(intval($progress['cell']['count']));
     }
     if (isset($progress['cell']['font-family'])) {
         if (is_array($progress['cell']['font-family'])) {
             $progress['cell']['font-family'] = implode(",", $progress['cell']['font-family']);
         }
     }
     if (isset($progress['cell'])) {
         $ui->setCellAttributes($progress['cell']);
     }
     if (isset($progress['border'])) {
         $this->setBorderPainted(true);
         $ui->setBorderAttributes($progress['border']);
     }
     if (isset($progress['string']['font-family'])) {
         if (is_array($progress['string']['font-family'])) {
             $progress['string']['font-family'] = implode(",", $progress['string']['font-family']);
         }
     }
     if (isset($progress['string'])) {
         $this->setStringPainted(true);
         $ui->setStringAttributes($progress['string']);
     }
     if (isset($progress['progress'])) {
         $ui->setProgressAttributes($progress['progress']);
     }
     $this->_UI = $ui;
 }