Exemple #1
0
 function _wd($domain, $string)
 {
     static $t;
     if (!$t) {
         $t = new waInstallerLocale();
     }
     return $t->_($string);
 }
Exemple #2
0
 function _wd($domain, $string)
 {
     $lang = isset($_POST['lang']) ? $_POST['lang'] : (isset($_GET['lang']) ? $_GET['lang'] : 'ru_RU');
     static $t;
     if (!$t) {
         $t = new waInstallerLocale($lang);
     }
     return $t->_($string);
 }
Exemple #3
0
/**
 * @param $stages
 * @param waInstallerLocale $t
 * @return string
 */
function parseLog($stages, &$t)
{
    $log = '';
    foreach ($stages as $info) {
        $info['datetime'] = date('D, H:i:s O', intval($info['stage_start_time']));
        $log .= <<<HTML
        <p><span>{$info['datetime']}</span> <span class="i-app-name">{$t->_($info['chunk_id'])}</span> {$t->_($info['stage_name'])}&nbsp;
HTML;
        if ($info['stage_status'] == 'heartbeat') {
            $stage_progress = isset($info['stage_progress']) ? sprintf('%d%%', $info['stage_progress']) : '';
            $log .= <<<HTML
            <i class="icon16 loading"></i><em class="in-progress">{$stage_progress}{$t->_($info['stage_status'])}</em>
HTML;
        } elseif ($info['stage_status'] == 'error') {
            $log .= <<<HTML
            <i class="icon10 no"></i> <em class="error">{$t->_($info['stage_status'])} {$info['error']}</em>
HTML;
        } else {
            $log .= <<<HTML
            <i class="icon10 yes"></i> <em class="success">{$t->_($info['stage_status'])}</em>
HTML;
        }
        $log .= <<<HTML
            </p>
HTML;
    }
    return $log;
}
Exemple #4
0
<br>
HTML;
            $extra = <<<HTML
<input type="hidden" value="0" name="check_latest">
HTML;
        } else {
            $extra = <<<HTML
<input type="hidden" value="1" name="check_latest">
HTML;
        }
        $locales = waInstallerLocale::listAvailable();
        $select_locale = '';
        if ($locales) {
            $select_locale .= '<br><select name="lang" id="wa-installer-locale-select">';
            foreach ($locales as $locale) {
                $t_item = new waInstallerLocale($locale);
                $selected = $locale == $lang ? ' selected="selected"' : '';
                $select_locale .= <<<HTML
<option value="{$locale}"{$selected}>{$t_item->_($locale)}</option>
HTML;
            }
            $select_locale .= '</select>';
        } else {
            $select_locale = <<<HTML
<input type="hidden" value="{$lang}" name="lang">
HTML;
        }
        $content = <<<HTML
<!-- welcome text -->
<div class="i-welcome">
\t<h1 class="i-url"><span>http://</span>{$host}</h1>