/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $canDo = PluginsHelper::getActions(); JToolBarHelper::title(JText::sprintf('COM_PLUGINS_MANAGER_PLUGIN', JText::_($this->item->name)), 'plugin'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolBarHelper::apply('plugin.apply'); JToolBarHelper::save('plugin.save'); } JToolBarHelper::cancel('plugin.cancel', 'JTOOLBAR_CLOSE'); JToolBarHelper::divider(); // Get the help information for the plugin item. $lang = JFactory::getLanguage(); $help = $this->get('Help'); if ($lang->hasKey($help->url)) { $debug = $lang->setDebug(false); $url = JText::_($help->url); $lang->setDebug($debug); } else { $url = null; } JToolBarHelper::help($help->key, false, $url); }
/** * Setup the Toolbar */ protected function _setToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $canDo = PluginsHelper::getActions(); JToolBarHelper::title(JText::_('Plugn_Manager_Plugin'), 'plugin'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolBarHelper::apply('plugin.apply', 'JToolbar_Apply'); JToolBarHelper::save('plugin.save', 'JToolbar_Save'); } JToolBarHelper::cancel('plugin.cancel', 'JToolbar_Close'); JToolBarHelper::divider(); JToolBarHelper::help('screen.plugins.edit'); }
/** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JControllerLegacy This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { JLoader::register('PluginsHelper', JPATH_ADMINISTRATOR . '/components/com_plugins/helpers/plugins.php'); // Load the submenu. PluginsHelper::addSubmenu($this->input->get('view', 'plugins')); $view = $this->input->get('view', 'plugins'); $layout = $this->input->get('layout', 'default'); $id = $this->input->getInt('extension_id'); // Check for edit form. if ($view == 'plugin' && $layout == 'edit' && !$this->checkEditId('com_plugins.edit.plugin', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_plugins&view=plugins', false)); return false; } parent::display(); }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/plugins.php'; // Load the submenu. PluginsHelper::addSubmenu(JRequest::getCmd('view', 'plugins')); $view = JRequest::getCmd('view', 'plugins'); $layout = JRequest::getCmd('layout', 'default'); $id = JRequest::getInt('extension_id'); // Check for edit form. if ($view == 'plugin' && $layout == 'edit' && !$this->checkEditId('com_plugins.edit.plugin', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_plugins&view=plugins', false)); return false; } parent::display(); }
/** * Setup the Toolbar. */ protected function _setToolbar() { $state = $this->get('State'); $canDo = PluginsHelper::getActions(); JToolBarHelper::title(JText::_('Plugn_Manager_Plugins'), 'plugin'); if ($canDo->get('core.edit.state')) { JToolBarHelper::custom('plugins.publish', 'publish.png', 'publish_f2.png', 'JToolbar_Enable', true); JToolBarHelper::custom('plugins.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_Disable', true); } /** * Don't think we need an Edit button if names are clickable. */ //if ($canDo->get('core.edit')) { // JToolBarHelper::editList('plugin.edit'); // } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_plugins'); } JToolBarHelper::help('screen.plugins'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $canDo = PluginsHelper::getActions(); JToolbarHelper::title(JText::_('COM_PLUGINS_MANAGER_PLUGINS'), 'plugin'); if ($canDo->get('core.edit')) { JToolbarHelper::editList('plugin.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('plugins.publish', 'JTOOLBAR_ENABLE', true); JToolbarHelper::unpublish('plugins.unpublish', 'JTOOLBAR_DISABLE', true); JToolbarHelper::checkin('plugins.checkin'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_plugins'); } JToolbarHelper::help('JHELP_EXTENSIONS_PLUGIN_MANAGER'); JHtmlSidebar::setAction('index.php?option=com_plugins&view=plugins'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_enabled', JHtml::_('select.options', PluginsHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.enabled'), true)); JHtmlSidebar::addFilter(JText::_('COM_PLUGINS_OPTION_FOLDER'), 'filter_folder', JHtml::_('select.options', PluginsHelper::folderOptions(), 'value', 'text', $this->state->get('filter.folder'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); $this->sidebar = JHtmlSidebar::render(); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = PluginsHelper::getActions(); JToolBarHelper::title(JText::_('COM_PLUGINS_MANAGER_PLUGINS'), 'plugin'); if ($canDo->get('core.edit')) { JToolBarHelper::editList('plugin.edit'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::publish('plugins.publish', 'JTOOLBAR_ENABLE', true); JToolBarHelper::unpublish('plugins.unpublish', 'JTOOLBAR_DISABLE', true); JToolBarHelper::divider(); JToolBarHelper::checkin('plugins.checkin'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_plugins'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_EXTENSIONS_PLUGIN_MANAGER'); }
/** * Method to display a view. * @since 1.6 */ public function display() { require_once JPATH_COMPONENT . '/helpers/plugins.php'; // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getWord('view', 'plugins'); $vFormat = $document->getType(); $lName = JRequest::getWord('layout', 'default'); // Get and render the view. if ($view =& $this->getView($vName, $vFormat)) { // Get the model for the view. $model =& $this->getModel($vName); // Push the model into the view (as default). $view->setModel($model, true); $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); $view->display(); // Load the submenu. PluginsHelper::addSubmenu($vName); } }
<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?> </option> <?php echo JHtml::_('select.options', PluginsHelper::stateOptions(), 'value', 'text', $this->state->get('filter.state'), true); ?> </select> <select name="filter_folder" class="inputbox" onchange="this.form.submit()"> <option value=""><?php echo JText::_('COM_PLUGINS_OPTION_FOLDER'); ?> </option> <?php echo JHtml::_('select.options', PluginsHelper::folderOptions(), 'value', 'text', $this->state->get('filter.folder')); ?> </select> <select name="filter_access" class="inputbox" onchange="this.form.submit()"> <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?> </option> <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')); ?> </select> </div> </fieldset> <div class="clr"> </div>
/** * Method to get the field options. * * @return array The field option objects. * * @since 3.5 */ public function getOptions() { $options = PluginsHelper::folderOptions(); return array_merge(parent::getOptions(), $options); }