当前位置: 首页>>代码示例>>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;未经允许,请勿转载。