• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP WFExtensionHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: display

 function display($tpl = null)
 {
     wfimport('admin.models.updates');
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $version = $model->getVersion();
     $component = WFExtensionHelper::getComponent();
     // get params definitions
     $params = new WFParameter($component->params, '', 'preferences');
     $canUpdate = WFModelUpdates::canUpdate() && $model->authorize('installer');
     $options = array('feed' => (int) $params->get('feed', 0), 'updates' => (int) $params->get('updates', $canUpdate ? 1 : 0), 'labels' => array('feed' => WFText::_('WF_CPANEL_FEED_LOAD'), 'updates' => WFText::_('WF_UPDATES'), 'updates_available' => WFText::_('WF_UPDATES_AVAILABLE')));
     $this->document->addScript('components/com_jce/media/js/cpanel.js?version=' . $model->getVersion());
     $this->document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.CPanel.init(' . json_encode($options) . ')});');
     if ($model->authorize('preferences')) {
         WFToolbarHelper::preferences();
     }
     if ($model->authorize('installer')) {
         WFToolbarHelper::updates($canUpdate);
     }
     WFToolbarHelper::help('cpanel.about');
     $this->assignRef('icons', $icons);
     $this->assignRef('model', $model);
     $this->assignRef('installer', $installer);
     $this->assignRef('params', $params);
     $this->assignRef('version', $version);
     parent::display($tpl);
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:27,代码来源:view.html.php


