administrator/components/com_categories/models/category.php
public function getForm($data = array(), $loadData = true)
	{
		$extension = $this->getState('category.extension');
		$jinput = JFactory::getApplication()->input;

		// A workaround to get the extension into the model for save requests.
		if (empty($extension) && isset($data['extension']))
		{
			$extension = $data['extension'];
			$parts = explode('.', $extension);

			$this->setState('category.extension', $extension);
			$this->setState('category.component', $parts[0]);
			$this->setState('category.section', @$parts[1]);
		}

		// Get the form.
		$form = $this->loadForm('com_categories.category' . $extension, 'category', array('control' => 'jform', 'load_data' => $loadData));

		if (empty($form))
		{
			return false;
		}

		// Modify the form based on Edit State access controls.
		if (empty($data['extension']))
		{
			$data['extension'] = $extension;
		}

		$user = JFactory::getUser();

		if (!$user->authorise('core.edit.state', $extension . '.category.' . $jinput->get('id')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled', 'true');
			$form->setFieldAttribute('published', 'disabled', 'true');

			// Disable fields while saving.
			// The controller has already verified this is a record you can edit.
			$form->setFieldAttribute('ordering', 'filter', 'unset');
			$form->setFieldAttribute('published', 'filter', 'unset');
		}

		return $form;
	}
public function getForm($data = array(), $loadData = true)
	{
		$extension = $this->getState('category.extension');
		$jinput = JFactory::getApplication()->input;

		// A workaround to get the extension into the model for save requests.
		if (empty($extension) && isset($data['extension']))
		{
			$extension = $data['extension'];
			$parts = explode('.', $extension);

			$this->setState('category.extension', $extension);
			$this->setState('category.component', $parts[0]);
			$this->setState('category.section', @$parts[1]);
		}

		// Get the form.
		$form = $this->loadForm('com_categories.category' . $extension, 'category', array('control' => 'jform', 'load_data' => $loadData));

		if (empty($form))
		{
			return false;
		}

		// Modify the form based on Edit State access controls.
		if (empty($data['extension']))
		{
			$data['extension'] = $extension;
		}

		$user = JFactory::getUser();

		if (!$user->authorise('core.edit.state', $extension . '.category.' . $jinput->get('id')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled', 'true');
			$form->setFieldAttribute('published', 'disabled', 'true');

			// Disable fields while saving.
			// The controller has already verified this is a record you can edit.
			$form->setFieldAttribute('ordering', 'filter', 'unset');
			$form->setFieldAttribute('published', 'filter', 'unset');
		}

		return $form;
	}
public function getForm ( $ data = array ( ) , $ loadData = true ) { $ extension = $ this -> getState ( 'category.extension' ) ; $ jinput = JFactory :: getApplication ( ) -> input ; // A workaround to get the extension into the model for save requests. if ( empty ( $ extension ) && isset ( $ data [ 'extension' ] ) ) { $ extension = $ data [ 'extension' ] ; $ parts = explode ( '.' , $ extension ) ; $ this -> setState ( 'category.extension' , $ extension ) ; $ this -> setState ( 'category.component' , $ parts [ 0 ] ) ; $ this -> setState ( 'category.section' , @ $ parts [ 1 ] ) ; } // Get the form. $ form = $ this -> loadForm ( 'com_categories.category' . $ extension , 'category' , array ( 'control' => 'jform' , 'load_data' => $ loadData ) ) ; if ( empty ( $ form ) ) { return false ; } // Modify the form based on Edit State access controls. if ( empty ( $ data [ 'extension' ] ) ) { $ data [ 'extension' ] = $ extension ; } $ user = JFactory :: getUser ( ) ; if ( ! $ user -> authorise ( 'core.edit.state' , $ extension . '.category.' . $ jinput -> get ( 'id' ) ) ) { // Disable fields for display. $ form -> setFieldAttribute ( 'ordering' , 'disabled' , 'true' ) ; $ form -> setFieldAttribute ( 'published' , 'disabled' , 'true' ) ; // Disable fields while saving. // The controller has already verified this is a record you can edit. $ form -> setFieldAttribute ( 'ordering' , 'filter' , 'unset' ) ; $ form -> setFieldAttribute ( 'published' , 'filter' , 'unset' ) ; } return $ form ; }
Method to get the row form.

@param   array    $data      Data for the form.
@param   boolean  $loadData  True if the form is to load its own data (default case), false if not.

@return  JForm|boolean  A JForm object on success, false on failure

@since   1.6
Method to get the row form .