Source for file modules.php

Documentation is available at modules.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Platform
  4.  * @subpackage  Document
  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
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. /**
  13.  * JDocument Modules renderer
  14.  *
  15.  * @package     Joomla.Platform
  16.  * @subpackage  Document
  17.  * @since       11.1
  18.  */
  19. {
  20.     /**
  21.      * Renders multiple modules script and returns the results as a string
  22.      *
  23.      * @param   string  $position  The position of the modules to render
  24.      * @param   array   $params    Associative array of values
  25.      * @param   string  $content   Module content
  26.      *
  27.      * @return  string  The output of the script
  28.      *
  29.      * @since   11.1
  30.      */
  31.     public function render($position$params array()$content null)
  32.     {
  33.         $renderer $this->_doc->loadRenderer('module');
  34.         $buffer '';
  35.  
  36.         $app JFactory::getApplication();
  37.         $frontediting $app->get('frontediting'1);
  38.         $user JFactory::getUser();
  39.  
  40.         $canEdit $user->id && $frontediting && !($app->isAdmin(&& $frontediting 2&& $user->authorise('core.edit''com_modules');
  41.         $menusEditing ($frontediting == 2&& $user->authorise('core.edit''com_menus');
  42.  
  43.         foreach (JModuleHelper::getModules($positionas $mod)
  44.         {
  45.             $moduleHtml $renderer->render($mod$params$content);
  46.  
  47.             if ($app->isSite(&& $canEdit && trim($moduleHtml!= '' && $user->authorise('core.edit''com_modules.module.' $mod->id))
  48.             {
  49.                 $displayData array('moduleHtml' => &$moduleHtml'module' => $mod'position' => $position'menusediting' => $menusEditing);
  50.                 JLayoutHelper::render('joomla.edit.frontediting_modules'$displayData);
  51.             }
  52.  
  53.             $buffer .= $moduleHtml;
  54.         }
  55.  
  56.         return $buffer;
  57.     }
  58. }

Documentation generated on Tue, 19 Nov 2013 15:08:55 +0100 by phpDocumentor 1.4.3