示例2: getStyles

 function getStyles()
 {
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     wfimport('admin.helpers.extension');
     $view = JRequest::getCmd('view', 'cpanel');
     $component = WFExtensionHelper::getComponent();
     $params = new WFParameter($component->params);
     $theme = $params->get('preferences.theme', 'jce');
     $site_path = JPATH_COMPONENT_SITE . DS . 'editor' . DS . 'libraries' . DS . 'css';
     $admin_path = JPATH_COMPONENT_ADMINISTRATOR . DS . 'media' . DS . 'css';
     // Load styles
     $styles = array();
     if (!JFolder::exists($site_path . DS . 'jquery' . DS . $theme)) {
         $theme = 'jce';
     }
     if (JFolder::exists($site_path . DS . 'jquery' . DS . $theme)) {
         $files = JFolder::files($site_path . DS . 'jquery' . DS . $theme, '\\.css');
         foreach ($files as $file) {
             $styles[] = 'components/com_jce/editor/libraries/css/jquery/' . $theme . '/' . $file;
         }
     }
     // admin global css
     $styles = array_merge($styles, array('administrator/components/com_jce/media/css/global.css'));
     if (JFile::exists($admin_path . DS . $view . '.css')) {
         $styles[] = 'administrator/components/com_jce/media/css/' . $view . '.css';
     }
     return $styles;
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:29,代码来源:system.php


示例3: fetchElement

 public function fetchElement($name, $value, &$node, $control_name)
 {
     jimport('joomla.plugin.helper');
     wfimport('admin.helpers.extension');
     $language = JFactory::getLanguage();
     $plugins = JPluginHelper::getPlugin('search');
     // use tested defaults
     if (!$value) {
         $value = array('categories', 'contacts', 'content', 'newsfeeds', 'weblinks');
     } else {
         $value = (array) $value;
     }
     //$html  = '<span style="display:inline-block;"><input class="checkbox-list-toggle-all" type="checkbox"'. $checked .' /><label>'. WFText::_('WF_PROFILES_TOGGLE_ALL') . '</label>';
     $html = '<span style="display:inline-block;" data-parent="' . preg_replace(array('#^params#', '#([^\\w]+)#'), '', $control_name) . $node->attributes()->parent . '"><ul class="checkbox-list">';
     foreach ($plugins as $item) {
         $plugin = WFExtensionHelper::getPlugin(null, $item->name, 'search');
         $extension = 'plg_' . $plugin->folder . '_' . $plugin->element;
         $language->load($extension) || $language->load($extension, JPATH_ADMINISTRATOR);
         $language->load($extension . '.sys') || $language->load($extension . '.sys', JPATH_ADMINISTRATOR);
         $checked = in_array($plugin->element, $value) ? ' checked="checked"' : '';
         $html .= '<li><input type="checkbox" name="' . $control_name . '[' . $name . '][]" value="' . $plugin->element . '"' . $checked . ' /><label>' . JText::_($plugin->name) . '</label></li>';
     }
     $html .= '</ul></span>';
     return $html;
 }
开发者ID:01J,项目名称:bealtine,代码行数:25,代码来源:linksearch.php


示例4: display

 function display($tpl = null)
 {
     wfimport('admin.models.updates');
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $version = $model->getVersion();
     $component = WFExtensionHelper::getComponent();
     // get params definitions
     $params = new WFParameter($component->params, '', 'preferences');
     $canUpdate = WFModelUpdates::canUpdate() && WFModel::authorize('installer');
     $options = array('feed' => (int) $params->get('feed', 0), 'updates' => (int) $params->get('updates', $canUpdate ? 1 : 0), 'labels' => array('feed' => WFText::_('WF_CPANEL_FEED_LOAD'), 'updates' => WFText::_('WF_UPDATES'), 'updates_available' => WFText::_('WF_UPDATES_AVAILABLE')));
     JHtml::_('behavior.modal');
     $this->addScript('components/com_jce/media/js/cpanel.js');
     $this->addScriptDeclaration('jQuery.jce.Cpanel.options = ' . json_encode($options) . ';');
     // load styles
     $this->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/cpanel.css');
     if (WFModel::authorize('preferences')) {
         WFToolbarHelper::preferences();
     }
     if (WFModel::authorize('installer')) {
         WFToolbarHelper::updates($canUpdate);
     }
     WFToolbarHelper::help('cpanel.about');
     $views = array('config', 'profiles', 'installer', 'browser', 'mediabox');
     $icons = array();
     foreach ($views as $view) {
         // check if its allowed...
         if (WFModel::authorize($view) === false) {
             continue;
         }
         $attribs = array('target="_self"');
         $title = 'WF_' . strtoupper($view);
         $description = 'WF_' . strtoupper($view) . '_DESC';
         $link = 'index.php?option=com_jce&amp;view=' . $view;
         if ($view == 'browser') {
             $link = WFModel::getBrowserLink();
             $component = WFExtensionHelper::getComponent();
             // get params definitions
             $params = new WFParameter($component->params, '', 'preferences');
             $width = (int) $params->get('browser_width', 790);
             $height = (int) $params->get('browser_height', 560);
             if (empty($link)) {
                 continue;
             }
             $attribs = array('target="_blank"', 'class="browser"', 'onclick="Joomla.modal(this, \'' . $link . '\', ' . $width . ', ' . $height . ');return false;"');
             $title = 'WF_' . strtoupper($view) . '_TITLE';
             $description = 'WF_CPANEL_' . strtoupper($view);
         }
         // if its mediabox, check the plugin is installed and enabled
         if ($view == 'mediabox' && !JPluginHelper::isEnabled('system', 'jcemediabox')) {
             continue;
         }
         $icons[] = '<li class="cpanel-icon wf-tooltip" title="' . WFText::_($title) . '::' . WFText::_($description) . '"><a id="wf-browser-link" href="' . $link . '"' . implode(' ', $attribs) . '><span class="' . $view . '"></span>' . WFText::_($title) . '</a></li>';
     }
     $this->assign('icons', $icons);
     $this->assign('model', $model);
     $this->assign('params', $params);
     $this->assign('version', $version);
     parent::display($tpl);
 }
开发者ID:ziyou-liu,项目名称:1line,代码行数:60,代码来源:view.html.php


示例5: display

 function display($tpl = null)
 {
     wfimport('admin.models.updates');
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $installer = WFInstaller::getInstance();
     $version = $model->getVersion();
     // Check Groups DB
     if (!$installer->profiles) {
         $link = JHTML::link('index.php?option=com_jce&amp;task=repair&amp;table=profiles', WFText::_('WF_DB_CREATE_RESTORE'));
         $mainframe->enqueueMessage(WFText::_('WF_DB_PROFILES_ERROR') . ' - ' . $link, 'error');
     }
     $component = WFExtensionHelper::getComponent();
     // get params definitions
     $params = new WFParameter($component->params, '', 'preferences');
     $canUpdate = WFModelUpdates::canUpdate();
     $options = array('feed' => (int) $params->get('feed', 0), 'updates' => (int) $params->get('updates', $canUpdate ? 1 : 0), 'labels' => array('feed' => WFText::_('WF_CPANEL_FEED_LOAD'), 'updates' => WFText::_('WF_UPDATES'), 'updates_available' => WFText::_('WF_UPDATES_AVAILABLE')));
     $this->document->addScript('components/com_jce/media/js/cpanel.js?version=' . $model->getVersion());
     $this->document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.CPanel.init(' . json_encode($options) . ')});');
     WFToolbarHelper::preferences();
     WFToolbarHelper::updates($canUpdate);
     WFToolbarHelper::help('cpanel.about');
     $this->assignRef('icons', $icons);
     $this->assignRef('model', $model);
     $this->assignRef('installer', $installer);
     $this->assignRef('params', $params);
     $this->assignRef('version', $version);
     parent::display($tpl);
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:29,代码来源:view.html.php


