element['key_field'] ? (string) $this->element['key_field'] : 'value'; $value = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name']; $applyAccess = $this->element['apply_access'] ? (string) $this->element['apply_access'] : 'false'; $modelName = (string) $this->element['model']; $nonePlaceholder = (string) $this->element['none']; $translate = empty($this->element['translate']) ? 'true' : (string) $this->element['translate']; $translate = in_array(strtolower($translate), array('true','yes','1','on')) ? true : false; $with = $this->element['with'] ? (string) $this->element['with'] : null; if (!is_null($with)) { $with = trim($with); $with = explode(',', $with); $with = array_map('trim', $with); } if (!empty($nonePlaceholder)) { $options[] = JHtml::_('select.option', null, JText::_($nonePlaceholder)); } // Process field atrtibutes $applyAccess = strtolower($applyAccess); $applyAccess = in_array($applyAccess, array('yes', 'on', 'true', '1')); // Explode model name into component name and prefix $componentName = $this->form->getContainer()->componentName; $mName = $modelName; if (strpos($modelName, '.') !== false) { list ($componentName, $mName) = explode('.', $mName, 2); } // Get the applicable container $container = $this->form->getContainer(); if ($componentName != $container->componentName) { $container = Container::getInstance($componentName); } /** @var DataModel $model */ $model = $container->factory->model($mName)->setIgnoreRequest(true)->savestate(false); if ($applyAccess) { $model->applyAccessFiltering(); } if (!is_null($with)) { $model->with($with); } // Process state variables /** @var \SimpleXMLElement $stateoption */ foreach ($this->element->children() as $stateoption) { // Only add