- md5
- f00c5cf6a48289c5ec291a3823f369e6
- sha1
- 86f97e532136fe4fa1bc2d4f76f513e8ea05a49f
- sha256
- 4966476b099993779d37ee419439b66b428c283a3e9c22534271e483ee856672
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
<?php
/**
* @package Joomla.Administrator
* @subpackage com_plugins
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Plugins\Administrator\View\Plugin;
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
/**
* View to edit a plugin.
*
* @since 1.5
*/
class HtmlView extends BaseHtmlView
{
/**
* The item object for the newsfeed
*
* @var \JObject
*/
protected $item;
/**
* The form object for the newsfeed
*
* @var \JForm
*/
protected $form;
/**
* The model state of the newsfeed
*
* @var \JObject
*/
protected $state;
/**
* Display the view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
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')))
{
throw new \JViewGenericdataexception(implode("\n", $errors), 500);
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
\JFactory::getApplication()->input->set('hidemainmenu', true);
$canDo = ContentHelper::getActions('com_plugins');
\JToolbarHelper::title(\JText::sprintf('COM_PLUGINS_MANAGER_PLUGIN', \JText::_($this->item->name)), 'power-cord plugin');
// If not checked out, can save the item.
if ($canDo->get('core.edit'))
{
\JToolbarHelper::saveGroup(
[
['apply', 'plugin.apply'],
['save', 'plugin.save']
],
'btn-success'
);
}
\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);
}
}
No other release has this exact content. See every version of this file.