本文整理汇总了PHP中WFParameter::get方法的典型用法代码示例。如果您正苦于以下问题:PHP WFParameter::get方法的具体用法?PHP WFParameter::get怎么用?PHP WFParameter::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WFParameter
的用法示例。
在下文中一共展示了WFParameter::get方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: 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;
}
示例3: 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);
}
示例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&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);
}
示例5: 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;
}
示例6: 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;
}
示例7: 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);
}
示例8: trim
$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'));
}
}
}
}
if ($html) {
echo '<fieldset class="adminform panelform"><legend>' . WFText::_('WF_EXTENSIONS_' . strtoupper($type) . '_TITLE') . '</legend>';
echo $html;
echo '</fieldset>';
}
}
示例9: store
/**
* Overridden JTable::store to encrypt parameters
*
* @param boolean $updateNulls True to update fields even if they are null.
*
* @return boolean True on success.
*
* @since 2.4
*/
public function store($updateNulls = false)
{
if ($this->id && $this->params) {
$component = WFExtensionHelper::getComponent();
// get params definitions
$params = new WFParameter($component->params, '', 'preferences');
if ($params->get('secureparams', 0)) {
$this->params = WFEncryptHelper::encrypt($this->params);
}
}
return parent::store($updateNulls);
}
示例10: 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);
}
}
示例11: 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);
}
示例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;
}