Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_plugins
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * View to edit a plugin.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_plugins
  17.  * @since       1.5
  18.  */
  19. {
  20.     protected $item;
  21.  
  22.     protected $form;
  23.  
  24.     protected $state;
  25.  
  26.     /**
  27.      * Display the view
  28.      */
  29.     public function display($tpl null)
  30.     {
  31.         $this->state    = $this->get('State');
  32.         $this->item        = $this->get('Item');
  33.         $this->form        = $this->get('Form');
  34.  
  35.         // Check for errors.
  36.         if (count($errors $this->get('Errors')))
  37.         {
  38.             JError::raiseError(500implode("\n"$errors));
  39.             return false;
  40.         }
  41.  
  42.         $this->addToolbar();
  43.         parent::display($tpl);
  44.     }
  45.  
  46.     /**
  47.      * Add the page title and toolbar.
  48.      *
  49.      * @since   1.6
  50.      */
  51.     protected function addToolbar()
  52.     {
  53.         JFactory::getApplication()->input->set('hidemainmenu'true);
  54.  
  55.         $canDo PluginsHelper::getActions();
  56.  
  57.         JToolbarHelper::title(JText::sprintf('COM_PLUGINS_MANAGER_PLUGIN'JText::_($this->item->name))'power-cord plugin');
  58.  
  59.         // If not checked out, can save the item.
  60.         if ($canDo->get('core.edit'))
  61.         {
  62.             JToolbarHelper::apply('plugin.apply');
  63.             JToolbarHelper::save('plugin.save');
  64.         }
  65.         JToolbarHelper::cancel('plugin.cancel''JTOOLBAR_CLOSE');
  66.         JToolbarHelper::divider();
  67.         // Get the help information for the plugin item.
  68.  
  69.         $lang JFactory::getLanguage();
  70.  
  71.         $help $this->get('Help');
  72.         if ($lang->hasKey($help->url))
  73.         {
  74.             $debug $lang->setDebug(false);
  75.             $url JText::_($help->url);
  76.             $lang->setDebug($debug);
  77.         }
  78.         else
  79.         {
  80.             $url null;
  81.         }
  82.         JToolbarHelper::help($help->keyfalse$url);
  83.     }
  84. }

Documentation generated on Tue, 19 Nov 2013 15:17:50 +0100 by phpDocumentor 1.4.3