english/administrator/components/com_templates/models/source.php
/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @since	1.6
	 */
Method to auto-populate the model state.
Note. Calling getState in this method will result in recursion.


Method to auto - populate the model state . Note . Calling getState in this method will result in recursion .
protected function populateState()
	{
		jimport('joomla.filesystem.file');
		$app = JFactory::getApplication('administrator');
		$id = $app->getUserState('com_templates.edit.source.id');
		$temp = explode(':', base64_decode($id));
		$this->setState('extension.id', (int) array_shift($temp));
		$fileName = array_shift($temp);
		$this->setState('filename', $fileName);
		$app->setUserState('editor.source.syntax', JFile::getExt($fileName));
		$params	= JComponentHelper::getParams('com_templates');
		$this->setState('params', $params);
	}
protected function populateState ( ) { jimport ( 'joomla.filesystem.file' ) ; $ app = JFactory :: getApplication ( 'administrator' ) ; $ id = $ app -> getUserState ( 'com_templates.edit.source.id' ) ; $ temp = explode ( ':' , base64_decode ( $ id ) ) ; $ this -> setState ( 'extension.id' , ( int ) array_shift ( $ temp ) ) ; $ fileName = array_shift ( $ temp ) ; $ this -> setState ( 'filename' , $ fileName ) ; $ app -> setUserState ( 'editor.source.syntax' , JFile :: getExt ( $ fileName ) ) ; $ params = JComponentHelper :: getParams ( 'com_templates' ) ; $ this -> setState ( 'params' , $ params ) ; }
Method to auto-populate the model state.
Method to auto - populate the model state .
// Load the User state. // Parse the template id out of the compound reference. // Save the syntax for later use // Load the parameters.