예제 #1
0
파일: Locale.php 프로젝트: vijo/movim
 /**
  * @desc Return an array containing all the presents languages in i18n
  */
 public function getList()
 {
     require_once 'languages.php';
     $lang_list = get_lang_list();
     $dir = scandir(LOCALES_PATH);
     $po = array();
     foreach ($dir as $files) {
         $explode = explode('.', $files);
         if (end($explode) == 'po') {
             $po[$explode[0]] = $lang_list[$explode[0]];
         }
     }
     return $po;
 }
예제 #2
0
파일: Locale.php 프로젝트: Anon215/movim
 /**
  * @desc Return an array containing all the presents languages in i18n
  */
 public function getList()
 {
     require_once 'languages.php';
     $lang_list = get_lang_list();
     $dir = scandir(LOCALES_PATH);
     $po = [];
     foreach ($dir as $files) {
         $explode = explode('.', $files);
         if (end($explode) == 'po' && array_key_exists($explode[0], $lang_list)) {
             $po[$explode[0]] = $lang_list[$explode[0]];
         }
     }
     $po['en'] = 'English';
     return $po;
 }
        $cfg["lang"] = "english.php";
    }
    if (!eregi("^[0-9]+\$", $cfg["entry_pp"]) || $cfg["entry_pp"] == 0) {
        $cfg["entry_pp"] = 1;
    }
    $CLASS["db_input"] = new input2db();
    $result = $CLASS["db_input"]->update_db_row($POLLTBL["poll_config"], $cfg, "config_id", 1);
    if ($result) {
        $pollvars = $CLASS["db"]->fetch_array($CLASS["db"]->query("SELECT * FROM {$POLLTBL['poll_config']}"));
        $pollvars['SELF'] = basename($PHP_SELF);
        $CLASS["db"]->free_result($CLASS["db"]->result);
        unset($lang);
        include "../lang/{$pollvars['lang']}";
        $message = $lang["Updated"];
    } else {
        $message = $lang["NoUpdate"];
    }
}
$CLASS["template"]->set_templatefiles(array("admin_settings" => "admin_settings.html"));
$pollvars = addspecialchars($pollvars);
$langlist = get_lang_list("../lang");
$check_ip = $pollvars["check_ip"] == 0 ? "selected" : "";
$no_ip_check = $pollvars["check_ip"] == 2 ? "selected" : "";
$votes = $pollvars["type"] == "votes" ? "checked" : "";
$percent = $pollvars["type"] == "percent" ? "checked" : "";
$order_usort = $pollvars["result_order"] == "usort" ? "selected" : "";
$order_asc = $pollvars["result_order"] == "asc" ? "selected" : "";
$order_desc = $pollvars["result_order"] == "desc" ? "selected" : "";
$admin_settings = $CLASS["template"]->pre_parse("admin_settings");
no_cache_header();
eval("echo \"{$admin_settings}\";");
예제 #4
0
 /**
  *
  * @param string $str The value to validate
  * @param string $class Class name which will search with
  * @param string $method Class method to search with
  * @param string $idFieldName The identity field in the table
  * @param string $idFieldValue The value of identity field 
  * @param bool $isStatic To determine if the $method is a static function or not
  * @return int 
  */
 public function unique_multi($str, $class, $field)
 {
     if ($str == '') {
         return true;
     }
     foreach (get_lang_list() as $key => $lang) {
         if (strlen(array_shift(explode('_' . $key, $field))) < strlen($field)) {
             $field = array_shift(explode('_' . $key, $field));
             break;
         }
     }
     if (preg_match('/\\(/', $class)) {
         $exp = explode('(', trim($class, ')'));
         $model = $exp[0] . 'Table';
         $obj = $model::getOneBy($field, $str);
         if ($obj && $obj['id'] != $exp[1]) {
             return false;
         }
     } else {
         $model = $class . 'Table';
         $obj = $model::getOneBy($field, $str);
         if ($obj && $obj[$field] == $str) {
             return false;
         }
     }
     return true;
 }
예제 #5
0
파일: i18n.php 프로젝트: ajira86/movim
/**
 * Return an array containing all the presents languages in i18n/
 *
 */
function loadLangArray()
{
    $lang_list = get_lang_list();
    $dir = scandir(LOCALES_PATH);
    $po = array();
    foreach ($dir as $files) {
        $explode = explode('.', $files);
        if (end($explode) == 'po') {
            $po[$explode[0]] = $lang_list[$explode[0]];
        }
    }
    return $po;
}
function get_langs_data_js()
{
    $arr_langs = get_lang_list();
    foreach ($arr_langs as $k => $v) {
        $arr_data[] = '{id:"' . $k . '", text:"' . $v . '"}';
    }
    $js_langs_data = '{' . 'text:"", children:[' . implode(',', $arr_data) . ']}';
    return $js_langs_data;
}