[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_banners/ -> admin.banners.php (source)

   1  <?php
   2  /**
   3   * @version        $Id: admin.banners.php 14401 2010-01-26 14:10:00Z louis $
   4   * @package        Joomla
   5   * @subpackage    Banners
   6   * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7   * @license        GNU/GPL, see LICENSE.php
   8   * Joomla! is free software. This version may have been modified pursuant
   9   * to the GNU General Public License, and as distributed it includes or
  10   * is derivative of works licensed under the GNU General Public License or
  11   * other free or open source software licenses.
  12   * See COPYRIGHT.php for copyright notices and details.
  13   */
  14  
  15  // no direct access
  16  defined( '_JEXEC' ) or die( 'Restricted access' );
  17  
  18  // Make sure the user is authorized to view this page
  19  $user = & JFactory::getUser();
  20  if (!$user->authorize( 'com_banners', 'manage' )) {
  21      $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
  22  }
  23  
  24  // Set the table directory
  25  JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_banners'.DS.'tables');
  26  
  27  $controllerName = JRequest::getCmd( 'c', 'banner' );
  28  
  29  if($controllerName == 'client') {
  30      JSubMenuHelper::addEntry(JText::_('Banners'), 'index.php?option=com_banners');
  31      JSubMenuHelper::addEntry(JText::_('Clients'), 'index.php?option=com_banners&c=client', true );
  32      JSubMenuHelper::addEntry(JText::_('Categories'), 'index.php?option=com_categories&section=com_banner');
  33  } else {
  34      JSubMenuHelper::addEntry(JText::_('Banners'), 'index.php?option=com_banners', true );
  35      JSubMenuHelper::addEntry(JText::_('Clients'), 'index.php?option=com_banners&c=client');
  36      JSubMenuHelper::addEntry(JText::_('Categories'), 'index.php?option=com_categories&section=com_banner');
  37  }
  38  
  39  switch ($controllerName)
  40  {
  41      default:
  42          $controllerName = 'banner';
  43          // allow fall through
  44  
  45      case 'banner' :
  46      case 'client':
  47          // Temporary interceptor
  48          $task = JRequest::getCmd('task');
  49          if ($task == 'listclients') {
  50              $controllerName = 'client';
  51          }
  52  
  53          require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' );
  54          $controllerName = 'BannerController'.$controllerName;
  55  
  56          // Create the controller
  57          $controller = new $controllerName();
  58  
  59          // Perform the Request task
  60          $controller->execute( JRequest::getCmd('task') );
  61  
  62          // Redirect if set by the controller
  63          $controller->redirect();
  64          break;
  65  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1