Beispiel #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');
 }
 public function EditAction($route)
 {
     $id = (int) $route[0];
     $res = array('Title' => 'Редактирование пункта меню', 'PageTitle' => 'Редактирование пункта меню');
     $params = array();
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $fields = array('item_title', 'item_link');
         $rows = Utils::ArrayFilter($_POST, $fields);
         Topmenu_Model::Update($_POST, 'topmenu', 'item_id', $id);
         $params['Message'] = 'Данные успешно сохранены';
     }
     if (!empty($id)) {
         $res['Content'] = Topmenu_View::GetEditPage($id, $params);
     }
     return $res;
 }