UrlActions system

...
type = 'success'; $jsonData->msg = 'Gotowe'; try { $this->reinstall(); } catch (Exception $e) { $jsonData->type = 'danger'; $jsonData->msg = $e->getMessage(); } echo json_encode($jsonData); } public function runAction() { $jsonData = new stdClass(); $jsonData->type = 'success'; $jsonData->msg = 'Gotowe'; try { $idAction = V::get('_idAction', 0, $_REQUEST, 'int'); if ($idAction > 0) { $this->runActionById($idAction); } } catch (Exception $e) { $jsonData->type = 'danger'; $jsonData->msg = $e->getMessage(); } echo json_encode($jsonData); } public function reinstall() { $sqlList = array(); //$sqlList['RemoveTable'] = "DROP TABLE IF EXISTS `CRM_UI_MSGS`"; $pdo = DB::getPDO(); foreach ($sqlList as $sqlName => $sql) { $pdo->exec($sql); } } public function runActionById($id) { $msgRow = $this->getActiveMessage($id); $execNotes = ''; if (!empty($msgRow->app_className)) { $route = Router::getRoute($msgRow->app_className); $route->runByMessageFromMsgsSystem($msgRow->msg, $execNotes); } $this->forceFinishMessage($id, $execNotes); } }