Ejemplo n.º 1
0
 public function action_delete()
 {
     $this->title = 'Удаление галереи';
     $id = $this->params[2];
     if (isset($_POST['undoDelete'])) {
         header('Location: /' . ADMIN_URL . '/gallery/all');
         exit;
     } elseif (isset($_POST['delete'])) {
         if ($this->gallery->delete($id) !== false) {
             header('Location: /' . ADMIN_URL . '/gallery/all');
             exit;
         }
     }
     $this->content = View::template('gallery/v_delete.php', ['id_gallery' => $id]);
 }
Ejemplo n.º 2
0
 public function action_delete()
 {
     //if (isset($_POST['delete'])) {
     $this->title = 'Удалить страницу';
     $id = $this->params[2];
     $errors = [];
     $pages = null;
     if ($this->model->delete($id) === true) {
         header('Location: /' . ADMIN_URL . '/page');
         exit;
     } elseif ($this->model->delete($id) === false) {
         $errors = $this->model->errors();
     } elseif (is_array($this->model->delete($id))) {
         $pages = $this->model->tree($shift = $id);
     }
     //var_dump($this->model->delete($id));
     //die;
     $this->content = View::template('page/v_delete.php', ['errors' => $errors, 'pages' => $pages]);
     //}
     //$this->scripts[] = 'url_page';
 }
Ejemplo n.º 3
0
 public function action_delete()
 {
     $this->title = 'Удаление пользователя';
     $id = $this->params[2];
     $return = isset($this->params[3]) ? $this->params[3] : 1;
     if (isset($_POST['undoDelete'])) {
         header('Location: /' . ADMIN_URL . '/user/one/' . $id);
         exit;
     } elseif (isset($_POST['delete'])) {
         if ($this->user->delete($id) !== false) {
             header('Location: /' . ADMIN_URL . '/user/page/' . $return);
             exit;
         }
     }
     $this->content = View::template('user/v_delete.php', ['id_user' => $id]);
 }
Ejemplo n.º 4
0
 public function render()
 {
     $main = View::template('v_main.php', ['title' => $this->title, 'content' => $this->content, 'scripts' => $this->scripts, 'vars_to_js' => $this->vars_to_js, 'active_user' => $this->active_user]);
     echo $main;
 }
Ejemplo n.º 5
0
 public function action_access_err()
 {
     $this->title = 'Ошибка доступа';
     $this->content = View::template('msg/v_accessdenied.php');
 }
Ejemplo n.º 6
0
 public function action_delete()
 {
     $this->title = 'Удаление роли';
     $id = $this->params[2];
     if (isset($_POST['undoDelete'])) {
         header('Location: /' . ADMIN_URL . '/role/one/' . $id);
         exit;
     } elseif (isset($_POST['delete'])) {
         if ($this->role->delete($id) !== false) {
             header('Location: /' . ADMIN_URL . '/role/all');
             exit;
         }
     }
     $this->content = View::template('role/v_delete.php', ['id_role' => $id]);
 }