示例6: save

 public function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('RESTRICTED');
     $row = WFExtensionHelper::getPlugin(null, 'jcemediabox', 'system');
     $task = $this->getTask();
     // remove id for Joomla! 2.5+
     if ($row->extension_id) {
         unset($row->id);
     }
     if (!$row->bind(JRequest::get('post'))) {
         JError::raiseError(500, $row->getError());
     }
     if (!$row->check()) {
         JError::raiseError(500, $row->getError());
     }
     if (!$row->store()) {
         JError::raiseError(500, $row->getError());
     }
     $row->checkin();
     $msg = JText::sprintf('WF_MEDIABOX_SAVED');
     switch ($task) {
         case 'apply':
             $this->setRedirect('index.php?option=com_jce&view=mediabox', $msg);
             break;
         case 'save':
         default:
             $this->setRedirect('index.php?option=com_jce&view=cpanel', $msg);
             break;
     }
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:31,代码来源:mediabox.php


示例7: check

 /**
  * Check for extension updates
  * @return String JSON string of updates
  */
 public function check()
 {
     $result = false;
     // Get all extensions and version numbers
     $data = array('task' => 'check', 'jversion' => WF_JOOMLA15 ? '1.5' : '2.5');
     wfimport('admin.helpers.extension');
     $component = WFExtensionHelper::getComponent();
     $params = new WFParameter($component->params, '', 'preferences');
     // get update key
     $key = $params->get('updates_key', '');
     $type = $params->get('updates_type', '');
     // encode it
     if (!empty($key)) {
         $data['key'] = urlencode($key);
     }
     if ($type) {
         $data['type'] = $type;
     }
     $req = array();
     // create request data
     foreach ($this->getVersions() as $type => $extension) {
         foreach ($extension as $item => $value) {
             $data[$type . '[' . urlencode($item) . ']'] = urlencode($value);
         }
     }
     foreach ($data as $key => $value) {
         $req[] = $key . '=' . urlencode($value);
     }
     // connect
     $result = $this->connect(self::$updateURL, implode('&', $req));
     return $result;
 }
开发者ID:proyectoseb,项目名称:University,代码行数:36,代码来源:updates.php


示例8: display

 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     $client = JRequest::getWord('client', 'admin');
     $model = $this->getModel();
     $this->document->setTitle(WFText::_('WF_PREFERENCES_TITLE'));
     $this->document->addStyleSheet('templates/system/css/system.css');
     $component = WFExtensionHelper::getComponent();
     $xml = JPATH_COMPONENT . '/models/preferences.xml';
     // get params definitions
     $params = new WFParameter($component->params, $xml, 'preferences');
     $params->addElementPath(JPATH_COMPONENT . '/elements');
     if (WFModel::authorize('admin')) {
         $form = $model->getForm('permissions');
     } else {
         $form = null;
     }
     $this->assign('params', $params);
     $this->assign('permissons', $form);
     $this->addStyleSheet('components/com_jce/media/css/preferences.css');
     $this->addScript('components/com_jce/media/js/preferences.js');
     if (JRequest::getInt('close') == 1) {
         $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.close();});');
     } else {
         $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.init();});');
     }
     parent::display($tpl);
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:28,代码来源:view.html.php


