Exemple #1
0
 function sitemapAction()
 {
     $v_params['logined'] = LoginChecker::isLogined();
     $v_params['smap']['main'] = TRUE;
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     $v_params['in_card_count'] = CardCounter::countGDSinCard();
     $v_params['sys_news_cats_HTML'] = SysNewsCatUtil::createTreeHTML("/" . SYS_BLOG_DIR . "?" . SYS_ART_CAT_PARAM_NAME . "=");
     if (0 != $_GET['code']) {
         $v_params['imags'] = TRUE;
         $region = AddrRegionUtil::getRegionByCode($_GET['code']);
         $v_params['title'] = "Список стендов для региона «" . $region['name'] . "»";
         $v_params['accounts'] = ImgAccountUtil::getImgAccountsByRegionCode($region['code'], TRUE);
     } else {
         $v_params['imags'] = FALSE;
         $v_params['title'] = "Список регионов";
         $v_params['regions'] = AddrRegionUtil::getRegions();
     }
     Application::fastView('main/sys_site_map', $v_params);
 }
Exemple #2
0
 function newsArtAction()
 {
     $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name");
     $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog");
     if (LoginChecker::isAdmin()) {
         if (0 == strcmp("add", $_GET['act'])) {
             $v_params['act_name'] = "Добавить новость";
             if (0 != strcmp("", $_POST['art_name']) && $_POST['cat_id'] && isset($_POST['pict_id']) && 0 != strcmp("", $_POST['art_name'])) {
                 $sysNewsArt['sys_news_cat_id'] = $_POST['cat_id'];
                 $sysNewsArt['title'] = $_POST['art_name'];
                 $sysNewsArt['preview'] = $_POST['preview'];
                 $sysNewsArt['main_pict_id'] = $_POST['pict_id'];
                 $id = SysNewsArtUtil::insertSysNewsArt($sysNewsArt);
                 $redirectURL = "/superAdmin/newsArt?id={$id}&act=upd";
                 header("Location: {$redirectURL}");
             } else {
                 if ($_POST['add_head_form']) {
                     $v_params['error_msg'] = "Введены не все поля";
                 }
             }
             $v_params['img_blog_cats'] = SysNewsCatUtil::getSysNewsCats();
             $img_albums = ImgAlbumUtil::getImgAlbumsByAccountID(0);
             $img_album_pictures = ImgPictureUtil::getImgPicturesNoAlbum(0);
             $v_params['img_albums'][] = array("name" => "Без альбома", "pictures" => $img_album_pictures);
             foreach ($img_albums as $img_album) {
                 $img_album_pictures = ImgPictureUtil::getImgPicturesByAlbumId($img_album['id'], 0);
                 $v_params['img_albums'][] = array("name" => $img_album['name'], "pictures" => $img_album_pictures);
             }
             Application::fastView('super-admin/news/news_page_a', $v_params);
             exit;
         } else {
             if (0 == strcmp("upd", $_GET['act'])) {
                 $v_params['act_name'] = "Редактировать новость";
                 $v_params['img_news_art'] = SysNewsArtUtil::getSysNewsArtById($_GET['id']);
                 if (0 != strcmp("", $_POST['art_name']) && $_POST['cat_id'] && isset($_POST['pict_id']) && 0 != strcmp("", $_POST['art_name'])) {
                     $v_params['img_news_art']['sys_news_cat_id'] = $_POST['cat_id'];
                     $v_params['img_news_art']['title'] = $_POST['art_name'];
                     $v_params['img_news_art']['preview'] = $_POST['preview'];
                     $v_params['img_news_art']['main_pict_id'] = $_POST['pict_id'];
                     SysNewsArtUtil::updateSysNewsArt($v_params['img_news_art']);
                 } else {
                     if ($_POST['add_head_form']) {
                         $v_params['error_msg'] = "Введены не все поля";
                     }
                 }
                 $v_params['ssp_blocks'] = SysNewsArtBlockUtil::getSysNewsArtBlocksByArtId($_GET['id']);
                 $v_params['img_blog_cats'] = SysNewsCatUtil::getSysNewsCats();
                 $img_albums = ImgAlbumUtil::getImgAlbumsByAccountID(0);
                 $img_album_pictures = ImgPictureUtil::getImgPicturesNoAlbum(0);
                 $v_params['img_albums'][] = array("name" => "Без альбома", "pictures" => $img_album_pictures);
                 foreach ($img_albums as $img_album) {
                     $img_album_pictures = ImgPictureUtil::getImgPicturesByAlbumId($img_album['id'], 0);
                     $v_params['img_albums'][] = array("name" => $img_album['name'], "pictures" => $img_album_pictures);
                 }
                 Application::fastView('super-admin/news/news_page_u', $v_params);
                 exit;
             } else {
                 if (0 == strcmp("del", $_GET['act'])) {
                     $v_params['act_name'] = "Удалить новость";
                     if ($_POST['artID']) {
                         SysNewsArtBlockUtil::deleteSysNewsArtBlocksByNewsArtId($_POST['artID']);
                         SysNewsArtUtil::deleteSysNewsArtById($_POST['artID']);
                         header("Location: /superAdmin/news");
                     }
                     $v_params['img_blog_cats'] = SysNewsCatUtil::getSysNewsCats();
                     $v_params['img_blog_art'] = SysNewsArtUtil::getSysNewsArtById($_GET['id']);
                     $v_params['img_blog_art_blocks'] = SysNewsArtBlockUtil::getSysNewsArtBlocksByArtId($_GET['id']);
                     Application::fastView('super-admin/news/news_page_del', $v_params);
                     exit;
                 }
             }
         }
     } else {
         header("Location: /superAdmin/login");
     }
 }