} } if (init('action') == 'test') { ajax::success(market::test()); } if (init('action') == 'setRating') { $market = market::byId(init('id')); if (!is_object($market)) { throw new Exception(__('Impossible de trouver l\'objet associé : ', __FILE__) . init('id')); } $market->setRating(init('rating')); ajax::success(); } if (init('action') == 'setComment') { $market = market::byId(init('id')); if (!is_object($market)) { throw new Exception(__('Impossible de trouver l\'objet associé : ', __FILE__) . init('id')); } $market->setComment(init('comment', null), init('order', null)); ajax::success(); } if (init('action') == 'sendReportBug') { $ticket = json_decode(init('ticket'), true); market::saveTicket($ticket); ajax::success(array('url' => config::byKey('market::address') . '/index.php?v=d&p=ticket')); } throw new Exception(__('Aucune méthode correspondante à : ', __FILE__) . init('action')); /* * *********Catch exeption*************** */ } catch (Exception $e) { ajax::error(displayExeption($e), $e->getCode()); }