Source for file joomla3.php

Documentation is available at joomla3.php

  1. <?php
  2. /**
  3.  * @package     FrameworkOnFramework
  4.  * @subpackage  render
  5.  * @copyright   Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
  6.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8. defined('_JEXEC'or die;
  9.  
  10. /**
  11.  * Joomla! 3 view renderer class
  12.  *
  13.  * @package  FrameworkOnFramework
  14.  * @since    2.0
  15.  */
  16. {
  17.     /**
  18.      * Public constructor. Determines the priority of this class and if it should be enabled
  19.      */
  20.     public function __construct()
  21.     {
  22.         $this->priority     = 55;
  23.         $this->enabled     = FOFPlatform::getInstance()->checkVersion(JVERSION'3.0''ge');
  24.     }
  25.  
  26.     /**
  27.      * Echoes any HTML to show before the view template
  28.      *
  29.      * @param   string    $view    The current view
  30.      * @param   string    $task    The current task
  31.      * @param   FOFInput  $input   The input array (request parameters)
  32.      * @param   array     $config  The view configuration array
  33.      *
  34.      * @return  void 
  35.      */
  36.     public function preRender($view$task$input$config array())
  37.     {
  38.         $format     $input->getCmd('format''html');
  39.  
  40.         if (empty($format))
  41.         {
  42.             $format     'html';
  43.         }
  44.  
  45.         if ($format != 'html')
  46.         {
  47.             return;
  48.         }
  49.  
  50.         // Render the submenu and toolbar
  51.         if ($input->getBool('render_toolbar'true))
  52.         {
  53.             $this->renderButtons($view$task$input$config);
  54.             $this->renderLinkbar($view$task$input$config);
  55.         }
  56.     }
  57.  
  58.     /**
  59.      * Echoes any HTML to show after the view template
  60.      *
  61.      * @param   string    $view    The current view
  62.      * @param   string    $task    The current task
  63.      * @param   FOFInput  $input   The input array (request parameters)
  64.      * @param   array     $config  The view configuration array
  65.      *
  66.      * @return  void 
  67.      */
  68.     public function postRender($view$task$input$config array())
  69.     {
  70.         /*
  71.         We don't need to do anything here, if we are running Joomla3,
  72.         so overwrite the default with all the closing div's
  73.  
  74.         I added it here because I am not 100% sure if it would break BC
  75.         when doing it in the default strapper
  76.         */
  77.     }
  78.  
  79.     /**
  80.      * Renders the submenu (link bar)
  81.      *
  82.      * @param   string    $view    The active view name
  83.      * @param   string    $task    The current task
  84.      * @param   FOFInput  $input   The input object
  85.      * @param   array     $config  Extra configuration variables for the toolbar
  86.      *
  87.      * @return  void 
  88.      */
  89.     protected function renderLinkbar($view$task$input$config array())
  90.     {
  91.         $style 'joomla';
  92.  
  93.         if (array_key_exists('linkbar_style'$config))
  94.         {
  95.             $style $config['linkbar_style'];
  96.         }
  97.  
  98.         switch ($style)
  99.         {
  100.             case 'joomla':
  101.                 $this->renderLinkbar_joomla($view$task$input);
  102.                 break;
  103.  
  104.             case 'classic':
  105.             default:
  106.                 $this->renderLinkbar_classic($view$task$input);
  107.                 break;
  108.         }
  109.     }
  110. }

Documentation generated on Tue, 19 Nov 2013 15:06:14 +0100 by phpDocumentor 1.4.3