/** * # Backend Functionality * * Get the tree array for the children of the current item * * @return array */ public function getMenuChildrenTree() { $tree = array(); $children = $this->children; foreach ($children as $child) { $hasChildren = $child->hasChildren(); $childNode = array('id' => $this->site_id . '_menuitem_' . $child->id, 'menu_id' => $this->id, 'menu_item_id' => $child->id, 'cls' => 'site-node-menuitem', 'site_id' => $this->site_id, 'iconCls' => 'go-model-icon-Menuitem', 'text' => $child->label, 'hasChildren' => $hasChildren, 'expanded' => !$hasChildren || \GO\Site\Model\Site::isExpandedNode($this->site_id . '_menu_' . $child->id), 'children' => $hasChildren ? null : $child->getChildrenTree()); $tree[] = $childNode; } return $tree; }
public function getTreeNodeAttributes() { $hasChildren = $this->hasChildren(); return array('id' => $this->site_id . '_content_' . $this->id, 'site_id' => $this->site_id, 'content_id' => $this->id, 'slug' => $this->slug, 'cls' => 'site-node-content', 'iconCls' => 'go-model-icon-GO_Site_Model_Content', 'expanded' => !$hasChildren || \GO\Site\Model\Site::isExpandedNode($this->site_id . '_content_' . $this->id), 'hasChildren' => $hasChildren, 'children' => $hasChildren ? $this->getChildrenTree() : array(), 'text' => $this->title, 'qtip' => 'Drag me to the editor to create a link.'); }