public function sortAction() { if ($datas = $this->getRequest()->getPost()) { try { // Récupère les positions $positions = $this->getRequest()->getParam('row'); if (empty($positions)) { throw new Exception($this->_("An error occurred while saving. Please try again later.")); } // Supprime les positions en trop, au cas où... foreach ($positions as $key => $position) { if (!is_numeric($position)) { unset($positions[$key]); } } // Met à jour les positions des flux $rss = new Rss_Model_Feed(); $rss->updatePositions($positions); // Renvoie OK $html = array('success' => 1); } catch (Exception $e) { $html = array('message' => $e->getMessage(), 'message_button' => 1, 'message_loader' => 1); } $this->getLayout()->setHtml(Zend_Json::encode($html)); } }