示例9: save

 function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('RESTRICTED');
     $db = JFactory::getDBO();
     $task = $this->getTask();
     $client = JRequest::getWord('client', 'site');
     // get params
     $component = WFExtensionHelper::getComponent();
     // create params object from json string
     $params = json_decode($component->params);
     $registry = new JRegistry();
     $registry->loadArray(JRequest::getVar('params', '', 'POST', 'ARRAY'));
     // set preference object
     $params->editor = $registry->toObject();
     // set params as JSON string
     $component->params = json_encode($params);
     if (!$component->check()) {
         JError::raiseError(500, $component->getError());
     }
     if (!$component->store()) {
         JError::raiseError(500, $component->getError());
     }
     $component->checkin();
     $msg = JText::sprintf('WF_CONFIG_SAVED');
     switch ($task) {
         case 'apply':
             $this->setRedirect('index.php?option=com_jce&view=config', $msg);
             break;
         case 'save':
         default:
             $this->setRedirect('index.php?option=com_jce&view=cpanel', $msg);
             break;
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:35,代码来源:config.php


示例10: save

 public function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('RESTRICTED');
     $db = JFactory::getDBO();
     $post = JRequest::getVar('params', '', 'POST', 'ARRAY');
     $registry = new JRegistry();
     $registry->loadArray($post);
     // get params
     $component = WFExtensionHelper::getComponent();
     // set preferences object
     $preferences = $registry->toObject();
     if (isset($preferences->rules)) {
         $preferences->access = $preferences->rules;
         unset($preferences->rules);
     }
     // set params as JSON string
     $component->params = json_encode($preferences);
     if (!$component->check()) {
         JError::raiseError(500, $row->getError());
     }
     if (!$component->store()) {
         JError::raiseError(500, $row->getError());
     }
     $component->checkin();
     $close = 0;
     if ($this->getTask() == 'save') {
         $close = 1;
     }
     $this->setRedirect('index.php?option=com_jce&view=preferences&tmpl=component&close=' . $close, WFText::_('WF_PREFERENCES_SAVED'));
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:31,代码来源:preferences.php


示例11: display

 function display($tpl = null)
 {
     $language = JFactory::getLanguage();
     $language->load('plg_editors_jce', JPATH_ADMINISTRATOR);
     $client = JRequest::getWord('client', 'site');
     $model = $this->getModel();
     $plugin = WFExtensionHelper::getPlugin();
     $xml = WF_EDITOR_LIBRARIES . '/xml/config/editor.xml';
     $data = null;
     // get params from editor plugin
     if ($plugin->params && $plugin->params !== "{}") {
         $data = json_decode($plugin->params);
     } else {
         $component = WFExtensionHelper::getComponent();
         // get params from component "params" field (legacy)
         if ($component->params) {
             $data = json_decode($component->params);
         }
     }
     // get params definitions
     $params = new WFParameter($data, $xml, 'editor');
     $params->addElementPath(JPATH_COMPONENT . '/elements');
     $this->assign('model', $model);
     $this->assign('params', $params);
     $this->assign('client', $client);
     WFToolbarHelper::apply();
     WFToolbarHelper::save();
     WFToolbarHelper::help('config.about');
     parent::display($tpl);
 }
开发者ID:spikart,项目名称:spikart.com.ua,代码行数:30,代码来源:view.html.php


示例12: showPreview

 /**
  * Display Preview content
  * @return void
  */
 public function showPreview()
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $dispatcher = JDispatcher::getInstance();
     $language = JFactory::getLanguage();
     // reset document type
     $document =& JFactory::getDocument();
     $document->setType('html');
     // required by module loadposition
     jimport('joomla.application.module.helper');
     wfimport('admin.helpers.extension');
     // Get variables
     $component_id = JRequest::getInt('component_id');
     // get post data
     $data = JRequest::getVar('data', '', 'POST', 'STRING', JREQUEST_ALLOWRAW);
     // cleanup data
     $data = preg_replace(array('#<!DOCTYPE([^>]+)>#i', '#<(head|title|meta)([^>]*)>([\\w\\W]+)<\\/1>#i', '#<\\/?(html|body)([^>]*)>#i'), '', rawurldecode($data));
     $component = WFExtensionHelper::getComponent($component_id);
     $params = new JParameter($component->params);
     $article = JTable::getInstance('content');
     $article->id = 0;
     $article->created_by = $user->get('id');
     $article->parameters = new JParameter('');
     $article->text = $data;
     $limitstart = 0;
     JPluginHelper::importPlugin('content');
     require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
     // set error reporting to error only
     error_reporting(E_ERROR);
     $dispatcher->trigger('onPrepareContent', array(&$article, &$params, $limitstart));
     $this->processURLS($article);
     return $article->text;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:38,代码来源:preview.php


示例13: getForm

 public function getForm($group = null)
 {
     jimport('joomla.form.form');
     if (class_exists('JForm')) {
         JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_jce');
         $form = JForm::getInstance('com_jce.component', 'config', array('control' => 'params'), false, '/config');
         if ($group) {
             return $form->getFieldset($group);
         }
         return $form;
     } else {
         $component = WFExtensionHelper::getComponent();
         // get params definitions
         $params = json_decode($component->params);
         $rules = isset($params->access) ? $params->access : null;
         // Build the form control.
         $curLevel = 0;
         $actions = $this->getActions();
         $groups = $this->getUserGroups();
         $tabs = array('<ul class="nav nav-tabs">');
         $content = array('<div class="tabs-content">');
         foreach ($groups as $group) {
             $difLevel = $group->level - $curLevel;
             $html = array();
             $item = new StdClass();
             $id = $curLevel;
             $tabs[] = '<li><a href="#permission-' . $id . '">' . str_repeat('<span> &rsaquo; </span> ', $curLevel = $group->level) . $group->text . '</a></li>';
             $content[] = '<div id="permission-' . $id . '" class="tab-pane">';
             $content[] = '<table border="0" cellspacing="1" class="table table-striped">';
             $content[] = '<thead>';
             $content[] = '<tr>';
             $content[] = '<th><span>' . WFText::_('WF_RULES_ACTION') . '</span></th>';
             $content[] = '<th><span>' . WFText::_('WF_RULES_SELECT_SETTING') . '</span></th>';
             $content[] = '</tr>';
             $content[] = '</thead>';
             $content[] = '<tbody>';
             foreach ($actions as $action) {
                 $content[] = '<tr>';
                 $content[] = '<td><label class="tooltip" for="' . $action->name . '_' . $group->value . '" title="' . htmlspecialchars(WFText::_($action->title) . '::' . WFText::_($action->description), ENT_COMPAT, 'UTF-8') . '">' . WFText::_($action->title) . '</label></td>';
                 $content[] = '<td>';
                 $content[] = '<select name="params[rules][' . $action->name . '][' . $group->value . ']" id="' . $action->name . '_' . $group->value . '" title="' . WFText::sprintf('WF_RULES_SELECT_ALLOW_DENY_GROUP', WFText::_($action->title), trim($group->text)) . '">';
                 $assetRule = $this->checkRule($rules, $action->name, $group->value);
                 $content[] = '<option value="1"' . ($assetRule === true ? ' selected="selected"' : '') . '>' . WFText::_('WF_RULES_ALLOWED') . '</option>';
                 $content[] = '<option value="0"' . ($assetRule === false ? ' selected="selected"' : '') . '>' . WFText::_('WF_RULES_DENIED') . '</option>';
                 $content[] = '</select>&#160; ';
                 $content[] = '</td>';
                 $content[] = '</tr>';
             }
             $content[] = '</tbody>';
             $content[] = '</table>';
             $content[] = '</div>';
         }
         $tabs[] = '</ul>';
         $content[] = '</div>';
         return implode('', array_merge($tabs, $content));
     }
     return null;
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:58,代码来源:preferences.php


示例14: save

 public function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('RESTRICTED');
     $db = JFactory::getDBO();
     $post = JRequest::getVar('params', '', 'POST', 'ARRAY');
     $registry = new JRegistry();
     $registry->loadArray($post);
     // get params
     $component = WFExtensionHelper::getComponent();
     // create params object from json string
     $params = json_decode($component->params);
     // set preferences object
     $preferences = $registry->toObject();
     if (isset($preferences->rules)) {
         jimport('joomla.access.rules');
         if (class_exists('JRules')) {
             $data = $this->filter($post);
             $rules = new JRules($data['rules']);
             $asset = JTable::getInstance('asset');
             $option = JRequest::getCmd('option');
             if (!$asset->loadByName($option)) {
                 $root = JTable::getInstance('asset');
                 $root->loadByName('root.1');
                 $asset->name = $option;
                 $asset->title = $option;
                 $asset->setLocation($root->id, 'last-child');
             }
             $asset->rules = (string) $rules;
             if (!$asset->check() || !$asset->store()) {
                 JError::raiseError(500, $asset->getError());
                 return false;
             }
             // Joomla! 1.5
         } else {
             $params->access = $preferences->rules;
         }
     }
     if (isset($preferences->preferences)) {
         $params->preferences = $preferences->preferences;
         // set params as JSON string
         $component->params = json_encode($params);
         if (!$component->check()) {
             JError::raiseError(500, $row->getError());
         }
         if (!$component->store()) {
             JError::raiseError(500, $row->getError());
         }
         $component->checkin();
     }
     $close = 0;
     if ($this->getTask() == 'save') {
         $close = 1;
     }
     $this->setRedirect('index.php?option=com_jce&view=preferences&tmpl=component&close=' . $close, WFText::_('WF_PREFERENCES_SAVED'));
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:56,代码来源:preferences.php


示例15: showPreview

 /**
  * Display Preview content
  * @return void
  */
 public function showPreview()
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $dispatcher = JDispatcher::getInstance();
     $language = JFactory::getLanguage();
     // reset document type
     $document =& JFactory::getDocument();
     $document->setType('html');
     // required by module loadposition
     jimport('joomla.application.module.helper');
     // load paramter class
     jimport('joomla.html.parameter');
     wfimport('admin.helpers.extension');
     // Get variables
     $component_id = JRequest::getInt('component_id');
     // get post data
     $data = JRequest::getVar('data', '', 'POST', 'STRING', JREQUEST_ALLOWRAW);
     // cleanup data
     $data = preg_replace(array('#<!DOCTYPE([^>]+)>#i', '#<(head|title|meta)([^>]*)>([\\w\\W]+)<\\/1>#i', '#<\\/?(html|body)([^>]*)>#i'), '', rawurldecode($data));
     $component = WFExtensionHelper::getComponent($component_id);
     // create params registry object
     $params = new JRegistry();
     // create empty params string
     if (!isset($component->params)) {
         $component->params = '';
     }
     // process attribs (com_content etc.)
     if ($component->attribs) {
         $params->loadString($component->attribs);
     } else {
         if (class_exists('JParameter')) {
             $params = new JParameter($component->params);
         } else {
             $params->loadString($component->params);
         }
     }
     $article = JTable::getInstance('content');
     $article->id = 0;
     $article->created_by = $user->get('id');
     $article->parameters = new JRegistry();
     $article->text = $data;
     // allow this to be skipped as some plugins can cause FATAL errors.
     if ((bool) $this->getParam('process_content', 1)) {
         $limitstart = 0;
         JPluginHelper::importPlugin('content');
         require_once JPATH_SITE . '/components/com_content/helpers/route.php';
         // set error reporting to error only
         error_reporting(E_ERROR);
         $dispatcher->trigger('onPrepareContent', array(&$article, &$params, $limitstart));
     }
     $this->processURLS($article);
     return $article->text;
 }
开发者ID:enjoy2000,项目名称:714water,代码行数:58,代码来源:preview.php


示例16: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $attributes = array();
     foreach ($node->attributes() as $k => $v) {
         if ($v != '') {
             $attributes[$k] = (string) $v;
         }
     }
     /*
      * Required to avoid a cycle of encoding &
      * html_entity_decode was used in place of htmlspecialchars_decode because
      * htmlspecialchars_decode is not compatible with PHP 4
      */
     $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES);
     $attributes['class'] = (string) $node->attributes()->class ? (string) $node->attributes()->class . ' text_area' : 'text_area';
     $control = $control_name . '[' . $name . ']';
     $html = '';
     $attributes['value'] = $value;
     $attributes['type'] = 'text';
     $attributes['name'] = $control;
     $attributes['id'] = preg_replace('#[^a-z0-9_-]#i', '', $control_name . $name);
     // pattern data attribute for editable select input box
     if ((string) $node->attributes()->parent) {
         $prefix = preg_replace(array('#^params#', '#([^\\w]+)#'), '', $control_name);
         $items = array();
         foreach (explode(';', (string) $node->attributes()->parent) as $item) {
             $items[] = $prefix . $item;
         }
         $attributes['data-parent'] = implode(';', $items);
     }
     $filter = isset($attributes['data-filter']) ? $attributes['data-filter'] : '';
     $html .= '<input';
     foreach ($attributes as $k => $v) {
         if (!in_array($k, array('default', 'label', 'description'))) {
             $html .= ' ' . $k . ' = "' . $v . '"';
         }
     }
     $html .= ' />';
     $component = WFExtensionHelper::getComponent();
     // get params definitions
     $params = new WFParameter($component->params, '', 'preferences');
     $width = (int) $params->get('browser_width', 780);
     $height = (int) $params->get('browser_height', 560);
     wfimport('admin.models.model');
     $model = new WFModel();
     $link = $model->getBrowserLink($attributes['id'], $filter);
     $html .= '<a href="' . $link . '" id="' . $attributes['id'] . '_browser' . '" class="browser" target="_blank" onclick="Joomla.modal(this, \'' . $link . '\', ' . $width . ', ' . $height . ');return false;" title="' . WFText::_('WF_BROWSER_TITLE') . '"><span class="browser"></span></a>';
     return $html;
 }
