当前位置: 首页>>代码示例>>PHP>>正文


PHP JForm::getParams方法代码示例

本文整理汇总了PHP中JForm::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP JForm::getParams方法的具体用法?PHP JForm::getParams怎么用?PHP JForm::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JForm的用法示例。


在下文中一共展示了JForm::getParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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 JForm($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 . '/' . $folder;
                 $langfile = JPath::clean(JPATH_ROOT . $theme_path . '/language/' . $lang->_lang . '.ini');
                 if (JFile::exists($langfile)) {
                     $lang->_load($langfile, 'roknavmenu_theme_template_' . $folder);
                 }
                 $param_file_path = $theme_path . '/parameters.xml';
                 if (JFile::exists(JPath::clean(JPATH_ROOT . $param_file_path))) {
                     $parameters = new JForm($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 . '/' . $folder;
                 $langfile = JPath::clean(JPATH_ROOT . $theme_path . '/language/' . $lang->_lang . '.ini');
                 if (JFile::exists($langfile)) {
                     $lang->_load($langfile, 'roknavmenu_theme_module_' . $folder);
                 }
                 $param_file_path = $theme_path . '/parameters.xml';
                 $parameter_sets[$theme_path] = array();
                 if (JFile::exists(JPath::clean(JPATH_ROOT . $param_file_path))) {
                     $parameters = new JForm($this->_parent->_raw, JPath::clean(JPATH_ROOT . $param_file_path));
                     $parameter_sets[$theme_path] = $parameters->getParams();
                 }
             }
         }
     }
     $parameter_renders = array();
     reset($parameter_sets);
     $html = '';
     // render a parameter set
     while (list($key, $val) = each($parameter_sets)) {
         $params =& $parameter_sets[$key];
         $cls = basename($key);
         if (empty($params)) {
             $html .= '<p class="' . $cls . '"><span>' . JText::_('ROKNAVMENU_MSG_NO_THEME_OPTIONS_AVAILABLE') . ' </span></p>';
         } else {
             //render an individual parameter
             for ($i = 0; $i < count($params); $i++) {
                 $param =& $params[$i];
                 $html .= '<p class="' . $cls . '"><span>' . $param[0] . ':</span>' . $param[1] . '</p>';
             }
         }
     }
//.........这里部分代码省略.........
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:101,代码来源:themeparameters.php


注:本文中的JForm::getParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。