コード例 #1
0
ファイル: Config.php プロジェクト: Trim/movim
 function prepareConfigForm()
 {
     $view = $this->tpl();
     /* We load the user configuration */
     $this->user->reload();
     $view->assign('languages', loadLangArray());
     $view->assign('me', $this->user->getLogin());
     $view->assign('conf', $this->user->getConfig());
     $view->assign('submit', $this->call('ajaxSubmit', "movim_parse_form('general')") . "this.className='button color orange inactive oppose';\n                    this.onclick=null;");
     return $view->draw('_config_form', true);
 }
コード例 #2
0
ファイル: AdminMain.php プロジェクト: Trim/movim
 function display()
 {
     $cd = new \Modl\ConfigDAO();
     $config = $cd->get();
     $this->view->assign('conf', $cd->get());
     $this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files')));
     $this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>'));
     $json = requestURL(MOVIM_API . 'websockets', 1);
     $json = json_decode($json);
     if (isset($json) && $json->status != 404) {
         $this->view->assign('websockets', $json);
     }
     $this->view->assign('server_rewrite', false);
     if (isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) {
         $this->view->assign('server_rewrite', true);
     }
     $this->view->assign('timezones', getTimezoneList());
     $this->view->assign('langs', loadLangArray());
 }
コード例 #3
0
ファイル: mud.php プロジェクト: christine-ho-dev/movim
function comploc()
{
    echo colorize("Locales compiler\n", 'green');
    $folder = CACHE_PATH . '/locales/';
    if (!file_exists($folder)) {
        $bool = mkdir($folder);
        if (!$bool) {
            echo colorize("The locales cache folder can't be created", 'red');
            exit;
        }
    } else {
        echo colorize("Folder already exist, don't re-create it\n", 'red');
    }
    $langs = loadLangArray();
    foreach ($langs as $key => $value) {
        $langarr = parseLangFile(DOCUMENT_ROOT . '/locales/' . $key . '.po');
        $out = '<?php global $translations;
        $translations = array(';
        foreach ($langarr as $msgid => $msgstr) {
            if ($msgid != '') {
                $out .= '"' . $msgid . '" => "' . $msgstr . '",' . "\n";
            }
        }
        $out .= ');';
        $fp = fopen($folder . $key . '.php', 'w');
        fwrite($fp, $out);
        fclose($fp);
        echo "- {$key} compiled\n";
    }
}