123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
- function FormatURI(URI $uri, $base=""){
- $image=$uri->GetImage();
- $imageHTML="";
- if ($image!="")
- $imageHTML='<img src="'.$uri->GetImage().'" />';
- return '<a href="'.$base.$uri->GetLinkLocation().'">'.$imageHTML.$uri->GetText().'</a>';
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>
- {@Title}<?php
- $__crumbs=Breadcrumbs::GetAll();
- foreach ($__crumbs as $crumb)
- echo ' > ',$crumb['text'];
- ?> | Robware
- </title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
- <link href="/style.css" rel="stylesheet" type="text/css" />
- <link href="/style-med.css" rel="stylesheet" media="(max-width:1023px)" type="text/css" />
- <link href="/style-small.css" rel="stylesheet" media="(max-width:680px)" type="text/css" />
- <style type="text/css">
- {@CSS}
- </style>
- <style media="(max-width:1023px)">
- {@CSSMed}
- </style>
- <style media="(max-width:680px)">
- {@CSSSmall}
- </style>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
- <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
- <script src="/javascript.js"></script>
- <script type="text/javascript">
- {@JavaScript}
- </script>
- </head>
- <body>
- <div id="main-header">
- <div class="header">
- <img src="/images/menu.svg" id="menu-button" /><?php // using php tags to remove HTML space but to keep source tidy
- ?><h2><?php // Shitty, I know, but eh...
- ?><span>{@Title}</span><?php
- $__crumbs=Breadcrumbs::GetAll();
- foreach ($__crumbs as $crumb)
- echo '<span>',$crumb['text'],'</span>';
- ?></h2>
- </div>
- </div>
- <div id="menu">
- <div class="header">
- <img src="/images/logo.png" /><h1>Robware</h1>
- </div>
- <div id="nav-container">
- <nav>
- <dl>
- <?php
- $reqUri=trim($_SERVER['REQUEST_URI'],"/");
- $uriParts=explode("/",$reqUri);
- if ($uriParts[0]=="")
- $uriParts[0]="home";
-
- $__controllers=Navigation::Get();
- foreach ($__controllers as $controller){
- $cURI=$controller->GetURI();
- echo '<dt';
- if ($cURI->GetLinkLocation()=='/'.$uriParts[0])
- echo ' class="active"';
- echo'>',FormatURI($cURI);
- $items=$controller->GetItems();
- if (count($items)>0)
- echo '<span class="go">»</span><span class="expand">+</span>';
- echo '</dt>';
- if (count($items)>0){
- echo '<div class="sub-pages">';
- foreach ($items as $uri)
- echo '<dd>',FormatURI($uri,$cURI->GetLinkLocation().'/'),'</dd>';
- echo '</div>';
- }
- }
- ?>
- </dl>
- </nav>
- </div>
- </div>
- <div id="main">
- <div id="buttons">
- <table>
- <tr>
- <td>{@ButtonsLeft}</td>
- <td>{@ButtonsRight}</td>
- </tr>
- </table>
- </div>
- <div id="content">
- <?php if (isset($errors) && count($errors)>0){
- echo '<div class="errors">The following errors were encountered:<ul>';
- foreach ($errors as $e)
- echo '<li>',$e,'</li>';
- echo '</ul>Please rectify them and try again.</div>';
- } ?>
- {@Body}
- </div>
- <div id="footer">{@Footer}</div>
- </div>
- <?php if (!isset($_COOKIE['cookiePopupConfirmed']) || $_COOKIE['cookiePopupConfirmed']!=true) { ?>
- <div id="cookiePopup">
- <p>This site uses cookies. Please leave if you're not OK with this.</p>
- <p>In a hilarious twist of irony, we have to store a cookie to stop this popup appearing on every page.</p>
- <div>
- <button>OK</button>
- </div>
- </div>
- <?php }?>
- <div class="backdrop"></div>
- </body>
- </html>
|