Exemple #1
0
// Searching controllers in Modules directory.
// Directory Scan function - script will include all .php files in the modules
// directory.
if (!is_dir(MODULE_PATH)) {
    die(_("ERROR: Modules directory not found!"));
}
$CurDir = dir(MODULE_PATH);
while (false !== ($entry = $CurDir->read())) {
    if ($entry != "." && $entry != "..") {
        if (substr($entry, strrpos($entry, '.')) == ".php") {
            require_once $CurDir->path . "/" . $entry;
        }
    }
}
try {
    // Validate and set the template of the site.
    gui::set_template_name(config::get("template_name", "gui"));
    // Looking for extra functions file in the template directory.
    if (is_file(TEMPLATE_PATH . config::get("template_name", "gui") . "/functions.php")) {
        include_once TEMPLATE_PATH . config::get("template_name", "gui") . "/functions.php";
    }
    // Find Controller name run it.
    gui::add_body(controller::set(uriparser::current()));
    // Validate and set the template filename with language settings.
    gui::set_template_file(config::get("controller"), config::get("lang"));
} catch (Exception $exc) {
    gui::add_body(gui::render_404($exc->getMessage()));
    //die(gui::render_404 ( _("Error. Page not found.")));
}
// Connecting of previosly finded template file.
include_once TEMPLATE_PATH . config::get("template_name", "gui") . "/" . config::get("template_file", "gui") . ".php";
 */
// Include PHP Gettext Emulator class.
require_once KERNEL_PATH . 'gettext/gettext.inc';
// Check default locale and language settings.
if (!config::get("lang")) {
    die("Default locale and language are not set.");
}
if (!config::get("lang_array")) {
    die("Please, setup Language array in your \r\n    configuration. Array('ru' => 'ru_RU', ...)");
}
// Check status of the multi-lingual mode.
if (config::get("multilang") == true) {
    // If multi-lingual mode is on - we will check, if the first URL parameter
    // is currect language parameter. So it must match to "/^(ru|en)$/u".
    $URLangMatch = "/^(" . implode("|", array_keys(config::get("lang_array"))) . ")\$/u";
    $URLang = uriparser::current();
    // If no language in first URL parameter - do redirect to currect URL.
    if (!$URLang || !preg_match($URLangMatch, $URLang)) {
        header("Location: " . HTTP_HOST . config::get("lang") . '/');
    }
    // Overwrite default locale and language settings.
    config::set("lang", $URLang);
}
/**
* Root path to all HTTP links in the script, including the selected
* language URL parameter.
*/
define('HTTP_BASE', HTTP_HOST . config::get("lang") . '/');
// Setting up localization and translation.
$lang = config::get("lang");
$locale = config::get("lang_array");
Exemple #3
0
?>
style.css" rel="stylesheet">

        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="container mainframe">
            <div class="row header">
                <div class="col-md-2 text-center">
                    <a href="<?php 
uriparser::link();
?>
"><img src="<?php 
gui::template_host();
?>
img/volgmed-herb.png" class="img-responsive"></a>
                </div>
                <div class="col-md-5">
                  <img src="<?php 
gui::template_host();
?>
img/volgmed-title-2.png" class="img-responsive">
                </div>
                <div class="col-md-5">
                </div>
            </div>
Exemple #4
0
            </li>
            <li>
                <img src="<?php 
gui::template_host();
?>
img/no-photo.jpg">
                <div class="overflow">
                    <div class="date-1">
                        <time datetime="2014-11-12 13:00:00">12.11.2014</time>
                        <span>Tempor incididunt ut labore et</span>
                    </div>
                    <p>Eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
                    <a href="#" class="btn btn-default">Читать далее</a>
                </div>
            </li>
        </ul>
        <a href="<?php 
uriparser::link("news/");
?>
" class="link-1">Просмотреть все новости</a>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <?php 
gui::body();
?>
    </div>
</div>
<?php 
include gui::template_path() . "footer.php";