Exemplo n.º 1
0
<?php

use Glial\I18n\I18n;
use Glial\Synapse\FactoryController;
echo "<!DOCTYPE html>\n";
echo "<html lang=\"" . I18n::Get() . "\">";
echo "<head>\n";
echo "<!--\n";
echo SITE_LOGO;
echo "Powered by Esysteme (www.esysteme.com)\n";
echo "-->";
echo "<meta charset=utf-8 />\n";
echo "<meta name=\"Keywords\" content=\"\" />\n";
echo "<meta name=\"Description\" content=\"\" />\n";
echo "<meta name=\"Author\" content=\"Aurelien LEQUOY\" />\n";
echo "<meta name=\"robots\" content=\"index,follow,all\" />\n";
echo "<meta name=\"generator\" content=\"GLIALE 1.1\" />\n";
echo "<meta name=\"runtime\" content=\"[PAGE_GENERATION]\" />\n";
echo "<link rel=\"shortcut icon\" href=\"favicon.ico\" />";
echo "<title>" . strip_tags($GLIALE_TITLE) . " - " . SITE_NAME . " " . SITE_VERSION . "</title>\n";
?>
<link href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAABdFBMVEUAAABDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMdDhMeYweDeAAAAe3RSTlMAAQIDBAUGBwgJCgsNDg8QERITFxgaHB4gISIjJSYnKCksLS4vMTIzNTY3ODk7PD0+QEFCR0lMTVFSVFZZW11hYmNna2xtb3B0dXd4fIKDiYuOj5KVnZ6goqWoqq2wtbq+wMHDxcfI0dPV2drc3uTm6Ovt7/Hz9ff5+/0KBW49AAABeUlEQVQYGXXBC1sSURQF0H1nREEJAjPMNM0hNCWzBMwkzd4lVqb2kMpKBPMJoiXuP+8cBpEP5q4Fx5WpjwVeKmXnehUujefZ6uSVF46OTbo7HUfVd2oFIKg3DEE9C+KYWgMQs9TZNlA1eURXyx7UGPF1NttZCKAmCpvRM7Gw+nu7WCnv5rPvUoM+2LxXIfjzloIL/8tTC4JkeWk0ZKJB5425HEkLokTH4bcPi8/S86+XVvNndPRDJKmzpVAVO6CrjIkaFft8xiaFJ12oicOmuuPzK78KxUp5d2v9TbK/A7ZACIL7j4No1Rb9SguCttJKerTH5zEUoMz20FDybZ42C2KHWhGIyH9qvIfDm6nQxZ8h1JnRzF82OvmSCuLCjzCE0RUZuZ+YmX44NhhqgzDTtyHIbMyDFt0vjmlBUOQWEzf97aYCDI/v2tjTtX+0DUNsUCsM4d+jxiM4jPQRXayFUaf6nufYqPhpwosmynf9zr3ETOrB3YGgibpzl+IgDrtTZxkAAAAASUVORK5CYII=" rel="icon" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="<?php 
echo CSS;
?>
bootstrap.css">
<link rel="stylesheet" type="text/css" href="<?php 
echo CSS;
?>
autocomplete.css" />
<link rel="stylesheet" type="text/css" href="<?php 
Exemplo n.º 2
0
Arquivo: I18n.php Projeto: glial/glial
 function __($text, $lgfrom = "auto")
 {
     //return $text;
     if ($lgfrom === "auto") {
         $lgfrom = I18n::GetDefault();
     }
     $calledFrom = debug_backtrace();
     //return "<span id=\"".sha1($text)."\" lang=\"".$_LG->Get()."\">".$_LG->_($text,$lgfrom,$calledFrom[0]['file'],$calledFrom[0]['line'])."</span>";
     $file = str_replace(ROOT . "/", '', $calledFrom[0]['file']);
     $var = I18n::_($text, $lgfrom, $file, $calledFrom[0]['line']);
     //debug(I18n::$_translations);
     if (preg_match_all('#\\[(\\w+)]#', $var, $m)) {
         //print_r( $m );
     }
     if (count($m[1]) > 0) {
         $replace_with = array();
         foreach ($m[1] as $species) {
             $scientific_name = str_replace("_", " ", $species);
             $sql = "SELECT b.text \r\n\t\t\t\tFROM species_main a\r\n\t\t\t\tinner JOIN scientific_name_translation b ON a.id = b.id_species_main AND b.id_species_sub = 0 and b.is_valid=1\r\n\t\t\t\tINNER JOIN language c ON c.iso3 = b.language AND c.iso = '" . I18n::Get() . "'\r\n\t\t\twhere a.scientific_name ='" . $scientific_name . "'";
             $res = I18n::getDb()->sql(I18n::DATABASE)->sql_query($sql);
             if (I18n::getDb()->sql(I18n::DATABASE)->sql_num_rows($res) == 1) {
                 $ob = I18n::getDb()->sql(I18n::DATABASE)->sql_fetch_object($res);
                 $replace_with[] = $ob->text . " (" . $scientific_name . ")";
             } else {
                 $replace_with[] = $scientific_name;
             }
         }
         $var = str_replace($m[0], $replace_with, $var);
     }
     return $var;
 }
Exemplo n.º 3
0
        $_SYSTEM['param'] = !empty($_SERVER["argv"][3]) ? $_SERVER["argv"][3] : '';
        if ($_SERVER["argc"] > 3) {
            $params = array();
            for ($i = 3; $i < $_SERVER["argc"]; $i++) {
                $params[] = $_SERVER["argv"][$i];
            }
            $_SYSTEM['param'] = $params;
        }
        //cli_set_process_title("glial-" . $_SYSTEM['controller'] . "-" . $_SYSTEM['action']." (".$name.")");
    } else {
        throw new InvalidArgumentException('usage : gial <controlleur> <action> [params]');
    }
    define('LINK', WWW_ROOT . "en" . "/");
} else {
    //mode with apache
    define('LINK', WWW_ROOT . I18n::Get() . "/");
    if (AUTH_ACTIVE) {
        $auth = new Auth();
        $auth->setInstance($_DB->sql(DB_DEFAULT), "user_main", array("login", "password"));
        $auth->setFctToHashCookie(function ($password) {
            return password_hash($password . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR'], PASSWORD_DEFAULT);
        });
        $auth->authenticate(false);
        FactoryController::addDi("auth", $auth);
    }
    ENVIRONEMENT ? $_DEBUG->save("User connexion") : "";
    $_SYSTEM['controller'] = \Glial\Utility\Inflector::camelize($url['controller']);
    $_SYSTEM['action'] = $url['action'];
    $_SYSTEM['param'] = $url['param'];
    $acl = new Acl(CONFIG . "acl.config.ini");
    FactoryController::addDi("acl", $acl);