Esempio n. 1
0
     exit;
     break;
 case 'del-article':
     if (!hasPermissions('articles')) {
         exit;
     }
     $article = articles::getArticle($id, $uid);
     if (!$article) {
         return false;
     }
     if ($article['logo']) {
         $file = new CFile();
         $file->Delete($article['logo']);
     }
     $warn = stripslashes(__paramInit('htmltext', null, 'msgtxt'));
     articles::delArticle($id, $warn);
     $q = array();
     parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $q);
     if (isset($q['id'])) {
         unset($q['id']);
     }
     if ($q['p']) {
         $count = $q['page'] == 'unpublished' ? articles::ArticlesCount(false) : articles::ArticlesCount();
         if ($count - 1 < (intval($q['p']) - 1) * $msgs_on_page) {
             $q['p'] = $q['p'] - 1;
             if ($q['p'] < 2) {
                 unset($q['p']);
             }
         }
     }
     echo header('Location: /articles/' . url($GET, $q, true, '?'));