本文整理汇总了PHP中JParameter::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP JParameter::getParams方法的具体用法?PHP JParameter::getParams怎么用?PHP JParameter::getParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JParameter
的用法示例。
在下文中一共展示了JParameter::getParams方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: _render
/**
* Render a parameter.
*
* @param JParameter $parameter
* @param KConfig $config
*
* @return string
*/
protected function _render($parameter, $config)
{
$params = $parameter->getParams($config->name, $config->group);
foreach ($params as $key => $param) {
$params[$key] = array($param[0] => $param[1]);
}
return $this->_template->renderHelper('ui.form', $params[0]);
}
示例4: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
$doc =& JFactory::getDocument();
$lang = JFactory::getLanguage();
$parameter_sets = array();
$filter = $node->attributes('filter');
$exclude = $node->attributes('exclude');
// Load 2x Catalog Themes
require_once(dirname(__FILE__) . "/../RokNavMenu.php");
RokNavMenu::setFrontSideTemplate();
RokNavMenu::loadCatalogs();
foreach(RokNavMenu::$themes as $theme_name => $theme_info){
$lang_file_path = JPath::clean($theme_info['path'].'/language/'.$lang->_lang.'.ini');
$this->loadLangFile($lang_file_path, $theme_info['fullname']);
$parms_file_path = JPath::clean($theme_info['path'].'/parameters.xml');
if (JFile::exists($parms_file_path)) {
$parameters = new JParameter( $this->_parent->_raw, JPath::clean($parms_file_path));
$parameter_sets[$theme_name] = $parameters->getParams();
}
}
// path to directory
$template_themes_path = '/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/themes';
$template_themes_full_path = JPath::clean(JPATH_ROOT.$template_themes_path);
$template_theme_text = JText::_("Template theme");
$module_themes_path = '/modules/mod_roknavmenu/themes';
$module_themes_full_path = JPath::clean(JPATH_ROOT.$module_themes_path);
$module_theme_text = JText::_("Default theme");
$module_js_path = JURI::root(true).'/modules/mod_roknavmenu/lib/js';
$doc->addScript($module_js_path."/switcher".$this->_getJSVersion().".js");
$doc->addScriptDeclaration("window.addEvent('domready', function() {new NavMenuSwitcher('paramtheme');});");
/** Get the Template Themes parameters **/
if (JFolder::exists($template_themes_full_path) && !JFile::exists($template_themes_full_path."/catalog.php")) {
$folders = JFolder::folders($template_themes_full_path, $filter);
if ( is_array($folders) )
{
reset($folders);
while (list($key, $val) = each($folders)) {
$folder =& $folders[$key];
if ($exclude)
{
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
{
continue;
}
}
$theme_path = $template_themes_path.DS.$folder;
$langfile = JPath::clean(JPATH_ROOT.$theme_path.DS.'language'.DS.$lang->_lang.'.ini');
if (JFile::exists($langfile)) {
$lang->_load($langfile,'roknavmenu_theme_template_'.$folder);
}
$param_file_path = $theme_path.DS.'parameters.xml';
if (JFile::exists(JPath::clean(JPATH_ROOT.$param_file_path))) {
$parameters = new JParameter( $this->_parent->_raw, JPath::clean(JPATH_ROOT.$param_file_path));
$parameter_sets[$theme_path] = $parameters->getParams();
}
}
}
}
/** Get the Default Themes parameters **/
if (JFolder::exists($module_themes_full_path) && !JFile::exists($module_themes_full_path."/catalog.php")) {
$folders = JFolder::folders($module_themes_full_path, $filter);
if ( is_array($folders) )
{
reset($folders);
while (list($key, $val) = each($folders)) {
$folder =& $folders[$key];
if ($exclude)
{
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
{
continue;
}
}
$theme_path = $module_themes_path.DS.$folder;
$langfile = JPath::clean(JPATH_ROOT.$theme_path.DS.'language'.DS.$lang->_lang.'.ini');
if (JFile::exists($langfile)) {
$lang->_load($langfile,'roknavmenu_theme_module_'.$folder);
}
//.........这里部分代码省略.........