Перенёс автолоад, убрал меню

This commit is contained in:
Krivchikov Dmitry 2014-04-03 16:55:54 +04:00
parent 77e535ce96
commit d2dd7b9dd0
4 changed files with 27 additions and 33 deletions

View File

@ -1,5 +1,26 @@
<?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
{
private static $url = array();

View File

@ -19,10 +19,6 @@
<body>
<div class="header">
<h1>WikiPoints</h1>
<a href="/">Главная</a> |
<a href="/json/points/">Точки</a> |
<a href="/json/point/id/1">Выбранная точка</a> |
<a href="/json/categories/">Категории</a>
</div>
<?= isset($content) && !empty($content) ? $content : 'No content =(' ?>
</body>

View File

@ -11,6 +11,6 @@ body {margin: 0; padding: 0; height: 100%;}
div#map {width: 100%; height: 100%;}
div.infoCard {width: 400px;}
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 h1 {display: inline; margin-right: 25px; color: #555;}
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; color: #555;}
div.add {cursor: pointer;}

View File

@ -1,28 +1,5 @@
<?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/config.php';