[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

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

   1  <?php
   2  /**
   3   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   4   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   5   */
   6  
   7  // no direct access
   8  defined('_JEXEC') or die;
   9  
  10  jimport('joomla.application.component.controller');
  11  
  12  /**
  13   * Media Manager Component Controller
  14   *
  15   * @package        Joomla.Administrator
  16   * @subpackage    com_media
  17   * @version 1.5
  18   */
  19  class MediaController extends JController
  20  {
  21      /**
  22       * Method to display a view.
  23       *
  24       * @param    boolean            If true, the view output will be cached
  25       * @param    array            An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  26       *
  27       * @return    JController        This object to support chaining.
  28       * @since    1.5
  29       */
  30  	public function display($cachable = false, $urlparams = false)
  31      {
  32          JPluginHelper::importPlugin('content');
  33          $vName = JRequest::getCmd('view', 'media');
  34          switch ($vName)
  35          {
  36              case 'images':
  37                  $vLayout = JRequest::getCmd('layout', 'default');
  38                  $mName = 'manager';
  39  
  40                  break;
  41  
  42              case 'imagesList':
  43                  $mName = 'list';
  44                  $vLayout = JRequest::getCmd('layout', 'default');
  45  
  46                  break;
  47  
  48              case 'mediaList':
  49                  $app    = JFactory::getApplication();
  50                  $mName = 'list';
  51                  $vLayout = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
  52  
  53                  break;
  54  
  55              case 'media':
  56              default:
  57                  $vName = 'media';
  58                  $vLayout = JRequest::getCmd('layout', 'default');
  59                  $mName = 'manager';
  60                  break;
  61          }
  62  
  63          $document = JFactory::getDocument();
  64          $vType        = $document->getType();
  65  
  66          // Get/Create the view
  67          $view = $this->getView($vName, $vType);
  68  
  69          // Get/Create the model
  70          if ($model = $this->getModel($mName)) {
  71              // Push the model into the view (as default)
  72              $view->setModel($model, true);
  73          }
  74  
  75          // Set the layout
  76          $view->setLayout($vLayout);
  77  
  78          // Display the view
  79          $view->display();
  80  
  81          return $this;
  82      }
  83  
  84  	function ftpValidate()
  85      {
  86          // Set FTP credentials, if given
  87          JClientHelper::setCredentialsFromRequest('ftp');
  88      }
  89  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1