function getParams($data) { // get params definitions $params = new JParameter($data); if (WF_JOOMLA15) { $xml = JPATH_PLUGINS . DS . 'system' . DS . 'jcemediabox.xml'; $params->loadSetupFile($xml); return $params->getParams(); } else { $xml = JPATH_PLUGINS . DS . 'system' . DS . 'jcemediabox' . DS . 'jcemediabox.xml'; $parser = JFactory::getXMLParser('Simple'); if ($parser->loadFile($xml)) { if ($fieldsets = $parser->document->getElementByPath('config')->getElementByPath('fields')->children()) { foreach ($fieldsets as $fieldset) { $params->setXML($fieldset); } } } $groups = array(); $array = array(); foreach ($params->getGroups() as $group => $num) { $groups[] = $params->getParams('params', $group); } foreach ($groups as $group) { $array = array_merge($array, $group); } return $array; } }
function getParams($data) { jimport('joomla.form.form'); if (class_exists('JForm')) { //JForm::addFormPath(JPATH_PLUGINS . '/system/jcemediabox'); $xml = JPATH_PLUGINS . '/system/jcemediabox/jcemediabox.xml'; $params = new WFParameter($data, $xml, '', array('control' => 'config:fields:fieldset')); $params->addElementPath(JPATH_PLUGINS . '/system/jcemediabox/elements'); $groups = array(); $array = array(); foreach ($params->getGroups() as $group) { $groups[] = $params->getParams('params', $group); } foreach ($groups as $group) { $array = array_merge($array, $group); } return $array; } else { // get params definitions $params = new JParameter($data, JPATH_PLUGINS . '/system/jcemediabox.xml'); $xml = JPATH_PLUGINS . '/system/jcemediabox.xml'; $params->loadSetupFile($xml); return $params->getParams(); } }
public function __get($column) { if ($column == 'params' && !$this->_data['params'] instanceof JParameter) { $file = JPATH_BASE . '/components/com_contacts/databases/rows/contact.xml'; $params = new JParameter($this->_data['params']); $params->loadSetupFile($file); $this->_data['params'] = $params; } return parent::__get($column); }
public function __get($column) { if ($column == 'params' && !$this->_data['params'] instanceof \JParameter) { $file = __DIR__ . '/contact.xml'; $params = new \JParameter($this->_data['params']); $params->loadSetupFile($file); $this->_data['params'] = $params; } return parent::__get($column); }
public function __get($column) { if ($column == 'params' && !$this->_data['params'] instanceof JParameter) { $file = JPATH_BASE . '/components/com_articles/databases/rows/article.xml'; $params = new JParameter($this->_data['params']); $params->loadSetupFile($file); $this->_data['params'] = $params; } if ($column == 'text' && !isset($this->_data['text'])) { $this->_data['text'] = $this->fulltext ? $this->introtext . '<hr id="system-readmore" />' . $this->fulltext : $this->introtext; } return parent::__get($column); }
public function __get($column) { if ($column == 'params' && !$this->_data['params'] instanceof JParameter) { $xml_path = JPATH_ADMINISTRATOR . '/components/com_users/databases/rows'; $xml_name = str_replace(' ', '_', strtolower($this->group_name)); if (!file_exists($file = $xml_path . '/' . $xml_name . '.xml')) { $file = $xml_path . '/user.xml'; } $params = new JParameter($this->_data['params']); $params->loadSetupFile($file); $this->_data['params'] = $params; } return parent::__get($column); }
public function __get($column) { if ($column == 'params' && !$this->_data['params'] instanceof \JParameter) { $path = JPATH_APPLICATION . '/component/users/databases/rows'; $name = str_replace(' ', '_', strtolower((string) $this->getRole()->name)); $file = $path . '/' . $name . '.xml'; if (!file_exists($file)) { $file = $path . '/user.xml'; } $params = new \JParameter($this->_data['params']); $params->loadSetupFile($file); $this->_data['params'] = $params; } return parent::__get($column); }
function &getParams($rTable = false) { static $params, $table; // Parameters if (is_null($params)) { $table =& JTable::getInstance('component'); $table->loadByOption('com_linkr'); $params = new JParameter($table->params); $params->loadSetupFile(JPATH_COMPONENT . DS . 'config.xml'); } // Return table if ($rTable) { return $table; } // Return params return $params; }
function getGeneralForm($workflow) { $form = new JParameter(''); $form->addElementPath(JWF_BACKEND_PATH . DS . 'elements'); $form->loadSetupFile(JPATH_COMPONENT . DS . 'models' . DS . 'workflow.xml'); $jsOutput = ''; if ($workflow != null) { $form->bind($workflow); $jsOutput = JHTML::_('jwf.startJSBlock', 2); $jsOutput .= JHTML::_('jwf.indentedLine', 'adminGroupId =' . $workflow->admin_gid . ';', 2); $jsOutput .= JHTML::_('jwf.indentedLine', 'window.addEvent("load",function(){', 3); $jsOutput .= JHTML::_('jwf.indentedLine', 'var s;', 4); $jsOutput .= JHTML::_('jwf.indentedLine', 'var tempHook;', 4); foreach ($workflow->stations as $s) { $s->activeHooks = unserialize(base64_decode($s->activeHooks)); $jsOutput .= JHTML::_('jwf.indentedLine', "s = new Object();", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.id = {$s->id};", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.title = '{$s->title}';", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.task = '{$s->task}';", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.allocatedTime = {$s->allocatedTime};", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.acl = {id:{$s->group},name:aclLists['" . $workflow->acl . "'][{$s->group}]};", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.fields= '{$s->fields}';", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.activeValidations= '{$s->activeValidations}';", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "s.activeHooks = new Array();", 4); $jsOutput .= JHTML::_('jwf.indentedLine', "tempHook = new Object();", 4); foreach ($s->activeHooks as $hookName => $hookData) { $parameters = JArrayHelper::fromObject($hookData); foreach ($parameters as $key => $value) { $value = addslashes($value); $value = str_replace("\r\n", "\n", $value); $value = str_replace("\n", '\\n', $value); $jsOutput .= JHTML::_('jwf.indentedLine', "tempHook.{$key} = '{$value}';", 4); } $jsOutput .= JHTML::_('jwf.indentedLine', "s.activeHooks['{$hookName}'] = tempHook;", 4); } $jsOutput .= JHTML::_('jwf.indentedLine', "addElement(s);", 4); } $jsOutput .= JHTML::_('jwf.indentedLine', '});', 3); $jsOutput .= JHTML::_('jwf.endJSBlock', 2); } return $jsOutput . $form->render('params'); }