public function handleTree() { $idNode = Input::get('node', 1); $current = Tree::find($idNode); $templates = Config::get('jarboe::tree.templates'); $template = Config::get('jarboe::tree.default'); if (isset($templates[$current->template])) { $template = $templates[$current->template]; } if ($template['type'] == 'table') { $options = array('url' => \URL::current(), 'def_name' => 'tree.' . $template['definition'], 'additional' => array('node' => $idNode)); return \Jarboe::table($options); } // }
private function handleShowCatalog() { $model = $this->model; $tree = $model::all()->toHierarchy(); $idNode = Input::get('node', 1); $current = $model::find($idNode); $parentIDs = array(); foreach ($current->getAncestors() as $anc) { $parentIDs[] = $anc->id; } $templates = Config::get('jarboe::tree.templates'); $template = Config::get('jarboe::tree.default'); if (isset($templates[$current->template])) { $template = $templates[$current->template]; } if ($template['type'] == 'table') { $options = array('url' => URL::current(), 'def_name' => 'tree.' . $template['definition'], 'additional' => array('node' => $idNode, 'current' => $current)); list($table, $form) = \Jarboe::table($options); $content = View::make('admin::tree.content', compact('current', 'table', 'form', 'template')); } elseif (false && $current->isLeaf()) { $content = 'ama leaf'; } else { $content = View::make('admin::tree.content', compact('current', 'template')); } return View::make('admin::tree', compact('tree', 'content', 'current', 'parentIDs')); }