當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TabController::getNewsTabs方法代碼示例

本文整理匯總了PHP中TabController::getNewsTabs方法的典型用法代碼示例。如果您正苦於以下問題:PHP TabController::getNewsTabs方法的具體用法?PHP TabController::getNewsTabs怎麽用?PHP TabController::getNewsTabs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TabController的用法示例。


在下文中一共展示了TabController::getNewsTabs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: AddNewsTreeAction

 public function AddNewsTreeAction()
 {
     $newsModel = new NewsModel();
     $request = Project::getRequest();
     $user = Project::getUser()->getDbUser();
     $isAdmin = $user->user_type_id == 1 ? true : false;
     $this->_view->clearFlashMessages();
     if ($request->frmAction == 'add') {
         $noErrors = true;
         if (!$request->news_tree_id) {
             $this->_view->addFlashMessage(FM::ERROR, "Выберите в какой категории будет находиться новый раздел");
             $noErrors = false;
         }
         if (!trim($request->news_tree_name)) {
             $this->_view->addFlashMessage(FM::ERROR, "Введите название категории");
             $noErrors = false;
         }
         if (!$user->id) {
             $this->_view->addFlashMessage(FM::ERROR, "Необходимо зарегистрироваться для добавления новых разделов");
             $noErrors = false;
         }
         if ($noErrors) {
             $category_tag = trim($request->category_tag);
             $type = $category_tag ? 1 : 0;
             // 0 - 1 Rss => 1 NewsTreeCastegory; 1 - 1 Rss => N NewsTreeCategory
             $creation_date = date("Y-m-d H:i:s");
             if ($user->user_type_id == 1 || $user->user_type_id == 4) {
                 // partner or Admin
                 $is_partner = 1;
                 $state = 0;
                 $text_parse_type = 0;
             } else {
                 // registred user
                 $is_partner = 0;
                 $state = 1;
                 $text_parse_type = 2;
             }
             $news_tree_id = $newsModel->addNewsTree($request->news_tree_id, $user->id, $request->news_tree_name, 0);
             //Project::getResponse()->redirect(Project::getRequest()->createUrl('News', 'ChangeNewsTree')."/tree_id:".$news_tree_id);
             Project::getResponse()->redirect(Project::getRequest()->createUrl('News', 'AddNewsTree') . "/isadded:1");
         }
     }
     if ($request->isadded == 1) {
         $this->_view->assign('isAdded', true);
         $this->_view->addFlashMessage(FM::INFO, "Раздел отправлен на модерацию");
     } else {
         $this->_view->assign('isAdded', false);
         $aListNews = $newsModel->getAllNews();
         $this->_view->assign('news_list', $aListNews);
         // all News tree
     }
     $this->_view->assign('tab_list', TabController::getNewsTabs($user->id, $isAdmin, false, false, false, true));
     // Show tabs
     $this->_view->assign('frmAction', 'add');
     $this->_view->assign('submitValue', 'Добавить');
     $this->_view->assign('news_tree_name', '');
     $this->_view->AddNewsTreePage();
     $this->_view->parse();
 }
開發者ID:amanai,項目名稱:next24,代碼行數:59,代碼來源:NewsController.php


注:本文中的TabController::getNewsTabs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。