public function moveItem($direct = null, $id = null, $delta = 1) {
		$isJson = $this->_controller->RequestHandler->prefers('json');
		if ($isJson) {
			Configure::write('debug', 0);
		}
		$result = $this->_model->moveItem($direct, $id, $delta);
		if (!$isJson) {
			if (!$result) {
				$this->_controller->Flash->error(__d('view_extension', 'Error move record %d %s', $id, __d('view_extension_direct', $direct)));
			}

			return $this->_controller->redirect($this->_controller->request->referer(true));
		} else {
			$data = compact('result', 'direct', 'delta');
			$this->_controller->set(compact('data'));
			$this->_controller->set('_serialize', 'data');
		}
	}
public function moveItem($direct = null, $id = null, $delta = 1) {
		$isJson = $this->_controller->RequestHandler->prefers('json');
		if ($isJson) {
			Configure::write('debug', 0);
		}
		$result = $this->_model->moveItem($direct, $id, $delta);
		if (!$isJson) {
			if (!$result) {
				$this->_controller->Flash->error(__d('view_extension', 'Error move record %d %s', $id, __d('view_extension_direct', $direct)));
			}

			return $this->_controller->redirect($this->_controller->request->referer(true));
		} else {
			$data = compact('result', 'direct', 'delta');
			$this->_controller->set(compact('data'));
			$this->_controller->set('_serialize', 'data');
		}
	}
public function moveItem ( $ direct = null , $ id = null , $ delta = 1 ) { $ isJson = $ this -> _controller -> RequestHandler -> prefers ( 'json' ) ; if ( $ isJson ) { Configure :: write ( 'debug' , 0 ) ; } $ result = $ this -> _model -> moveItem ( $ direct , $ id , $ delta ) ; if ( ! $ isJson ) { if ( ! $ result ) { $ this -> _controller -> Flash -> error ( __d ( 'view_extension' , 'Error move record %d %s' , $ id , __d ( 'view_extension_direct' , $ direct ) ) ) ; } return $ this -> _controller -> redirect ( $ this -> _controller -> request -> referer ( true ) ) ; } else { $ data = compact ( 'result' , 'direct' , 'delta' ) ; $ this -> _controller -> set ( compact ( 'data' ) ) ; $ this -> _controller -> set ( '_serialize' , 'data' ) ; } }
Action `moveItem`. Used to move item to new position.

@param string $direct Direction for moving: `up`, `down`, `top`, `bottom`
@param int $id ID of record for moving
@param int $delta Delta for moving
@return void
Action moveItem . Used to move item to new position .