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); }
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); }
public function onGetIcons($context) { @(include_once JPATH_ADMINISTRATOR . '/components/com_jce/models/model.php'); // check for class to prevent fatal errors if (!class_exists('WFModel')) { return; } if ($context != $this->params->get('context', 'mod_quickicon') || WFModel::authorize('browser') === false) { return; } $document = JFactory::getDocument(); $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $width = $this->params->get('width', 800); $height = $this->params->get('height', 600); $filter = $this->params->get('filter', ''); JHtml::_('behavior.modal'); $document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tSqueezeBox.assign(\$\$('#plg_quickicon_jcefilebrowser a'), {\n\t\t\t\thandler: 'iframe', size: {x: " . $width . ", y: " . $height . "}\n\t\t\t});\n\t\t});"); require_once JPATH_ADMINISTRATOR . '/components/com_jce/helpers/browser.php'; $version = new JVersion(); $icon = $version->isCompatible('3.0') ? 'pictures' : 'header/icon-48-media.png'; $link = WFBrowserHelper::getBrowserLink('', $filter); if ($link) { return array(array('link' => $link, 'image' => $icon, 'icon' => 'pictures', 'access' => array('jce.browser', 'com_jce'), 'text' => JText::_('WF_QUICKICON_BROWSER'), 'id' => 'plg_quickicon_jcefilebrowser')); } return array(); }
function display($tpl = null) { wfimport('admin.models.updates'); $app = JFactory::getApplication(); $model = $this->getModel(); $state = $model->getState(); $layout = JRequest::getWord('layout', 'install'); $plugins = ''; $extensions = ''; $languages = ''; JHtml::_('behavior.modal'); if (WFModel::authorize('uninstall')) { WFToolbarHelper::deleteList('', 'remove', 'WF_INSTALLER_UNINSTALL'); } WFToolbarHelper::updates(WFModelUpdates::canUpdate()); WFToolbarHelper::help('installer.about'); $options = array('extensions' => array('zip', 'tar', 'gz', 'gzip', 'tgz', 'tbz2', 'bz2', 'bzip2'), 'width' => 300, 'button' => 'install_button', 'task' => 'install', 'iframe' => false, 'labels' => array('browse' => WFText::_('WF_LABEL_BROWSE'), 'alert' => WFText::_('WF_INSTALLER_FILETYPE_ERROR'))); $this->addScript('components/com_jce/media/js/installer.js'); $this->addScript('components/com_jce/media/js/uploads.js'); $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Installer.init(' . json_encode($options) . ');});'); // load styles $this->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/installer.css'); $state->set('install.directory', $app->getCfg('tmp_path')); $plugins = $model->getPlugins(); $extensions = $model->getExtensions(); $languages = $model->getLanguages(); $related = $model->getRelated(); $this->assign('plugins', $plugins); $this->assign('extensions', $extensions); $this->assign('languages', $languages); $this->assign('related', $related); $result = $state->get('install.result'); $this->assign('showMessage', count($result)); $this->assign('model', $model); $this->assign('state', $state); $ftp = JClientHelper::setCredentialsFromRequest('ftp'); $this->assign('ftp', $ftp); $this->setLayout($layout); parent::display($tpl); }
</li> <li> <span class="wf-tooltip" title="<?php echo WFText::_('WF_CPANEL_VERSION') . '::' . WFText::_('WF_CPANEL_VERSION_DESC'); ?> "> <?php echo WFText::_('WF_CPANEL_VERSION'); ?> </span> <?php echo $this->version; ?> </li> <?php if ($this->params->get('feed', 0) || WFModel::authorize('preferences')) { ?> <li> <span class="wf-tooltip" title="<?php echo WFText::_('WF_CPANEL_FEED') . '::' . WFText::_('WF_CPANEL_FEED_DESC'); ?> "> <?php echo WFText::_('WF_CPANEL_FEED'); ?> </span> <span style="display:inline-block;"> <?php if ($this->params->get('feed', 0)) { ?> <ul class="newsfeed"><li><?php
public function authorize($task) { wfimport('admin.models.model'); if (WFModel::authorize($task) === false) { $this->setRedirect('index.php', WFText::_('ALERTNOTAUTH'), 'error'); return false; } return true; }
<?php // no direct access defined('_JEXEC') or die('Restricted access'); $app = JFactory::getApplication(); // only in Admin and only if the component is enabled if ($app->isSite() || JComponentHelper::getComponent('com_jce', true)->enabled === false) { return; } @(include_once JPATH_ADMINISTRATOR . '/components/com_jce/models/model.php'); // check for class to prevent fatal errors and authorize if (!class_exists('WFModel') || WFModel::authorize('browser') === false) { return; } JHtml::_('behavior.modal'); require_once JPATH_ADMINISTRATOR . '/components/com_jce/helpers/browser.php'; $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $document = JFactory::getDocument(); $document->addStyleSheet('components/com_jce/media/css/module.css'); $module = JModuleHelper::getModule('mod_jcefilebrowser'); $width = 800; $height = 600; $filter = ''; if ($module) { $params = new JParameter($module->params); $width = $params->get('width', 800); $height = $params->get('height', 600); $filter = $params->get('filter', ''); } $float = $language->isRTL() ? 'right' : 'left';
public function authorize($task) { wfimport('admin.models.model'); // map updates/blank/cpanel task to manage if (empty($task) || $task == 'cpanel' || $task == 'updates') { $task = 'manage'; } if (WFModel::authorize($task) === false) { $this->setRedirect('index.php', WFText::_('ALERTNOTAUTH'), 'error'); return false; } return true; }