开发者ID:irovast,项目名称:eyedock,代码行数:49,代码来源:browser.php


示例17: fetchElement

 public function fetchElement($name, $value, &$node, $control_name)
 {
     jimport('joomla.plugin.helper');
     wfimport('admin.helpers.extension');
     $language = JFactory::getLanguage();
     $plugins = JPluginHelper::getPlugin('search');
     if (!$value) {
         $value = array();
     } else {
         $value = (array) $value;
     }
     //$html  = '<span style="display:inline-block;"><input class="checkbox-list-toggle-all" type="checkbox"'. $checked .' /><label>'. WFText::_('WF_PROFILES_TOGGLE_ALL') . '</label>';
     $html = '<span><ul class="checkbox-list">';
     foreach ($plugins as $item) {
         $plugin = WFExtensionHelper::getPlugin(null, $item->name, 'search');
         $extension = 'plg_' . $plugin->folder . '_' . $plugin->element;
         $language->load($extension) || $language->load($extension, JPATH_ADMINISTRATOR);
         $language->load($extension . '.sys') || $language->load($extension . '.sys', JPATH_ADMINISTRATOR);
         $checked = in_array($plugin->element, $value) || empty($value) ? ' checked="checked"' : '';
         $html .= '<li><input type="checkbox" name="' . $control_name . '[' . $name . '][]" value="' . $plugin->element . '"' . $checked . ' /><label>' . JText::_($plugin->name) . '</label></li>';
     }
     $html .= '</ul></span>';
     return $html;
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:24,代码来源:linksearch.php


示例18: save

 public function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('RESTRICTED');
     $db = JFactory::getDBO();
     $task = $this->getTask();
     // get params
     $component = WFExtensionHelper::getComponent();
     // create params array from json string
     $params = json_decode($component->params, true);
     // get params data
     $data = JRequest::getVar('params', '', 'POST', 'ARRAY');
     // clean input data
     $data = $this->cleanInput($data);
     // set editor params
     $params['editor'] = $data;
     // set params as JSON string
     $component->params = json_encode($params);
     if (!$component->check()) {
         JError::raiseError(500, $component->getError());
     }
     if (!$component->store()) {
         JError::raiseError(500, $component->getError());
     }
     $component->checkin();
     $msg = JText::sprintf('WF_CONFIG_SAVED');
     switch ($task) {
         case 'apply':
             $this->setRedirect('index.php?option=com_jce&view=config', $msg);
             break;
         case 'save':
         default:
             $this->setRedirect('index.php?option=com_jce&view=cpanel', $msg);
             break;
     }
 }
