template.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. function FormatURI(URI $uri, $base=""){
  3. $image=$uri->GetImage();
  4. $imageHTML="";
  5. if ($image!="")
  6. $imageHTML='<img src="'.$uri->GetImage().'" />';
  7. return '<a href="'.$base.$uri->GetLinkLocation().'">'.$imageHTML.$uri->GetText().'</a>';
  8. }
  9. ?>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <title>
  14. {@Title}<?php
  15. $__crumbs=Breadcrumbs::GetAll();
  16. foreach ($__crumbs as $crumb)
  17. echo ' &gt; ',$crumb['text'];
  18. ?> | Robware
  19. </title>
  20. <meta charset="UTF-8">
  21. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  22. <link href="/style.css" rel="stylesheet" type="text/css" />
  23. <link href="/style-med.css" rel="stylesheet" media="(max-width:1023px)" type="text/css" />
  24. <link href="/style-small.css" rel="stylesheet" media="(max-width:680px)" type="text/css" />
  25. <style type="text/css">
  26. {@CSS}
  27. </style>
  28. <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  29. <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
  30. <script src="/javascript.js"></script>
  31. <script type="text/javascript">
  32. {@JavaScript}
  33. </script>
  34. </head>
  35. <body>
  36. <div id="main-header">
  37. <div class="header">
  38. <img src="/images/menu.svg" id="menu-button" /><?php // using php tags to remove HTML space but to keep source tidy
  39. ?><h2><?php // Shitty, I know, but eh...
  40. ?><span>{@Title}</span><?php
  41. $__crumbs=Breadcrumbs::GetAll();
  42. foreach ($__crumbs as $crumb)
  43. echo '<span>',$crumb['text'],'</span>';
  44. ?></h2>
  45. </div>
  46. </div>
  47. <div id="menu">
  48. <div>
  49. <div class="header">
  50. <img src="/images/logo.png" /><h1>Robware</h1>
  51. </div>
  52. <div id="nav-container">
  53. <nav>
  54. <dl>
  55. <?php
  56. $__controllers=Navigation::Get();
  57. foreach ($__controllers as $controller){
  58. $cURI=$controller->GetURI();
  59. echo '<dt>',FormatURI($cURI);
  60. $items=$controller->GetItems();
  61. if (count($items)>0)
  62. echo '<span class="go">&raquo;</span><span class="expand">+</span>';
  63. echo '</dt>';
  64. if (count($items)>0){
  65. echo '<div class="sub-pages">';
  66. foreach ($items as $uri)
  67. echo '<dd>',FormatURI($uri,$cURI->GetLinkLocation().'/'),'</dd>';
  68. echo '</div>';
  69. }
  70. }
  71. ?>
  72. </dl>
  73. </nav>
  74. </div>
  75. </div>
  76. </div>
  77. <div id="main">
  78. <div id="buttons">
  79. <table>
  80. <tr>
  81. <td>{@ButtonsLeft}</td>
  82. <td>{@ButtonsRight}</td>
  83. </tr>
  84. </table>
  85. </div>
  86. <div id="content">{@Body}</div>
  87. <div id="footer">{@Footer}</div>
  88. </div>
  89. <?php if (!isset($_COOKIE['cookiePopupConfirmed']) || $_COOKIE['cookiePopupConfirmed']!=true) { ?>
  90. <div id="cookiePopup">
  91. <p>This site uses cookies. Please leave if you're not OK with this.</p>
  92. <p>In a hilarious twist of irony, we have to store a cookie to stop this popup appearing on every page.</p>
  93. <div>
  94. <button>OK</button>
  95. </div>
  96. </div>
  97. <?php }?>
  98. <div class="backdrop"></div>
  99. </body>
  100. </html>