예제 #1
0
 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  * @since   11.1
  */
 protected function getInput()
 {
     // Initialize variables.
     $html = array();
     $attr = '';
     $lofparams = LofParams::getInstance($this->form);
     $this->name = str_replace("][", "][theme_config][", $this->name);
     $name1 = explode("][", $this->name . '[');
     $name1 = $name1[count($name1) - 2];
     $this->value = $lofparams->get('theme_config', $name1, $this->element['default']);
     // Initialize some field attributes.
     $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     // To avoid user's confusion, readonly="true" should imply disabled="true".
     if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') {
         $attr .= ' disabled="disabled"';
     }
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $attr .= $this->multiple ? ' multiple="multiple"' : '';
     // Initialize JavaScript field attributes.
     $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     // Get the field options.
     $options = (array) $this->getOptions();
     // Create a read-only list (no name) with a hidden input to store the value.
     if ((string) $this->element['readonly'] == 'true') {
         $html[] = JHtml::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id);
         $html[] = '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '"/>';
     } else {
         $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
     }
     return implode($html);
 }
예제 #2
0
 protected function getInput()
 {
     $this->_type = 'text';
     if (isset($this->element['is_hidden'])) {
         $this->value = '';
         $this->_type = 'hidden';
     }
     $lofparams = LofParams::getInstance($this->form);
     $this->value = $this->__getValue('theme_config', 'style1-myname');
     $this->name = str_replace("][", "][theme_config][", $this->name);
     //		echo $this->name;die;
     if (!isset($this->element['is_hidden'])) {
         $name1 = explode("][", $this->name . '[');
         $name1 = $name1[count($name1) - 2];
         $this->value = $lofparams->get('theme_config', $name1, $this->element['default']);
         //	echo 	$this->value;die;
     }
     //  echo $this->name;die;
     // Initialize some field attributes.
     $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
     $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     $readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : '';
     $disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : '';
     // Initialize JavaScript field attributes.
     $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     return '<input type="' . $this->_type . '" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . '/>';
 }
예제 #3
0
 /**
  * Get value of parameter following to its name.
  * 
  * @return string is value of parameter.
  */
 public function getParamValue($name, $default = '')
 {
     return $this->_params->get($name, $default);
 }