english/administrator/components/com_media/controller.php
/**
	 * Method to display a view.
	 *
	 * @param	boolean			If true, the view output will be cached
	 * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
	 *
	 * @return	JController		This object to support chaining.
	 * @since	1.5
	 */
Method to display a view.
@param       boolean                 If true, the view output will be cached
@param       array                   An array of safe url parameters and their variable types, for valid values see  JFilterInput::clean().

@return      JController             This object to support chaining.
Method to display a view . @param boolean If true the view output will be cached @param array An array of safe url parameters and their variable types for valid values see JFilterInput :: clean () . @return JController This object to support chaining .
public function display($cachable = false, $urlparams = false)
	{
		JPluginHelper::importPlugin('content');
		$vName = JRequest::getCmd('view', 'media');
		switch ($vName)
		{
			case 'images':
				$vLayout = JRequest::getCmd('layout', 'default');
				$mName = 'manager';
				break;
			case 'imagesList':
				$mName = 'list';
				$vLayout = JRequest::getCmd('layout', 'default');
				break;
			case 'mediaList':
				$app	= JFactory::getApplication();
				$mName = 'list';
				$vLayout = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
				break;
			case 'media':
			default:
				$vName = 'media';
				$vLayout = JRequest::getCmd('layout', 'default');
				$mName = 'manager';
				break;
		}
		$document = JFactory::getDocument();
		$vType		= $document->getType();
		$view = $this->getView($vName, $vType);
		if ($model = $this->getModel($mName)) {
			$view->setModel($model, true);
		}
		$view->setLayout($vLayout);
		$view->display();
		return $this;
	}
public function display ( $ cachable = false , $ urlparams = false ) { JPluginHelper :: importPlugin ( 'content' ) ; $ vName = JRequest :: getCmd ( 'view' , 'media' ) ; switch ( $ vName ) { case 'images' : $ vLayout = JRequest :: getCmd ( 'layout' , 'default' ) ; $ mName = 'manager' ; break ; case 'imagesList' : $ mName = 'list' ; $ vLayout = JRequest :: getCmd ( 'layout' , 'default' ) ; break ; case 'mediaList' : $ app = JFactory :: getApplication ( ) ; $ mName = 'list' ; $ vLayout = $ app -> getUserStateFromRequest ( 'media.list.layout' , 'layout' , 'thumbs' , 'word' ) ; break ; case 'media' : default : $ vName = 'media' ; $ vLayout = JRequest :: getCmd ( 'layout' , 'default' ) ; $ mName = 'manager' ; break ; } $ document = JFactory :: getDocument ( ) ; $ vType = $ document -> getType ( ) ; $ view = $ this -> getView ( $ vName , $ vType ) ; if ( $ model = $ this -> getModel ( $ mName ) ) { $ view -> setModel ( $ model , true ) ; } $ view -> setLayout ( $ vLayout ) ; $ view -> display ( ) ; return $ this ; }
Method to display a view.
Method to display a view .
// Get/Create the view // Get/Create the model // Push the model into the view (as default) // Set the layout // Display the view