Example #1
0
 public function testStrftime()
 {
     $oldLocale = rex_i18n::getLocale();
     rex_i18n::setLocale('en_gb');
     $value = 1336811080;
     $format = '%d.%m.%Y %H:%M';
     $this->assertEquals('12.05.2012 10:24', rex_formatter::strftime($value, $format));
     $format = 'date';
     $this->assertEquals('2012-May-12', rex_formatter::strftime($value, $format));
     $format = 'datetime';
     $this->assertEquals('2012-May-12 10:24', rex_formatter::strftime($value, $format));
     rex_i18n::setLocale($oldLocale);
 }
Example #2
0
<?php

/**
 * @package redaxo5
 */
// --------------------------------------------- END: SETUP FUNCTIONS
$step = rex_request('step', 'int', 1);
$send = rex_request('send', 'string');
$createdb = rex_request('createdb', 'string');
$noadmin = rex_request('noadmin', 'string');
$lang = rex_request('lang', 'string');
// ---------------------------------- Step 1 . Language
if ($step == 1) {
    rex_setup::init();
    $saveLocale = rex_i18n::getLocale();
    $langs = [];
    foreach (rex_i18n::getLocales() as $locale) {
        rex_i18n::setLocale($locale, false);
        // Locale nicht neu setzen
        $label = rex_i18n::msg('lang');
        $langs[$locale] = '<a class="list-group-item" href="' . rex_url::backendPage('setup', ['step' => 2, 'lang' => $locale]) . '">' . $label . '</a>';
    }
    rex_i18n::setLocale($saveLocale, false);
    echo rex_view::title(rex_i18n::msg('setup_100'));
    $content = '<div class="list-group">' . implode('', $langs) . '</div>';
    $fragment = new rex_fragment();
    $fragment->setVar('heading', rex_i18n::msg('setup_101'), false);
    $fragment->setVar('content', $content, false);
    echo $fragment->parse('core/page/section.php');
}
// ---------------------------------- Step 2 . license