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 edit() { $this->requireAsset('core/topics'); $tt = new TopicTree(); $defaultTree = $tt->getDefault(); $tree = $tt->getByID(Loader::helper('security')->sanitizeInt($this->topicTreeID)); if (!$tree) { $tree = $defaultTree; } $trees = $tt->getList(); $keys = CollectionKey::getList(); foreach ($keys as $ak) { if ($ak->getAttributeTypeHandle() == 'topics') { $attributeKeys[] = $ak; } } $this->set('attributeKeys', $attributeKeys); $this->set('tree', $tree); $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); }