コード例 #1
0
 public function setConfigFieldsets($timer = 0)
 {
     // main lang prefix
     $lang = $this->langPrefix . '_CONFIG';
     if (1 == $timer) {
         // start loading Global params
         $autorName = ComponentbuilderHelper::htmlEscape($this->componentData->author);
         $autorEmail = ComponentbuilderHelper::htmlEscape($this->componentData->email);
         $this->paramsBuilder = '"autorName":"' . $autorName . '","autorEmail":"' . $autorEmail . '"';
         // set the custom fields
         if (isset($this->componentData->config) && ComponentbuilderHelper::checkArray($this->componentData->config)) {
             $component = ComponentbuilderHelper::safeString($this->componentData->name_code);
             $viewName = 'config';
             $listViewName = 'configs';
             $placeholders = array('###component###' => $component, '###view###' => $viewName, '###views###' => $listViewName);
             $spacerCounter = 'a';
             $view = '';
             $viewType = 0;
             // set the custom table key
             $dbkey = 'g';
             foreach ($this->componentData->config as $field) {
                 $xmlField = $this->setDynamicField($field, $view, $viewType, $lang, $viewName, $listViewName, $spacerCounter, $placeholders, $dbkey, false);
                 if (ComponentbuilderHelper::checkString($xmlField)) {
                     $this->configFieldSetsCustomField[$field['tabname']][] = $xmlField;
                     // set global params to db on install
                     $fieldName = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xmlField, 'name="', '"'));
                     $fieldDefault = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xmlField, 'default="', '"'));
                     if (isset($field['custom_value']) && ComponentbuilderHelper::checkString($field['custom_value'])) {
                         // load the Global checkin defautls
                         $this->paramsBuilder .= ',"' . $fieldName . '":"' . $field['custom_value'] . '"';
                     } elseif (ComponentbuilderHelper::checkString($fieldDefault)) {
                         // load the Global checkin defautls
                         $this->paramsBuilder .= ',"' . $fieldName . '":"' . $fieldDefault . '"';
                     }
                 }
             }
         }
         // first run we must set the globals
         $this->setGlobalConfigFieldsets($lang, $autorName, $autorEmail);
         $this->setSiteControlConfigFieldsets($lang);
     } elseif (2 == $timer) {
         // these field sets can only be added after admin view is build
         $this->setGroupControlConfigFieldsets($lang);
         // these can be added anytime really (but looks best after groups
         $this->setUikitConfigFieldsets($lang);
         $this->setGooglechartConfigFieldsets($lang);
         $this->setEncryptionConfigFieldsets($lang);
         // these are the coustom settings
         $this->setCustomControlConfigFieldsets($lang);
     }
     // we cad add more event (timers as we need)
 }
コード例 #2
0
 /**
  * Escapes a value for output in a view script.
  *
  * @param   mixed  $var  The output to escape.
  *
  * @return  mixed  The escaped value.
  */
 public function escape($var)
 {
     if (strlen($var) > 50) {
         // use the helper htmlEscape method instead and shorten the string
         return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
     }
     // use the helper htmlEscape method instead.
     return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
 }
コード例 #3
0
        ?>
</option>
						<?php 
        foreach ($this->headers as $value => $option) {
            ?>
							<?php 
            $selected = strtolower($option) == strtolower($title) || strtolower($option) == strtolower($name) ? 'selected="selected"' : '';
            ?>
							<option value="<?php 
            echo ComponentbuilderHelper::htmlEscape($value);
            ?>
" class="required" <?php 
            echo $selected;
            ?>
><?php 
            echo ComponentbuilderHelper::htmlEscape($option);
            ?>
</option>
						<?php 
        }
        ?>
					</select>
					</div>
				</div>
			<?php 
    }
    ?>
			<div class="form-actions">
				<input class="btn btn-primary" type="button" value="<?php 
    echo JText::_('COM_COMPONENTBUILDER_IMPORT_CONTINUE');
    ?>