Example #1
0
 public function sort_orderAction()
 {
     $request = $this->getRequest();
     $page = (int) $request->getRequest('page');
     if ($page < 1) {
         $page = 1;
     }
     $plus = (int) (JO_Registry::get('config_front_limit') * $page) - JO_Registry::get('config_front_limit');
     if ($request->isXmlHttpRequest()) {
         if (JO_Session::get('user[user_id]')) {
             $ids = $request->getPost('ids');
             if ($ids) {
                 foreach ($ids as $sort_order => $id) {
                     Model_Boards::sort_order($id, $sort_order + $plus);
                 }
                 $this->view->ok = $this->translate('The arrangement is saved!');
             }
         }
     } else {
         $this->forward('error', 'error404');
     }
     echo $this->renderScript('json');
 }