function get_main_nav() { $pages = page::get_all([], ['where' => 'nav=1', 'order' => 'position']); return $pages->iterate_return(function (page $page) { return node::create('li' . ($page->pid == \core::$singleton->pid ? '.sel' : ''), [], node::create('a', ['href' => $page->get_url()], $page->nav_title ?: $page->title)); }); }
public function get_view() { $html = node::create('div.content', [], $this->module->current->body); $pages = page::get_all(['title', 'info', 'module_name', 'fn', 'icon'], ['order' => 'position', 'where' => 'pid != 12']); if ($pages) { $html .= node::create('div#page_list', [], $pages->iterate_return(function (page $page) { return node::create('div.page', [], node::create('a', ['href' => $page->get_url()], node::create('h2', [], icon::get($page->icon) . '<br/>' . $page->title) . ($page->info ? node::create('p', [], $page->info) : ''))); })); } return $html; }