示例#1
0
/**
 * 'Registers' a string in the translation system with a default value.
 * 
 * This is used in ScavixWDF when components require user-interaction without forcing the implementor to
 * create 100ths of strings as the first he must do.
 * @param string $constant Constant name
 * @param string $text The defauilt text
 * @return string The $constant value
 */
function default_string($constant, $text)
{
    cfg_set('translation', 'default_strings', $constant, $text);
    return $constant;
}
示例#2
0
文件: init.php 项目: alex-k/velotur
$DBCLASS = new DbMysqlLayer();
if ($_CONF[system_maintene] && strpos($_SERVER[REQUEST_URI], '/admin/') === false) {
    $smarty->display($_CONF[root_dir] . "public_html/templates/maintene.html");
    exit;
}
loadclass('Trips');
loadclass('Tours');
loadclass('Guides');
loadclass('Users');
loadclass('Partners');
session_start();
header("Cache-control: private");
if (!empty($_POST['formLoginSubmit'])) {
    $_SESSION['user'] = NULL;
}
if (isset($_POST['logout'])) {
    $_SESSION['user'] = NULL;
}
$user = $_SESSION['user'];
if (is_object($user) && $user->getID()) {
    $user = new Users($user->getID());
    $_SESSION['user'] = $user;
    $smarty->assign('User', $user->getValues());
}
require_once './vendor/phpbee/phpbee/libs/config.lib.php';
$init = new gs_init('auto');
cfg_set('tpl_data_dir', array(cfg('tpl_data_dir'), realpath(cfg('root_dir') . 'html')));
$init->init(LOAD_CORE | LOAD_STORAGE | LOAD_TEMPLATES | LOAD_EXTRAS);
cfg_set('init_data', $init->data);
cfg_set('www_dir', '');
示例#3
0
function register_less_variable($name, $value)
{
    global $CONFIG;
    $vars = cfg_getd('resources_less_variables', array());
    $vars[$name] = $value;
    cfg_set('resources_less_variables', $vars);
}
示例#4
0
mlog('1');
$init = new gs_init('auto');
cfg_set('tpl_data_dir', array(cfg('tpl_data_dir'), realpath(cfg('root_dir') . '../html')));
$init->init(LOAD_CORE);
$init->load_modules();
include_once 'classes/base.php';
include_once 'classes/Users_class.php';
include_once 'classes/Guides_class.php';
session_start();
if (stripos($_SERVER['REQUEST_URI'], '/admin') === 0) {
    if (isset($_SESSION['guide'])) {
        $guide = $_SESSION['guide'];
        $tpl = gs_tpl::get_instance();
        $tpl->assign('Guide', get_object_vars($guide));
    } else {
        header('Location: /admin/');
        exit;
    }
}
if (isset($_SESSION['user'])) {
    $myuser = $_SESSION['user'];
    $myuser = record_by_id($myuser->userID, 'tw_users');
    $smarty = gs_tpl::get_instance();
    $smarty->assign('User', $myuser);
}
$tpl = gs_tpl::get_instance();
$tplDir = realpath(getcwd() . '/html/') . '/';
$tpl->addTemplateDir($tplDir);
cfg_set('tpl_data_dir', $tplDir);
$o_h = new gs_parser($init->data);
$o_h->process();