Ejemplo n.º 1
0
 public function orderAction()
 {
     $this->setNoRender();
     $this->disableLayout();
     $request = $this->getRequest();
     if (!$request->isPost()) {
         $this->getResponse()->setBody('RESULT_NOT_OK');
         return;
     }
     $response = 'RESULT_NOT_OK';
     $data = $request->getPost('data');
     $json = new Services_JSON();
     $data = $json->decode($data);
     foreach ($data as $category) {
         Modules_Category_Services_Category::updateOrder(array('category_id' => $category->id, 'parent_id' => $category->parent_id, 'left_id' => $category->left_id, 'right_id' => $category->right_id));
     }
     $this->getResponse()->setBody('RESULT_OK');
 }