fix #1; upgrade jquery
[mdref/mdref] / views / layout.phtml
index 69b4c74c26d0a85e8cecd9e23cb68de9dca79808..f3bcbf792e8a0a1da0794319f39d42dd6a5f19fd 100644 (file)
                        <?php endif; ?>
                        mdref
                </title>
-               <base href="<?= $baseUrl ?>">
-               <meta http-equiv="Content-Location" content="<?= $baseUrl . $ref ?>">
-               <link rel="stylesheet" href="index.css">
-               <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+               <?php if (isset($baseUrl)) : ?>
+                       <base href="<?= $baseUrl ?>">
+                       <meta http-equiv="Content-Location" content="<?= $baseUrl . $ref ?>">
+                       <link rel="stylesheet" href="index.css">
+               <?php endif; ?>
+               
+               <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
        </head>
        <body>
+               <div class="page">
                <?php include __DIR__."/sidebar.phtml" ?>
                <?php if (isset($exception)) : ?>
                        <?= \mdref\ExceptionHandler::htmlException($exception) ?>
@@ -25,7 +29,7 @@
                        <?php include __DIR__."/index.phtml" ?>
                <?php endif; ?>
 
-               <?php if ($_SERVER["SERVER_NAME"] != "localhost") : ?>
+               <?php if (@$_SERVER["SERVER_NAME"] != "localhost") : ?>
                <div id="disqus_thread"></div>
                <script>
                        var disqus_shortname = 'mdref';
@@ -41,6 +45,9 @@
                <footer>
                        <?php include __DIR__."/footer.phtml" ?>
                </footer>
-               <script src="index.js"></script>
+               <?php if (isset($baseUrl)) : ?>
+                       <script src="index.js"></script>
+               <?php endif; ?>
+               </div>
        </body>
 </html>