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);
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }
 function display($tpl = null)
 {
     wfimport('admin.models.updates');
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $state = $this->get('State');
     $layout = JRequest::getWord('layout', 'install');
     // Set toolbar items for the page
     //JToolBarHelper::title(WFText::_('WF_INSTALLER_TITLE').' : '.WFText::_('WF_INSTALLER_'.$layout), 'install.png');
     // Are there messages to display ?
     $showMessage = false;
     $plugins = '';
     $extensions = '';
     $languages = '';
     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->document->addScript('components/com_jce/media/js/installer.js?version=' . $model->getVersion());
     $this->document->addScript('components/com_jce/media/js/uploads.js?version=' . $model->getVersion());
     $this->document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Installer.init({});$(":file").upload(' . json_encode($options) . ')});');
     $state->set('install.directory', $mainframe->getCfg('config.tmp_path'));
     $plugins = $model->getPlugins();
     $extensions = $model->getExtensions();
     $languages = $model->getLanguages();
     $related = $model->getRelated();
     //$discover	= $model->findPlugins();
     //$this->assignRef('discover',	$discover);
     $this->assignRef('plugins', $plugins);
     $this->assignRef('extensions', $extensions);
     $this->assignRef('languages', $languages);
     $this->assignRef('related', $related);
     $result = $state->get('result');
     $this->assign('showMessage', count($result));
     $this->assignRef('model', $model);
     $this->assignRef('state', $state);
     $ftp = JClientHelper::setCredentialsFromRequest('ftp');
     $this->assignRef('ftp', $ftp);
     $this->setLayout($layout);
     parent::display($tpl);
 }