public function load_page($action) { $this->file = new File(format_page_name($action->page, true)); $this->markdown = Markdown($this->file->data); $this->action = $action->action; $this->page = $action->page; }
function MenuItem($name, $display_name = "", $subMenu = NULL) { $this->name = $name; $this->display_name = $display_name; if ($display_name == "") { $this->display_name = format_page_name($name); } $this->subMenu = $subMenu; }
function currentPageName($format = false) { global $CurrentPageName; if ($format) { return format_page_name($CurrentPageName); } else { return $CurrentPageName; } }
function drawNavButton($name, $text = "") { if ($text == "") { $text = format_page_name($name); } if ($name == activeButton()) { echo "<a href=\"index.php?p={$name}\" class=\"active\">{$text}</a>"; } else { echo "<a href=\"index.php?p={$name}\">{$text}</a>"; } }
function pre_process($result) { global $static_pages, $hidden_pages; $text = globsingle('static/pages/' . $result['file'] . '.*'); if (!empty($text)) { $result['text_file'] = $text; } if (isset($static_pages[$result['file']])) { $result['page_title'] = format_page_name($static_pages[$result['file']], true); } else { if (isset($hidden_pages[$result['file']])) { $result['page_title'] = format_page_name($hidden_pages[$result['file']], true); } } return $result; }
function drawNavButton($name, $text = "", $url = "", $class = "") { global $CurrentPageName; if ($text == "") { $text = format_page_name($name); } if ($url == "") { $url = "index.php?p={$name}"; } if ($name == activeButton()) { $class = "active"; } if (isSiteOffline()) { echo "<a>{$text}</a>"; } elseif ($class != "") { echo "<a href=\"{$url}\" class=\"{$class}\">{$text}</a>"; } else { echo "<a href=\"{$url}\">{$text}</a>"; } }
</a></li> <?php } ?> </ul> </div> <div class="menu right"> <ul> <?php foreach ($external_pages as $page => $title) { ?> <li><a href="<?php echo $page; ?> "><?php echo format_page_name($title); ?> </a></li> <?php } ?> </ul> </div> <?php $modules->run("pre_output_content"); ?> <div id="content"> <?php include template(COMIC_MODE_TEMPLATE); ?> </div>
function page_exists($page) { $page = format_page_name($page); // if folder exists and markdown file doesn't page hasn't been created yet if (file_exists($page) && !file_exists($page . '/index.md')) { return false; } elseif (file_exists($page) && file_exists($page . '/index.md')) { return true; } return false; }
$javascript .= 'document.body.appendChild(a);'; } if (file_has_content('static/scripts.js')) { $javascript .= 'a=document.createElement("script");'; $javascript .= 'a.src="' . format_link('static/scripts.js') . '";'; $javascript .= 'document.body.appendChild(a);'; } $javascript .= '}'; $javascript .= 'document.addEventListener ? document.addEventListener("DOMContentLoaded", _) : document.attachEvent("onreadystagechange", function() {'; $javascript .= 'if (document.readyState === "interactive") { _(); }'; $javascript .= '});' . "\n"; $javascript .= '</script>' . "\n"; } $bodyClass = ' class="' . COMIC_MODE . '"'; if (defined("COMIC_BODY_CLASS")) { $bodyClass = ' class="' . COMIC_BODY_CLASS . '"'; } $pageTitle = ""; if (defined("COMIC_PAGE_TITLE") && COMIC_DEBUG != 'Landing/Splash Page') { $pageTitle = " - " . format_page_name(COMIC_PAGE_TITLE, true); } if (defined('COMIC_MODE') && file_has_content(template(COMIC_MODE . '.php'))) { define('COMIC_MODE_TEMPLATE', COMIC_MODE . '.php'); } else { define('COMIC_MODE_TEMPLATE', 'default.php'); } $modules->run("pre_output"); include template("index.php"); $modules->run("exit"); $timer['end'] = microtime(true); echo "\r\n<!-- Generated in " . round(($timer['end'] - $timer['start']) * 1000, 2) . "ms using " . round(memory_get_usage() / (1024 * 1024), 2) . "MB of RAM -->";