function load_page($tree) { $branch = find_branch($tree); if (isset($branch['type']) && $branch['type'] == 'file') { $html = ''; if ($branch['name'] !== 'index') { $html .= '<div class="page-header"> <a href="https://github.com/meenie/mun.ee/edit/master/' . $branch['path'] . '" target="_blank" title="You must be logged into Github for this to work." class="btn btn-primary pull-right improve-button">Improve This Page</a> <h1>' . $branch['title'] . '</h1> </div>'; } $html .= MarkdownExtended(file_get_contents($branch['path'])); return $html; } else { return "Oh No. That page dosn't exist"; } }
function load_page($tree, $url_params) { if (count($url_params) > 0) { $branch = find_branch($tree, $url_params); } else { $branch = current($tree); } $page = array(); if (isset($branch['type']) && $branch['type'] == 'file') { $html = ''; if ($branch['name'] !== 'index') { $page['title'] = $branch['title']; $page['modified'] = filemtime($branch['path']); } $html .= MarkdownExtended(file_get_contents($branch['path'])); $page['html'] = $html; } else { $page['title'] = "Oh no"; $page['html'] = "<h3>Oh No. That page doesn't exist</h3>"; } return $page; }