Esempio n. 1
0
{
    return \ICanBoogie\I18n\t($str, $args, $options);
}
#
# patches
#
\Brickrouge\Helpers::patch('render_exception', 'ICanBoogie\\Debug::format_alert');
\Brickrouge\Helpers::patch('t', __NAMESPACE__ . '\\t');
#
# application
#
$core = new \Icybee\Core(array('config paths' => array(__DIR__, \Icybee\DIR), 'locale paths' => array(__DIR__, \Icybee\DIR), 'modules paths' => array(\Icybee\DIR . 'modules' . DIRECTORY_SEPARATOR, \ICanBoogie\Modules\DIR)));
$_SERVER['ICANBOOGIE_READY_TIME_FLOAT'] = microtime(true);
#
# session
#
$core->session = \ICanBoogie\Session::get_session($core);
#
# language
#
if (isset($_GET['hl'])) {
    $core->session->install['locale'] = $_GET['hl'];
}
if (isset($core->session->install['locale'])) {
    $core->locale = $core->session->install['locale'];
}
#
# document
#
$core->document = \Brickrouge\get_document();
Esempio n. 2
0
 /**
  * JavaScript assets can be collected and rendered into `SCRIPT` elements with the `p:document:js`
  * element. The `href` attribute is used to add an asset to the collection. The `weight`
  * attribute specifies the weight of that asset. If the `weight` attribute is not specified,
  * the weight of the asset is defaulted to 100. If the `href` attribute is not specified,
  * the assets are rendered. If a template is specified the collection is passed as `this`,
  * otherwise the collection is rendered into an HTML string of `SCRIPT` elements.
  *
  * <pre>
  * <p:document:js
  *     href = string
  *     weight = int>
  *     <!-- Content: p:with-params, template? -->
  * </p:document:js>
  * </pre>
  *
  * Example:
  *
  * <pre>
  * <p:document:js href="/public/page.js" />
  * <p:document:js href="/public/reset.js" weight="-100" />
  * <p:document:js />
  * </pre>
  *
  * will produce:
  *
  * <pre>
  * <script src="/public/reset.css" type="text/javascript"></script>
  * <script src="/public/page.css" type="text/javascript"></script>
  * </pre>
  *
  * @param array $args
  * @param Engine $engine
  * @param mixed $template
  *
  * @return void|string
  */
 public static function markup_document_js(array $args, Engine $engine, $template)
 {
     $document = \Brickrouge\get_document();
     if (isset($args['href'])) {
         $document->js->add($args['href'], $args['weight'], dirname($engine->get_file()));
         return null;
     }
     return $template ? $engine($template, $document->js) : (string) $document->js;
 }