public function admin_moveup($id, $step = 1)
{
$link = $this->Link->findById($id);
if (!isset($link['Link']['id'])) {
$this->Session->setFlash(__d('croogo', 'Invalid id for Link'), 'flash', array('class' => 'error'));
return $this->redirect(array('controller' => 'menus', 'action' => 'index'));
}
$this->Link->setTreeScope($link['Link']['menu_id']);
if ($this->Link->moveUp($id, $step)) {
Cache::clearGroup('menus', 'croogo_menus');
$this->Session->setFlash(__d('croogo', 'Moved up successfully'), 'flash', array('class' => 'success'));
} else {
$this->Session->setFlash(__d('croogo', 'Could not move up'), 'flash', array('class' => 'error'));
}
return $this->redirect(array('action' => 'index', '?' => array('menu_id' => $link['Link']['menu_id'])));
}