add missing layout
authorMichael Wallner <mike@php.net>
Fri, 13 Dec 2013 09:42:42 +0000 (10:42 +0100)
committerMichael Wallner <mike@php.net>
Fri, 13 Dec 2013 09:42:42 +0000 (10:42 +0100)
views/layout.phtml

index 69c972763648111576548e9fcd1a43de02c722c3..994f7f49c06d905550b16447eedf0604e7f0fd42 100644 (file)
@@ -1,27 +1,75 @@
 <!doctype html>
 <html>
- <head>
-  <meta charset="utf-8">
-  <title><?= $title ?></title>
-  <base href="<?= $baseUrl ?>/">
-  <link rel="stylesheet" href="index.css">
-  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
- </head>
- <body>
-  <div class="sidebar">
-   <?= $listing ?>
-  </div>
+       <head>
+               <meta charset="utf-8">
+               <title>
+                       <?php if (isset($title)) : ?>
+                               <?= $title ?> - mdref
+                       <?php else: ?>
+                               mdref
+                       <?php endif; ?>
+               </title>
+               <base href="<?= $baseUrl ?>">
+               <link rel="stylesheet" href="index.css">
+               <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+       </head>
+       <body>
+               <?php if (isset($listing)) : ?>
+               <div class="sidebar">
+                       <ul>
+                               <li>&lsh; <a href="">Home</a></li>
+                               <?php if (($entry = $listing->getParent())) : ?>
+                                       <li>&uarr; <a href="<?=$entry->formatUrl()?>"><?=$entry->formatLink()?></a></li>
+                               <?php endif; ?>
+                               <?php if (($entry = $listing->getSelf()) && ($link = $entry->formatLink())) : ?>
+                                       <ul><li>&circlearrowright; <?= $link ?>
+                               <?php endif; ?>
+                               <?php if (count($listing)) : ?>
+                                       <ul>
+                                               <?php foreach ($listing as $entry) : ?>
+                                               <li>&rdsh; <a href="<?=$entry->formatUrl()?>"><?=$entry->formatLink()?></a></li>
+                                               <?php endforeach; ?>
+                                       </ul>
+                               <?php endif; ?>
+                               <?php if (strlen($listing)) : ?>
+                                       </li></ul>
+                               <?php endif; ?>
+                       </ul>
+               </div>
+               <?php endif; ?>
+               
+               <?php if (isset($markdown)) : ?>
+                       <?= $markdown ?>
+                       <?php if (isset($sublisting) && count($sublisting)) : ?>
+                               <h2>Functions:</h2>
+                               <ul>
+                               <?php foreach($sublisting as $entry) : ?>
+                                       <li>
+                                               <h3><a href="<?=$entry->formatUrl()?>"><?=$entry->formatLink(true)?></a></h3>
+                                               <p><?=$entry->readDescription()?></p>
+                                               <p><?=$entry->readTitle()?></p>
+                                       </li>
+                               <?php endforeach; ?>
+                               </ul>
+                       <?php endif; ?>
+               <?php else: ?>
+                       <h1>mdref-v<?php readfile("../VERSION"); ?></h1>
+                       <?php if (isset($exception)) : ?>
+                               <?=\mdref\ExceptionHandler::html($exception, ["h2"], ["p"], ["pre", "style='overflow-x:scroll'"]); ?>
+                       <?php else : ?>
+                               <pre><?= htmlspecialchars(file_get_contents("../LICENSE")); ?></pre>
+                       <?php endif; ?>
+               <?php endif; ?>
 
-  <?= $content ?>
+               <div id="disqus_thread"></div>
 
-  <div id="disqus_thread"></div>
-
-  <footer>
-   <ul>
-       <li><a href="https://github.com/m6w6/mdref">mdref-v<?php readfile("../VERSION")?></a></li>
-       <li><a href="LICENSE">&copy; <?= implode("-", array_unique([2013,idate("Y")]))?></a></li>
-   </ul>
-  </footer>
-  <script src="index.js"></script>
- </body>
+               <footer>
+                       <ul>
+                               <li><a href="https://github.com/m6w6/mdref">mdref-v<?php readfile("../VERSION") ?></a></li>
+                               <li><a href="LICENSE">&copy; <?= implode("-", array_unique([2013, idate("Y")])) ?>
+                                       All rights reserved.</a></li>
+                       </ul>
+               </footer>
+               <script src="index.js"></script>
+       </body>
 </html>