- md5
- 16a9c222894e4dca3f9bf7222185a56a
- sha1
- a482a96a3b998d884de79587d71cac54710ae9c4
- sha256
- 2415a139555a734daf9679e4bcaf143e7538a33fd3c9f38e1a9e5b5e5ccb13e3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
<?php
/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* View to edit a plugin.
*
* @package Joomla.Administrator
* @subpackage com_plugins
* @since 1.5
*/
class PluginsViewPlugin extends JView
{
protected $item;
protected $form;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* 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);
}
}
The same content is in 7 releases, Joomla 2.5.0 to 2.5.6. See them all, or every version of this file.