本文整理汇总了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;
}
}
示例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();
}
}
示例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();
}
示例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();
}