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


PHP Node::by_id方法代碼示例

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


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

示例1: countSubItems

 function countSubItems($id)
 {
     $n = Node::by_id($id, 'ub_tree_societies');
     if ($n) {
         $c = $n->countSubItems() - 1;
         return $c;
     } else {
         return 0;
     }
 }
開發者ID:amanai,項目名稱:next24,代碼行數:10,代碼來源:BlogTreeModelSocieties.php

示例2: EditArticleAction

 public function EditArticleAction()
 {
     $request = Project::getRequest();
     $id = (int) $request->getKeyByNumber(0);
     if (!$request->submit) {
         $data = array();
         $data['action'] = "EditArticle";
         $this->BaseSiteData();
         $data['tab_list'] = TabController::getMainArticleTabs(false, false, false, false, false, true, null, $article_model->title);
         $article_model = new ArticleModel();
         $article_vote_model = new ArticleVoteModel();
         $article_page_model = new ArticlePageModel();
         $article_tree_model = new ArticleTreeModel();
         if (count($article_vote_model->loadByArticleId($id)) > 0) {
             //TODO: it's todo
             $data['message'] = "Вы не можете редактировать эту статью, голосование по ней уже началось";
         } else {
             $article = $article_model->load($id);
             if ($article['user_id'] == Project::getUser()->getDbUser()->id) {
                 $data['article'] = $article;
                 $data['pages'] = $article_page_model->loadByArticleId($id);
                 $key = Node::by_id($article_model->articles_tree_id, 'articles_tree')->key;
                 while ($key != "") {
                     $sect[] = $key;
                     $key = $key->getParent();
                 }
                 $sect = array_reverse($sect);
                 $n = Node::by_key('', 'articles_tree');
                 $branches = $n->getBranch();
                 $fill_sections = array();
                 foreach ($branches as $section) {
                     $data['fill_sections'][$section['level']][] = $section;
                 }
                 $data['sect'] = $sect;
             }
         }
         $this->_view->AddArticle($data);
         $this->_view->parse();
     }
 }
開發者ID:amanai,項目名稱:next24,代碼行數:40,代碼來源:ArticleController.php

示例3: change_parent

 function change_parent($vars)
 {
     $n = Node::by_id($vars['id'], 'sitemap');
     $parent = Node::by_id($vars['parent_id'], 'sitemap');
     $n->changeParent($parent);
     $this->go_page();
 }
開發者ID:amanai,項目名稱:next24,代碼行數:7,代碼來源:BlogAdminSocietiesController.php

示例4: DownSectionAction

 public function DownSectionAction()
 {
     $request = Project::getRequest();
     $id = $request->getKeyByNumber(0);
     $node = Node::by_id($id, 'articles_tree');
     $node->moveDown();
     $data = array();
     $this->_makeSectionList($data);
     $this->_view->AjaxSectionList($data);
     $this->_view->ajax();
 }
開發者ID:amanai,項目名稱:next24,代碼行數:11,代碼來源:AdminArticleController.php


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