[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_media/ -> controller.php (source)

   1  <?php
   2  /**
   3   * @version        $Id: controller.php 14401 2010-01-26 14:10:00Z louis $
   4   * @package        Joomla
   5   * @subpackage    Media
   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 to the
   9   * GNU General Public License, and as distributed it includes or is derivative
  10   * of works licensed under the GNU General Public License or other free or open
  11   * source software licenses. See COPYRIGHT.php for copyright notices and
  12   * details.
  13   */
  14  
  15  // no direct access
  16  defined('_JEXEC') or die('Restricted access');
  17  
  18  jimport( 'joomla.application.component.controller' );
  19  
  20  /**
  21   * Media Manager Component Controller
  22   *
  23   * @package        Joomla
  24   * @subpackage    Media
  25   * @version 1.5
  26   */
  27  class MediaController extends JController
  28  {
  29      /**
  30       * Display the view
  31       */
  32  	function display()
  33      {
  34          global $mainframe;
  35  
  36          $vName = JRequest::getCmd('view', 'media');
  37          switch ($vName)
  38          {
  39              case 'images':
  40                  $vLayout = JRequest::getCmd( 'layout', 'default' );
  41                  $mName = 'manager';
  42  
  43                  break;
  44  
  45              case 'imagesList':
  46                  $mName = 'list';
  47                  $vLayout = JRequest::getCmd( 'layout', 'default' );
  48  
  49                  break;
  50  
  51              case 'mediaList':
  52                  $mName = 'list';
  53                  $vLayout = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
  54  
  55                  break;
  56  
  57              case 'media':
  58              default:
  59                  $vName = 'media';
  60                  $vLayout = JRequest::getCmd( 'layout', 'default' );
  61                  $mName = 'manager';
  62                  break;
  63          }
  64  
  65          $document = &JFactory::getDocument();
  66          $vType        = $document->getType();
  67  
  68          // Get/Create the view
  69          $view = &$this->getView( $vName, $vType);
  70  
  71          // Get/Create the model
  72          if ($model = &$this->getModel($mName)) {
  73              // Push the model into the view (as default)
  74              $view->setModel($model, true);
  75          }
  76  
  77          // Set the layout
  78          $view->setLayout($vLayout);
  79  
  80          // Display the view
  81          $view->display();
  82      }
  83  
  84  	function ftpValidate()
  85      {
  86          // Set FTP credentials, if given
  87          jimport('joomla.client.helper');
  88          JClientHelper::setCredentialsFromRequest('ftp');
  89      }
  90  }


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