function renderInput($values = null, $options = array()) { if (!$this->_isCompatible) { return ''; } $tags = array(); if (!empty($values)) { foreach ($values as $v) { if (is_object($v)) { $tags[] = $v->tag_id; } else { $tags[] = (int) $v; } } } if (empty($options['name'])) { $options['name'] = 'tags'; } if (empty($options['mode'])) { $options['mode'] = 'ajax'; } if (!isset($options['class'])) { $options['class'] = 'inputbox span12 small'; } if (!isset($options['multiple'])) { $options['multiple'] = true; } $xmlConf = new SimpleXMLElement('<field name="' . $options['name'] . '" type="tag" mode="' . $options['mode'] . '" label="" class="' . $options['class'] . '" multiple="' . ($options['multiple'] ? 'true' : 'false') . '"></field>'); JFormHelper::loadFieldClass('tag'); $jform = new JForm('hikashop'); $fieldTag = new JFormFieldTag(); $fieldTag->setForm($jform); $fieldTag->setup($xmlConf, $tags); return $fieldTag->input; }
public function __construct($parent = null) { if (!defined('ROKGALLERYMODULE')) { define('ROKGALLERYMODULE', 'ROKGALLERYMODULE'); } // Set base dirs self::$ROKGALLERYMODULE_ROOT = JPATH_ROOT . '/modules/mod_rokgallery'; //load up the RTCommon require_once self::$ROKGALLERYMODULE_ROOT . '/lib/include.php'; parent::__construct($parent); }
/** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to the the value. * * @return mixed The property value or null. * * @since 2.0 */ public function __get($name) { switch ($name) { case 'static': if (empty($this->static)) { $this->static = $this->getStatic(); } return $this->static; break; case 'repeatable': if (empty($this->repeatable)) { $this->repeatable = $this->getRepeatable(); } return $this->repeatable; break; default: return parent::__get($name); } }
/** * Method to get the field input for a tag field. * * @return string The field input. * * @since 3.1 */ protected function getInput() { $componentParams = AgendaDirigentesHelper::getParams(); // se campo for do tipo multipla escolha e permitir participantes locais // ou se campo for do tipo multipla escolha e permitir participantes externos // entao incluir script if ($this->getAttribute('multiple', false) == "true" && ($componentParams->get('permitir_participantes_locais', 1) == 1 || $componentParams->get('permitir_participantes_externos', 1) == 1)) { $id = isset($this->element['id']) ? $this->element['id'] : null; $cssId = '#' . $this->getId($id, $this->element['name']); $this->ajaxfieldCustomTag($cssId, 5, $componentParams->get('permitir_participantes_externos', 1) == 1 ? 'true' : 'false'); } $input = parent::getInput(); return $input; }