english/administrator/components/com_banners/controllers/tracks.php
/**
	 * Method to remove a record.
	 *
	 * @return	void
	 * @since	1.6
	 */
Method to remove a record.
Method to remove a record .
public function delete()
	{
		JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
		$model = $this->getModel();
		$app = JFactory::getApplication();
		$type = $app->getUserState($this->context.'.filter.type');
		$model->setState('filter.type', $type);
		$begin = $app->getUserState($this->context.'.filter.begin');
		$model->setState('filter.begin', $begin);
		$end = $app->getUserState($this->context.'.filter.end');
		$model->setState('filter.end', $end);
		$categoryId = $app->getUserState($this->context.'.filter.category_id');
		$model->setState('filter.category_id', $categoryId);
		$clientId = $app->getUserState($this->context.'.filter.client_id');
		$model->setState('filter.client_id', $clientId);
		$model->setState('list.limit', 0);
		$model->setState('list.start', 0);
		$count = $model->getTotal();
		if (!$model->delete()) {
			JError::raiseWarning(500, $model->getError());
		} else {
			$this->setMessage(JText::plural('COM_BANNERS_TRACKS_N_ITEMS_DELETED', $count));
		}
		$this->setRedirect('index.php?option=com_banners&view=tracks');
	}
public function delete ( ) { JRequest :: checkToken ( ) or jexit ( JText :: _ ( 'JINVALID_TOKEN' ) ) ; $ model = $ this -> getModel ( ) ; $ app = JFactory :: getApplication ( ) ; $ type = $ app -> getUserState ( $ this -> context . '.filter.type' ) ; $ model -> setState ( 'filter.type' , $ type ) ; $ begin = $ app -> getUserState ( $ this -> context . '.filter.begin' ) ; $ model -> setState ( 'filter.begin' , $ begin ) ; $ end = $ app -> getUserState ( $ this -> context . '.filter.end' ) ; $ model -> setState ( 'filter.end' , $ end ) ; $ categoryId = $ app -> getUserState ( $ this -> context . '.filter.category_id' ) ; $ model -> setState ( 'filter.category_id' , $ categoryId ) ; $ clientId = $ app -> getUserState ( $ this -> context . '.filter.client_id' ) ; $ model -> setState ( 'filter.client_id' , $ clientId ) ; $ model -> setState ( 'list.limit' , 0 ) ; $ model -> setState ( 'list.start' , 0 ) ; $ count = $ model -> getTotal ( ) ; if ( ! $ model -> delete ( ) ) { JError :: raiseWarning ( 500 , $ model -> getError ( ) ) ; } else { $ this -> setMessage ( JText :: plural ( 'COM_BANNERS_TRACKS_N_ITEMS_DELETED' , $ count ) ) ; } $ this -> setRedirect ( 'index.php?option=com_banners&view=tracks' ) ; }
Method to remove a record.
Method to remove a record .
// Check for request forgeries. // Get the model. // Load the filter state. // Remove the items.