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


PHP WFEditor::params方法代码示例

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


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

示例1: getParams

 /**
  * Get editor parameters
  * @access  public
  * @param 	array $options
  * @return 	object
  */
 public function getParams($options = array())
 {
     if (!isset(self::$params)) {
         self::$params = array();
     }
     // set blank key if not set
     if (!isset($options['key'])) {
         $options['key'] = '';
     }
     // set blank path if not set
     if (!isset($options['path'])) {
         $options['path'] = '';
     }
     $plugin = JRequest::getCmd('plugin');
     if ($plugin) {
         $options['plugin'] = $plugin;
     }
     $signature = serialize($options);
     if (empty(self::$params[$signature])) {
         wfimport('admin.helpers.extension');
         // get plugin
         $editor_plugin = WFExtensionHelper::getPlugin();
         // get params data for this profile
         $profile = $this->getProfile($plugin);
         $profile_params = array();
         $editor_params = array();
         // get params from editor plugin
         if ($editor_plugin->params && $editor_plugin->params !== "{}") {
             $editor_params['editor'] = json_decode($editor_plugin->params, true);
         } else {
             // get component
             $component = WFExtensionHelper::getComponent();
             // get params from component "params" field (legacy)
             if ($component->params && $component->params !== "{}") {
                 $data = json_decode($component->params, true);
                 if (isset($data['editor'])) {
                     $editor_params['editor'] = $data['editor'];
                 }
             }
         }
         if ($profile) {
             $profile_params = json_decode($profile->params, true);
         }
         // make sure we have an empty array if null or false
         if (empty($editor_params)) {
             $editor_params = array();
         }
         // make sure we have an empty array if null or false
         if (empty($profile_params)) {
             $profile_params = array();
         }
         // merge data and convert to json string
         $data = WFParameter::mergeParams($editor_params, $profile_params, true, false);
         self::$params[$signature] = new WFParameter($data, $options['path'], $options['key']);
     }
     return self::$params[$signature];
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:63,代码来源:editor.php

示例2: getParams

 /**
  * Get editor parameters
  * @access  public
  * @param 	array $options
  * @return 	object
  */
 public function getParams($options = array())
 {
     if (!isset(self::$params)) {
         self::$params = array();
     }
     // set blank key if not set
     if (!isset($options['key'])) {
         $options['key'] = '';
     }
     // set blank path if not set
     if (!isset($options['path'])) {
         $options['path'] = '';
     }
     $plugin = JRequest::getCmd('plugin');
     if ($plugin) {
         $options['plugin'] = $plugin;
     }
     $signature = serialize($options);
     if (empty(self::$params[$signature])) {
         wfimport('admin.helpers.extension');
         // get component
         $component = WFExtensionHelper::getComponent();
         // get params data for this profile
         $profile = $this->getProfile($plugin);
         $profile_params = array();
         $component_params = array();
         if (!empty($component->params)) {
             $component_params = json_decode($component->params, true);
             // set null as array
             if (!$component_params) {
                 $component_params = array();
             }
         }
         if ($profile) {
             $profile_params = json_decode($profile->params, true);
             // set null as array
             if (!$profile_params) {
                 $profile_params = array();
             }
         }
         // merge data and convert to json string
         $data = WFParameter::mergeParams($component_params, $profile_params);
         self::$params[$signature] = new WFParameter($data, $options['path'], $options['key']);
     }
     return self::$params[$signature];
 }
开发者ID:christopherstock,项目名称:Joomla3_Tini,代码行数:52,代码来源:editor.php


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