public function view() { if ($this->mode == 'P') { $page = \Page::getCurrentPage(); $topics = $page->getAttribute($this->topicAttributeKeyHandle); if (is_array($topics)) { $this->set('topics', $topics); } } else { $tt = new TopicTree(); $tree = $tt->getByID(Core::make('helper/security')->sanitizeInt($this->topicTreeID)); $this->set('tree', $tree); } }
public function view($treeID = false) { $defaultTree = TopicTree::getDefault(); $tree = TopicTree::getByID(Loader::helper('security')->sanitizeInt($treeID)); if (!$tree) { $tree = $defaultTree; } $this->set('tree', $tree); $this->requireAsset('core/topics'); $trees = array(); if (is_object($defaultTree)) { $trees[] = $defaultTree; foreach (TopicTree::getList() as $ctree) { if ($ctree->getTreeID() != $defaultTree->getTreeID()) { $trees[] = $ctree; } } } $this->set('trees', $trees); }
public function type_form() { $this->requireAsset('core/topics'); $this->requireAsset('javascript', 'jquery/form'); $this->load(); $tt = new TopicTree(); $defaultTree = $tt->getDefault(); $topicTreeList = $tt->getList(); $tree = $tt->getByID(Core::make('helper/security')->sanitizeInt($this->akTopicTreeID)); if (!$tree) { $tree = $defaultTree; } $this->set('tree', $tree); $trees = array(); if (is_object($defaultTree)) { $trees[] = $defaultTree; foreach ($topicTreeList as $ctree) { if ($ctree->getTreeID() != $defaultTree->getTreeID()) { $trees[] = $ctree; } } } $this->set('trees', $trees); $this->set('parentNode', $this->akTopicParentNodeID); }