Lines Matching refs:page

232      * Returns the converted instructions of a give page/section
237 function _get_instructions($page, $sect, $mode, $lvl, $flags, $root_id = null, $included_pages = array()) {
238 $key = ($sect) ? $page . '#' . $sect : $page;
248 if (page_exists($page) || $flags['pageexists'] == 0) {
251 $title = p_get_first_heading($page);
265 if (page_exists($page)) {
268 $ID = $page; // Change the global $ID as otherwise plugins like the discussion plugin will save data for the wrong page
269 $ins = p_cached_instructions(wikiFN($page), false, $page);
275 $this->_convert_instructions($ins, $lvl, $page, $sect, $flags, $root_id, $included_pages);
281 * Converts instructions of the included page
293 function _convert_instructions(&$ins, $lvl, $page, $sect, $flags, $root_id, $included_pages = array()) {
302 $this->_get_firstsec($ins, $page, $flags); // only first section
305 $ns = getNS($page);
315 $this->adapt_links($ins, $page, $included_pages);
353 $this->adapt_links($ins[$i][1][0], $page, $included_pages);
425 $this->_permalink($ins[$idx], $page, $sect, $flags);
455 // close last open section of the included page if there is any
464 $this->_editbtn($ins, $page, $sect, $sect_title, ($flags['redirect'] ? $root_id : false), $include_secid);
469 $ins[] = $this->_footer($page, $sect, $sect_title, $flags, $footer_lvl, $root_id);
489 array_unshift($ins, array('plugin', array('include_wrap', array('open', $page, $flags['redirect'], $include_secid))));
508 function _footer($page, $sect, $sect_title, $flags, $footer_lvl, $root_id) {
511 $footer[1] = array('include_footer', array($page, $sect, $sect_title, $flags, $root_id, $footer_lvl));
520 function _editbtn(&$ins, $page, $sect, $sect_title, $root_id, $hid = '') {
521 $title = ($sect) ? $sect_title : $page;
533 function _permalink(&$ins, $page, $sect, $flags) {
535 $ins[1] = array('include_header', array($ins[1][0], $ins[1][1], $ins[1][2], $page, $sect, $flags));
542 * @param string $page The included page
545 private function adapt_links(&$ins, $page, $included_pages = null) {
547 $ns = getNS($page);
592 // hopefully the hash is also unique in the including page (otherwise this might be the wrong link target)
606 /* Convert local links to internal links if the page hasn't been fully included */
607 if ($included_pages == null || !array_key_exists($page, $included_pages)) {
609 $ins[$i][1][0] = ':'.$page.'#'.$ins[$i][1][0];
654 * Only display the first section of a page and a readmore link
658 function _get_firstsec(&$ins, $page, $flags) {
680 $ins[] = array('plugin', array('include_readmore', array($page)));
695 function _get_included_pages($mode, $page, $sect, $parent_id, $flags) {
700 $page = cleanID($page);
701 $ns = utf8_encodeFN(str_replace(':', '/', $page));
703 $depth = $flags['depth'] ? $flags['depth'] + substr_count($page, ':') + ($page ? 1 : 0) : 0;
719 $tag = $page;
727 $page = $this->_apply_macro($page, $parent_id);
728 resolve_pageid(getNS($parent_id), $page, $exists); // resolve shortcuts and clean ID
729 if (auth_quickaclcheck($page) >= AUTH_READ)
730 $pages[] = $page;
734 $pages = array_filter($pages, function ($page) use ($flags) {
735 if (@preg_match($flags['exclude'], $page))
749 foreach ($pages as $page) {
753 $key = p_get_first_heading($page);
756 $key = p_get_metadata($page, 'date created', METADATA_DONT_RENDER);
759 $key = p_get_metadata($page, 'date modified', METADATA_DONT_RENDER);
762 $key = p_get_metadata($page, 'indexmenu_n', METADATA_RENDER_USING_SIMPLE_CACHE);
767 $key = p_get_metadata($page, 'include_n', METADATA_RENDER_USING_SIMPLE_CACHE);
772 $key .= '_'.$page;
773 $ordered_pages[$key] = $page;
785 foreach ($pages as $page) {
786 $exists = page_exists($page);
787 $result[] = array('id' => $page, 'exists' => $exists, 'parent_id' => $parent_id);
815 $page = $instruction['page'];
819 $pages = array_merge($pages, $this->_get_included_pages($mode, $page, $sect, $parent_id, $flags));