本文整理汇总了PHP中JParameter::loadSetupFile方法的典型用法代码示例。如果您正苦于以下问题:PHP JParameter::loadSetupFile方法的具体用法?PHP JParameter::loadSetupFile怎么用?PHP JParameter::loadSetupFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JParameter
的用法示例。
在下文中一共展示了JParameter::loadSetupFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParams
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;
}
}
示例2: getParams
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();
}
}
示例3: __get
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);
}
示例4: __get
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);
}
示例5: __get
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);
}
示例6: __get
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);
}
示例7: __get
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);
}
示例8: JParameter
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;
}
示例9: getGeneralForm
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');
}