Source for file controller.php

Documentation is available at controller.php

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

Documentation generated on Tue, 19 Nov 2013 14:57:02 +0100 by phpDocumentor 1.4.3