本文整理汇总了PHP中WFParameter类的典型用法代码示例。如果您正苦于以下问题:PHP WFParameter类的具体用法?PHP WFParameter怎么用?PHP WFParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WFParameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: 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&task=repair&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
示例5: 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
示例6: 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
示例7: 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();
}
}
开发者ID:01J,项目名称:bealtine,代码行数:25,代码来源:view.html.php
示例8: 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&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
示例9: 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
示例10: display
function display($tpl = null)
{
$model = $this->getModel();
$language = $model->getLanguage();
$lang = JFactory::getLanguage();
$section = JRequest::getWord('section');
$category = JRequest::getWord('category');
$article = JRequest::getWord('article');
$component = JComponentHelper::getComponent('com_jce');
require_once WF_ADMINISTRATOR . DS . 'classes' . DS . 'parameter.php';
$params = new WFParameter($component->params);
$url = $params->get('preferences.help.url', 'http://www.joomlacontenteditor.net');
$method = $params->get('preferences.help.method', 'reference');
$pattern = $params->get('preferences.help.pattern', '');
switch ($method) {
default:
case 'reference':
$url .= '/index.php?option=com_content&view=article&tmpl=component&print=1&mode=inline&task=findkey&lang=' . $language . '&keyref=';
break;
case 'xml':
break;
case 'sef':
break;
}
$this->assignRef('model', $model);
$this->assign('orientation', $lang->isRTL() ? 'east' : 'west');
$key = array();
if ($section) {
$key[] = $section;
if ($category) {
$key[] = $category;
if ($article) {
$key[] = $article;
}
}
}
$options = array('url' => $url, 'key' => $key, 'pattern' => $pattern);
$this->document->addStyleSheet(JURI::root(true) . '/components/com_jce/editor/libraries/css/help.css');
$this->document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-ui-layout.js?version=' . $model->getVersion());
$this->document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Help.init(' . json_encode($options) . ');});');
parent::display($tpl);
}
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:42,代码来源:view.html.php
示例11: 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
示例12: getStyles
protected 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_SITE . '/component/com_jce/editor/libraries/css';
// Load styles
$styles = array();
if (!JFolder::exists($site_path . '/jquery/' . $theme)) {
$theme = 'jce';
}
// admin global css
$styles = array_merge($styles, array('administrator/components/com_jce/media/css/global.css'));
return $styles;
}
开发者ID:grlf,项目名称:eyedock,代码行数:19,代码来源:controller.php
示例13: download
/**
* Download update
* @return String JSON string
*/
public function download()
{
$app = JFactory::getApplication();
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
wfimport('admin.helpers.extension');
$component = WFExtensionHelper::getComponent();
$params = new WFParameter($component->params, '', 'preferences');
$config = JFactory::getConfig();
$result = array('error' => WFText::_('WF_UPDATES_DOWNLOAD_ERROR'));
$id = JRequest::getInt('id');
$key = $params->get('updates_key', '');
$data = $this->connect(self::$updateURL . '&task=download&id=' . $id . '&key=' . urlencode($key));
if ($data) {
$data = json_decode($data);
if (isset($data->error)) {
return json_encode(array('error' => $data->error));
}
// get update file
if ($data->name && $data->url && $data->hash) {
// create path for package file
$path = $app->getCfg('tmp_path') . '/' . basename($data->name);
// download file
if ($this->connect($data->url, null, $path)) {
if (JFile::exists($path) && @filesize($path) > 0) {
// check hash and file type
if ($data->hash == md5(md5_file($path)) && preg_match('/\\.(zip|tar|gz)$/', $path)) {
$result = array('file' => basename($path), 'hash' => $data->hash, 'installer' => $data->installer, 'type' => isset($data->type) ? $data->type : '');
} else {
// fail and delete file
$result = array('error' => WFText::_('WF_UPDATES_ERROR_FILE_VERIFICATION_FAIL'));
if (JFile::exists($path)) {
@JFile::delete($path);
}
}
} else {
$result = array('error' => WFText::_('WF_UPDATES_ERROR_FILE_MISSING_OR_INVALID'));
}
} else {
$result = array('error' => WFText::_('WF_UPDATES_DOWNLOAD_ERROR_DATA_TRANSFER'));
}
} else {
$result = array('error' => WFText::_('WF_UPDATES_DOWNLOAD_ERROR_MISSING_DATA'));
}
}
return json_encode($result);
}
开发者ID:glauberm,项目名称:cinevi,代码行数:51,代码来源:updates.php
示例14: foreach
foreach ($params->getGroups() as $group) {
$html .= $params->render('params[' . $plugin->name . '][' . $type . ']', $group);
}
}
foreach ($items as $extension) {
// get extension xml file
$file = $extension->manifest;
if ($extension->core == 0) {
// Load extension language file
$language = JFactory::getLanguage();
$language->load('com_jce_' . $extension->folder . '_' . trim($extension->extension), JPATH_SITE);
}
if (JFile::exists($file)) {
// get params for plugin
$key = $plugin->name . '.' . $type . '.' . $extension->extension;
$params = new WFParameter($this->profile->params, $file, $key);
// add element paths
$params->addElementPath(array(WF_EDITOR . '/elements'));
// render params
if (!$params->hasParent()) {
$key = array($plugin->name, $type, $extension->extension);
$enabled = (int) $params->get('enable', 1);
$checked = $enabled ? ' checked="checked"' : '';
$html .= '<h3><input type="hidden" id="params' . implode('', $key) . 'enable" name="params[' . implode('][', $key) . '][enable]" value="' . $enabled . '" /><input type="checkbox" data-name="' . $extension->extension . '" class="plugins-enable-checkbox"' . $checked . '/>' . WFText::_($extension->name) . '</h3>';
$html .= '<p>' . WFText::_($extension->description) . '</p>';
foreach ($params->getGroups() as $group) {
$html .= $params->render('params[' . implode('][', $key) . ']', $group, array('enable'));
}
}
}
}
开发者ID:01J,项目名称:bealtine,代码行数:31,代码来源:form_plugin.php
示例15: getLayoutParams
function getLayoutParams(&$row)
{
// get params definitions
$xml = WF_EDITOR_LIBRARIES . '/xml/config/layout.xml';
// get editor params
$params = new WFParameter($row->params, $xml, 'editor');
$params->addElementPath(JPATH_COMPONENT . '/elements');
$params->addElementPath(WF_EDITOR . '/elements');
$groups = $params->getGroups();
$row->layout_params = $params;
$row->layout_groups = $groups;
}
开发者ID:grlf,项目名称:eyedock,代码行数:12,代码来源:profiles.php
示例16: save
public function save()
{
// Check for request forgeries
JRequest::checkToken() or die('RESTRICTED');
$db = JFactory::getDBO();
$filter = JFilterInput::getInstance();
$row = JTable::getInstance('profiles', 'WFTable');
$task = $this->getTask();
$post = JRequest::get('post', array());
$id = JRequest::getInt('id');
$result = array('error' => false);
// load existing profile
$row->load($id);
// bind data but ignore params and usergroups
$row->bind($post, array('params', 'usergroups'));
// process values
foreach ($post as $key => $value) {
// don't process null values
if (is_null($value)) {
continue;
}
switch ($key) {
case 'name':
case 'description':
$value = $filter->clean($value);
break;
case 'components':
case 'device':
$value = array_filter($value);
$value = implode(',', $this->cleanInput($value));
break;
case 'usergroups':
$key = 'types';
$value = implode(',', $this->cleanInput(array_filter($value), 'int'));
break;
case 'users':
$value = implode(',', $this->cleanInput(array_filter($value), 'int'));
break;
case 'area':
if (empty($value) || count($value) == 2) {
$value = 0;
} else {
$value = $value[0];
}
break;
case 'plugins':
$value = preg_replace('#[^\\w,]+#', '', $value);
break;
case 'rows':
$value = preg_replace('#[^\\w,;]+#', '', $value);
break;
case 'params':
$json = array();
// get params
$params = isset($row->params) ? $row->params : '';
// convert params to json data array
$data = (array) json_decode($params, true);
// assign editor data
if (array_key_exists('editor', $value)) {
$json['editor'] = $value['editor'];
}
// get plugins
$plugins = explode(',', $row->plugins);
// assign plugin data
foreach ($plugins as $plugin) {
// add plugin params to array
if (array_key_exists($plugin, $value)) {
$json[$plugin] = $value[$plugin];
}
}
// combine and encode as json string
$value = json_encode(WFParameter::mergeParams($data, $json, false));
break;
}
$row->bind(array($key => $value));
}
if (!$row->check()) {
JError::raiseError(500, $db->getErrorMsg());
}
if (!$row->store()) {
JError::raiseError(500, $db->getErrorMsg());
}
$row->checkin();
switch ($task) {
case 'apply':
$msg = JText::sprintf('WF_PROFILES_SAVED_CHANGES', $row->name);
$this->setRedirect('index.php?option=com_jce&view=profiles&task=edit&cid[]=' . $row->id, $msg);
break;
case 'save':
default:
$msg = JText::sprintf('WF_PROFILES_SAVED', $row->name);
$this->setRedirect('index.php?option=com_jce&view=profiles', $msg);
break;
}
}
开发者ID:spikart,项目名称:spikart.com.ua,代码行数:95,代码来源:profiles.php
示例17: foreach
echo '</fieldset>';
}
// Get extensions supported by this plugin
$extensions = $this->model->getExtensions($plugin->name);
foreach ($extensions as $extension) {
// get extension xml file
$file = $extension->manifest;
if ($extension->core == 0) {
// Load extension language file
$language = JFactory::getLanguage();
$language->load('com_jce_' . $extension->folder . '_' . trim($extension->extension), JPATH_SITE);
}
if (JFile::exists($file)) {
// get params for plugin
$key = $plugin->name . '.' . $extension->type . '.' . $extension->extension;
$params = new WFParameter($this->profile->params, $file, $key);
// add element paths
$params->addElementPath(JPATH_COMPONENT . DS . 'elements');
$params->addElementPath(JPATH_COMPONENT_SITE . DS . 'elements');
$params->addElementPath(WF_EDITOR . DS . 'elements');
// render params
if (!$params->hasParent()) {
echo '<fieldset class="adminform panelform"><legend>' . WFText::_($extension->name) . '</legend>';
echo '<p>' . WFText::_($extension->description) . '</p>';
foreach ($params->getGroups() as $group => $num) {
echo $params->render('params[' . $plugin->name . '][' . $extension->type . '][' . $group . ']', $group);
}
echo '</fieldset>';
}
}
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:31,代码来源:form_plugin.php
示例18: pack
/**
* Overridden pack function for plugins
*/
public function pack()
{
if (JRequest::getCmd('task') == 'pack') {
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'parameter.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'packer.php';
$component =& JComponentHelper::getComponent('com_ckeditor');
$params = new WFParameter($component->params);
$cache = $params->get('editor.compress_cache', 0);
$compress = $params->get('editor.compress_minify', 0);
$gzip = $params->get('editor.compress_gzip', 0);
$type = JRequest::getWord('type', 'javascript');
// javascript
$packer = new WFPacker(array('type' => $type));
$files = array();
switch ($type) {
case 'javascript':
foreach ($this->getScripts() as $script => $type) {
$script .= preg_match('/\\.js$/', $script) ? '' : '.js';
$files[] = $this->urlToPath($script);
}
break;
case 'css':
foreach ($this->getStyleSheets() as $style => $type) {
$style .= preg_match('/\\.css$/', $style) ? '' : '.css';
$files[] = $this->urlToPath($style);
}
break;
}
$packer->setFiles($files);
$packer->pack($cache, $compress, $gzip);
}
}
开发者ID:neoandrew1000,项目名称:crao_journal,代码行数:35,代码来源:document.php
示例19: 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
示例20: toObject
/**
* Convert JSON data to JParameter Object
* @param $data JSON data
*/
public static function toObject($data)
{
$param = new WFParameter('');
$param->bind($data);
return $param->getData();
}
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:10,代码来源:parameter.php
注:本文中的WFParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论