开发者ID:greyhat777,项目名称:vuslinterliga,代码行数:36,代码来源:config.php


示例19: save

 public function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('RESTRICTED');
     $db = JFactory::getDBO();
     $task = $this->getTask();
     // get plugin
     $plugin = WFExtensionHelper::getPlugin();
     // get params data
     $data = JRequest::getVar('params', '', 'POST', 'ARRAY');
     // clean input data
     $data = $this->cleanInput($data);
     // store data
     $plugin->params = json_encode($data);
     // remove "id"
     if (isset($plugin->extension_id)) {
         unset($plugin->id);
     }
     if (!$plugin->check()) {
         JError::raiseError(500, $plugin->getError());
     }
     if (!$plugin->store()) {
         JError::raiseError(500, $plugin->getError());
     }
     $plugin->checkin();
     $msg = JText::sprintf('WF_CONFIG_SAVED');
     switch ($task) {
         case 'apply':
             $this->setRedirect('index.php?option=com_jce&view=config', $msg);
             break;
         case 'save':
         default:
             $this->setRedirect('index.php?option=com_jce&view=cpanel', $msg);
             break;
     }
 }
开发者ID:spikart,项目名称:spikart.com.ua,代码行数:36,代码来源:config.php


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WFModelEditor类代码示例发布时间:2022-05-23
下一篇:
PHP WFEditorPlugin类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap