Exemplo n.º 1
0
 public static function GetDeletePage($id, $assocArr = null)
 {
     $tpl = new Template();
     $row = Topmenu_Model::GetMenuItemById($id);
     $tpl->SetParams($row);
     $tpl->SetParams($assocArr);
     return $tpl->Fetch('templates/topmenu/item-delete.tpl');
 }
Exemplo n.º 2
0
 public function DeleteAction($route)
 {
     $id = (int) $route[0];
     $res = array('Title' => 'Удаление пункта меню', 'PageTitle' => 'Удаление пункта меню');
     $params = array();
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         Topmenu_Model::Delete('topmenu', 'item_id', $id);
         header("Location: /topmenu/delete/ok");
     } else {
         if ($route[0] == 'ok') {
             $res['Content'] = Topmenu_View::GetDeleteOkPage();
         } else {
             if (!empty($id)) {
                 $row = Topmenu_Model::GetMenuItemById($id);
                 $res['Content'] = Topmenu_View::GetDeletePage($id, array_merge($row, $params));
             }
         }
     }
     return $res;
 }