[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_wrapper/ -> wrapper.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: wrapper.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @subpackage    Wrapper
   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  /*
  19   * This is our main control structure for the component
  20   *
  21   * Each view is determined by the $task variable
  22   */
  23  switch (JRequest::getCmd('task'))
  24  {
  25      default:
  26          WrapperController::display();
  27          break;
  28  }
  29  
  30  /**
  31   * Static class to hold controller functions for the Wrapper component
  32   *
  33   * @static
  34   * @package        Joomla
  35   * @subpackage    Wrapper
  36   * @since        1.5
  37   */
  38  class WrapperController
  39  {
  40  	function display()
  41      {
  42          global $mainframe, $option;
  43  
  44          $document =& JFactory::getDocument();
  45  
  46          $menus    = &JSite::getMenu();
  47          $menu    = $menus->getActive();
  48  
  49          // Get the page/component configuration
  50          $params = &$mainframe->getParams();
  51  
  52          //set page title
  53          $document->setTitle($menu->name);
  54  
  55          $url = $params->def( 'url', '' );
  56  
  57          $row = new stdClass();
  58          if ( $params->def( 'add_scheme', 1 ) )
  59          {
  60              // adds 'http://' if none is set
  61              if ( substr( $url, 0, 1 ) == '/' )
  62              {
  63                  // relative url in component. use server http_host.
  64                  $row->url = 'http://'. $_SERVER['HTTP_HOST'] . $url;
  65              }
  66              elseif ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) {
  67                  $row->url = 'http://'. $url;
  68              }
  69              else {
  70                  $row->url = $url;
  71              }
  72          }
  73          else {
  74              $row->url = $url;
  75          }
  76  
  77          require_once  (JPATH_COMPONENT.DS.'views'.DS.'wrapper'.DS.'view.php');
  78          $view = new WrapperViewWrapper();
  79  
  80          $view->assignRef('params'  , $params);
  81          $view->assignRef('wrapper' , $row);
  82  
  83          $view->display();
  84      }
  85  }
  86  ?>


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