english/libraries/joomla/application/component/controlleradmin.php
/**
	 * Method to save the submitted ordering values for records.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
Method to save the submitted ordering values for records.
@return  void


Method to save the submitted ordering values for records . @return void
public function saveorder()
	{
		JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
		$pks	= JRequest::getVar('cid',	null,	'post',	'array');
		$order	= JRequest::getVar('order',	null,	'post',	'array');
		JArrayHelper::toInteger($pks);
		JArrayHelper::toInteger($order);
		$model = $this->getModel();
		$return = $model->saveorder($pks, $order);
		if ($return === false)
		{
			$message = JText::sprintf('JLIB_APPLICATION_ERROR_REORDER_FAILED', $model->getError());
			$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list, false), $message, 'error');
			return false;
		} else
		{
			$this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_ORDERING_SAVED'));
			$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list, false));
			return true;
		}
	}
public function saveorder ( ) { JRequest :: checkToken ( ) or jexit ( JText :: _ ( 'JINVALID_TOKEN' ) ) ; $ pks = JRequest :: getVar ( 'cid' , null , 'post' , 'array' ) ; $ order = JRequest :: getVar ( 'order' , null , 'post' , 'array' ) ; JArrayHelper :: toInteger ( $ pks ) ; JArrayHelper :: toInteger ( $ order ) ; $ model = $ this -> getModel ( ) ; $ return = $ model -> saveorder ( $ pks , $ order ) ; if ( $ return === false ) { $ message = JText :: sprintf ( 'JLIB_APPLICATION_ERROR_REORDER_FAILED' , $ model -> getError ( ) ) ; $ this -> setRedirect ( JRoute :: _ ( 'index.php?option=' . $ this -> option . '&view=' . $ this -> view_list , false ) , $ message , 'error' ) ; return false ; } else { $ this -> setMessage ( JText :: _ ( 'JLIB_APPLICATION_SUCCESS_ORDERING_SAVED' ) ) ; $ this -> setRedirect ( JRoute :: _ ( 'index.php?option=' . $ this -> option . '&view=' . $ this -> view_list , false ) ) ; return true ; } }
Method to save the submitted ordering values for records.
Method to save the submitted ordering values for records .
// Check for request forgeries. // Get the input // Sanitize the input // Get the model // Save the ordering // Reorder failed // Reorder succeeded.