public function get_push_state() { $push_state = new push_state(); $push_state->url = $this->current->get_url(); $push_state->title = $this->current->nav_title; $push_state->data->url = $push_state->url; $push_state->data->module = get_class($this); $push_state->data->page = $this->current->pid; $push_state->data->act = 'ajax_load'; $push_state->data->id = '#' . $this->view_object->get_page_selector(); $push_state->push = !isset($_REQUEST['is_popped']) ? true : !$_REQUEST['is_popped']; return $push_state; }
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 set_page_from_path() { $this->page = new page(); if (is_numeric($this->path[0])) { $this->page->do_retrieve_from_id([], (int) $this->path[0]); } else { $this->page->do_retrieve([], ['where_equals' => ['module_name' => $this->path[0]]]); } $this->pid = isset($this->page->pid) ? $this->page->pid : 0; }
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; }