Esempio n. 1
0
    }
    //если запрошена главная страница админки - выводим ее шаблон
    if ($_SERVER['REQUEST_URI'] === '/admin/') {
        FileSys::includeFile(ADMIN_ROOT . '/templates/default/index.php');
    } else {
        $com = Request::get('com');
        if (!is_dir(ADMIN_ROOT . '/components/' . $com)) {
            Router::set404();
        }
        if (is_file(ADMIN_ROOT . '/components/' . $com . '/config.php')) {
            require_once ADMIN_ROOT . '/components/' . $com . '/config.php';
        }
        if (is_file(ADMIN_ROOT . '/components/' . $com . '/SectionController.php')) {
            Load::controller(ADMIN_ROOT . '/components/' . $com . '/SectionController.php', Request::get('section', false));
        } else {
            $com_dirs = FileSys::getDirs(ADMIN_ROOT . '/components/' . $com);
            $forbidden_dir = ['client'];
            $section = Request::get('section');
            if (in_array($section, $com_dirs) && !in_array($section, $forbidden_dir)) {
                Load::manager(ADMIN_ROOT . '/components/' . $com . '/' . $section . '/' . toCamelCase($section) . 'Manager.php');
            } else {
                Router::set404();
            }
        }
    }
} catch (SystemException $e) {
    header('HTTP/1.0 500 Internal Server Error');
    echo $e->getError();
} catch (ValidatorException $e) {
    header('HTTP/1.0 400 Bad Request');
    echo $e->getError();
Esempio n. 2
0
<!DOCTYPE html>
<html>
<head lang="ru">
	<meta charset="UTF-8">
	<script src="/client/js/jquery/jquery-1.11.3.min.js" type="text/javascript"></script>
	<script src="/client/js/jquery/polyfills.js" type="text/javascript"></script>
	<script src="/client/js/site_config.js" type="text/javascript"></script>

	<?php 
foreach (FileSys::getDirs(SITE_ROOT . '/client/js/jquery_plugins') as $plugin) {
    ?>
		<script type="text/javascript" src="/client/js/jquery_plugins/<?php 
    echo $plugin;
    ?>
/<?php 
    echo $plugin;
    ?>
.js"></script>
	    <?php 
    if (is_readable(SITE_ROOT . '/client/js/jquery_plugins/' . $plugin . '/' . $plugin . '.css')) {
        ?>
	        <link rel="stylesheet" type="text/css" href="/client/js/jquery_plugins/<?php 
        echo $plugin;
        ?>
/<?php 
        echo $plugin;
        ?>
.css">
	    <?php 
    }
    ?>