/** * Result output from success process. * * @param string $message * @return array */ protected function _setOutput($message = '') { $return = ['message' => $message, 'result' => $this->_result]; if ($this->_attr instanceof PhpArray) { $return['data'] = $this->_attr; $return['name'] = $this->_attr->get('name'); } $this->_output = $return; return $this; }
/** * Setup Xml form elements. * * @param \SimpleXMLElement $element * @param $value * @param null $group * @param string $inputNameGroup * @param View $view * @return bool */ public function setup(\SimpleXMLElement $element, $value, $group = null, $inputNameGroup = '', View $view) { // Make sure there is a valid JFormField XML element. if ((string) $element->getName() != 'field') { return false; } // Set the XML element object. $this->_view = $view; $this->_element = $element; $this->_request = $view->request; $this->_data = $this->element(); // Reset the input and label values. $this->_input = null; $this->_label = (string) $this->_data->get('label', __d($this->_domain, 'Label')); $this->_inputNameGroup = $inputNameGroup == 'true' ? true : false; // Set the group of the field. $this->_group = $group; if (isset($element['default'])) { $this->_default = (string) $element['default']; } if (isset($element['unlocked'])) { $this->_unlocked = (int) $element['unlocked']; } $this->_name = (string) $element['name']; $this->_description = (string) $element['value']; $this->_default = isset($element['value']) ? (string) $element['value'] : $this->_default; // Set the field default value. $this->_value = $value; // Set the visibility. $this->_hidden = $this->_hidden || (string) $element['type'] == 'hidden'; // Add required to class list if field is required. if ($this->_required) { $this->_class = trim($this->_class . ' required'); } $this->id = uniqid('field-' . $group . '-'); return true; }
/** * Get theme description. * * @return mixed */ public function getDesc() { return $this->_xmlAttr->get('description'); }
/** * Get client id by attributes. * * @param PhpArray $attributes * @return int */ public function getClientIdByAttr(PhpArray $attributes) { $clientId = $attributes->get('client', self::CLIENT_FRONT_END); if ($clientId == 'frontend') { return self::CLIENT_FRONT_END_ID; } return self::CLIENT_BACK_END_ID; }