Ejemplo n.º 1
0
function langA($name, $args)
{
    static $base = null;
    $value = Localization::instance()->lang($name);
    if (is_null($value)) {
        if (!Env::isDebugging()) {
            if (!$base instanceof Localization) {
                $base = new Localization();
                $base->loadSettings("en_us", ROOT . "/language");
            }
            $value = $base->lang($name);
        }
        if (is_null($value)) {
            $value = Localization::instance()->lang(str_replace(" ", "_", $name));
            if (is_null($value)) {
                $value = Localization::instance()->lang(str_replace("_", " ", $name));
                if (is_null($value)) {
                    return "Missing lang: {$name}";
                }
            }
        }
    }
    // We have args? Replace all {x} with arguments
    if (is_array($args) && count($args)) {
        $i = 0;
        foreach ($args as $arg) {
            $value = str_replace('{' . $i . '}', $arg, $value);
            $i++;
        }
        // foreach
    }
    // if
    // Done here...
    return $value;
}
Ejemplo n.º 2
0
if (!ini_get('session.auto_start') || strtolower(ini_get('session.auto_start')) == 'off') {
    if (!session_id()) {
        session_regenerate_id();
    }
    session_start();
    // Start the session
}
include_once ENVIRONMENT_PATH . '/classes/Env.class.php';
include_once ENVIRONMENT_PATH . '/constants.php';
include_once ENVIRONMENT_PATH . '/functions/utf.php';
include_once ENVIRONMENT_PATH . '/functions/general.php';
include_once ENVIRONMENT_PATH . '/functions/files.php';
// Remove slashes is magic quotes gpc is on from $_GET, $_POST and $_COOKIE
fix_input_quotes();
// Debug
if (Env::isDebugging()) {
    include_once ENVIRONMENT_PATH . '/classes/debug/BenchmarkTimer.class.php';
    benchmark_timer_start();
    benchmark_timer_set_marker('Init environment');
}
// if
// Include autoloader...
include ENVIRONMENT_PATH . '/classes/AutoLoader.class.php';
include ENVIRONMENT_PATH . '/classes/template/template.php';
include ENVIRONMENT_PATH . '/classes/flash/flash.php';
include ENVIRONMENT_PATH . '/classes/localization/localization.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger_Entry.class.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger_Session.class.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger_Backend.class.php';
include ENVIRONMENT_PATH . '/classes/logger/Logger.class.php';
include ENVIRONMENT_PATH . '/classes/logger/backend/Logger_Backend_File.class.php';
Ejemplo n.º 3
0
 /**
 * Returns product signature (name and version). If user is not logged in and
 * is not member of owner company he will see only product name
 *
 * @param void
 * @return string
 */
 function product_signature() {
   if (function_exists('logged_user') && (logged_user() instanceof User) && logged_user()->isMemberOfOwnerCompany()) {
     $result = lang('footer powered', 'http://www.projectpier.org/', clean(product_name()) . ' ' . product_version());
     if (Env::isDebugging()) {
       ob_start();
       benchmark_timer_display(false);
       $result .= '. ' . ob_get_clean();
       if (function_exists('memory_get_usage')) {
         $result .= '. ' . format_filesize(memory_get_usage());
       } // if
     } // if
     return $result;
   } else {
     return lang('footer powered', 'http://www.ProjectPier.org/', clean(product_name()));
   } // if
 } // product_signature
Ejemplo n.º 4
0
/**
 * Returns product signature (name and version). If user is not logged in and
 * is not member of owner company he will see only product name
 *
 * @param void
 * @return string
 */
function product_signature()
{
    if (function_exists('logged_user') && logged_user() instanceof Contact) {
        $result = lang('footer powered', clean(PRODUCT_URL), clean(product_name()) . ' ' . product_version());
        if (Env::isDebugging()) {
            ob_start();
            benchmark_timer_display(false);
            $result .= '. ' . ob_get_clean();
            if (function_exists('memory_get_usage')) {
                $result .= '. ' . format_filesize(memory_get_usage());
            }
            // if
        }
        // if
        return $result;
    } else {
        return lang('footer powered', clean(PRODUCT_URL), clean(product_name()));
    }
    // if
}