Перенёс автолоад, убрал меню
This commit is contained in:
parent
77e535ce96
commit
d2dd7b9dd0
|
|
@ -1,5 +1,26 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
function __autoload($className)
|
||||||
|
{
|
||||||
|
$dirs = array('classes','models','controllers');
|
||||||
|
|
||||||
|
$loaded = flase;
|
||||||
|
foreach ($dirs as $dir) {
|
||||||
|
$fileName = dirname(__FILE__) . '/../ground/' . $dir. '/' . $className . '.php';
|
||||||
|
|
||||||
|
if (file_exists($fileName)){
|
||||||
|
$loaded = (bool) include $fileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$loaded){
|
||||||
|
App::error404 ('load class '.$className);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
class App
|
class App
|
||||||
{
|
{
|
||||||
private static $url = array();
|
private static $url = array();
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,6 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>WikiPoints</h1>
|
<h1>WikiPoints</h1>
|
||||||
<a href="/">Главная</a> |
|
|
||||||
<a href="/json/points/">Точки</a> |
|
|
||||||
<a href="/json/point/id/1">Выбранная точка</a> |
|
|
||||||
<a href="/json/categories/">Категории</a>
|
|
||||||
</div>
|
</div>
|
||||||
<?= isset($content) && !empty($content) ? $content : 'No content =(' ?>
|
<?= isset($content) && !empty($content) ? $content : 'No content =(' ?>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ body {margin: 0; padding: 0; height: 100%;}
|
||||||
div#map {width: 100%; height: 100%;}
|
div#map {width: 100%; height: 100%;}
|
||||||
div.infoCard {width: 400px;}
|
div.infoCard {width: 400px;}
|
||||||
div.infoCard img {width: 200px; float: left; margin: 0 10px 5px 0;}
|
div.infoCard img {width: 200px; float: left; margin: 0 10px 5px 0;}
|
||||||
div.header {display: block; position: absolute; top: 0; left: 115px; border-radius: 0 0 5px 5px; z-index: 1000; background-color: #FFF; padding: 5px 10px;}
|
div.header {display: block; position: absolute; top: 0; left: 110px; border-radius: 0 0 5px 5px; z-index: 1000; background-color: #FFF; padding: 5px 10px;}
|
||||||
div.header h1 {display: inline; margin-right: 25px; color: #555;}
|
div.header h1 {display: inline; color: #555;}
|
||||||
div.add {cursor: pointer;}
|
div.add {cursor: pointer;}
|
||||||
|
|
@ -1,28 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Поехали!
|
|
||||||
|
|
||||||
function __autoload($className)
|
|
||||||
{
|
|
||||||
$dirs = array('classes','models','controllers');
|
|
||||||
|
|
||||||
$loaded = flase;
|
|
||||||
foreach ($dirs as $dir) {
|
|
||||||
$fileName = dirname(__FILE__) . '/../ground/' . $dir. '/' . $className . '.php';
|
|
||||||
|
|
||||||
if (file_exists($fileName)){
|
|
||||||
$loaded = (bool) include $fileName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$loaded){
|
|
||||||
App::error404 ('load class '.$className);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
include_once dirname(__FILE__) . '/../ground/app.php';
|
include_once dirname(__FILE__) . '/../ground/app.php';
|
||||||
include_once dirname(__FILE__) . '/../ground/config.php';
|
include_once dirname(__FILE__) . '/../ground/config.php';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue