• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP set_language函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中set_language函数的典型用法代码示例。如果您正苦于以下问题:PHP set_language函数的具体用法?PHP set_language怎么用?PHP set_language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了set_language函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: print_field

    public function print_field($field, $data, $object)
    {
        if (isset($data->id)) {
            $slugs = self::get_slugs($field, $data, $object);
            if (isset($field['format'])) {
                $format = strval($field['format']);
            } else {
                $format = '[slug]';
            }
            if (count($slugs)) {
                ?>
			   <div class="input">			 
					<label<?php 
                echo isset($field['invalid']) && $field['invalid'] ? ' class="invalid"' : '';
                ?>
><?php 
                echo isset($field['label']) ? $field['label'] : ucwords(preg_replace("/[^\\w-]+/i", " ", $field['name']));
                ?>
</label> 
					<fieldset>
					<?php 
                foreach ($slugs as $language => $slug) {
                    if (!is_string($language)) {
                        $language = $object_language;
                    }
                    set_language($language);
                    $url = str_replace('[slug]', $slug, $format);
                    $url = url(str_replace('[id]', $data->id, $url));
                    ?>
						<div><a class="button thin" href="<?php 
                    echo $url;
                    ?>
" target="_blank"><?php 
                    echo $url;
                    ?>
</a></div>
					<?php 
                }
                $languages = array_keys(languages());
                set_language(reset($languages));
                ?>
					</fieldset>
			   </div>
		    <?php 
            }
        }
    }
开发者ID:kidaa30,项目名称:Swevers,代码行数:47,代码来源:link.php


示例2: multilingual_addon_import

function multilingual_addon_import($post_id, $data, $import_options, $articleData)
{
    global $multilingual_import_addon;
    $language = $data['multilingual_import_language'];
    $common_id = $data['multilingual_import_common_id'];
    if ($multilingual_import_addon->can_update_meta('_multilingual_entry_language', $import_options)) {
        echo 'Updating META';
        update_post_meta($post_id, '_multilingual_entry_language', $language);
    }
    if ($multilingual_import_addon->can_update_meta('_multilingual_entry_common_id', $import_options)) {
        update_post_meta($post_id, '_multilingual_entry_common_id', $common_id);
    }
    set_language($post_id, $language, $common_id, $articleData['post_name']);
    // TODO Save current language and restore it at the end of the entry import...
    //$current_language = $sitepress->get_current_language();
    global $sitepress;
    // We do this so taxonomies are imported in their correct language.
    $sitepress->switch_lang($language);
}
开发者ID:resulto-admin,项目名称:wordpress-multilingual-import,代码行数:19,代码来源:wp-multilingual-import.php


示例3: array

 $inputData = array("localeset" => form_sanitizer($_POST['localeset'], fusion_get_settings('locale'), "localeset"), "old_localeset" => form_sanitizer($_POST['old_localeset'], fusion_get_settings('locale'), "old_localeset"), "enabled_languages" => isset($_POST['enabled_languages']) ? form_sanitizer($_POST['enabled_languages'], "", "enabled_languages") : fusion_get_settings('locale'), "old_enabled_languages" => form_sanitizer($_POST['old_enabled_languages'], "", "old_enabled_languages"));
 // format both to .
 if (empty($inputData['enabled_languages'])) {
     $defender->stop();
     addNotice("danger", "You need to enable at least one language");
 }
 if (defender::safe()) {
     $inArray_SQLCond = array("enabled_languages" => str_replace(".", "','", $inputData['enabled_languages']), "old_enabled_languages" => str_replace(".", "','", $inputData['old_enabled_languages']));
     $core_SQLVal = array("enabled_languages" => str_replace(",", ".", $inputData['enabled_languages']), "old_enabled_languages" => str_replace(",", ".", $inputData['old_enabled_languages']));
     $array = array("old_enabled_languages" => explode(".", $inputData['old_enabled_languages']), "enabled_languages" => explode(",", $inputData['enabled_languages']));
     // update current system locale
     dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . $inputData['localeset'] . "' WHERE settings_name='locale'");
     // update on the new system locale.
     // Switch visible language to localeset
     if ($inputData['old_localeset'] !== $inputData['localeset']) {
         set_language($inputData['localeset']);
     }
     /**
      * Part II : Insert and Purge actions when add or drop languages
      */
     if ($inputData['old_enabled_languages'] != $inputData['enabled_languages']) {
         // language family have changed
         $added_language = array_diff($array['enabled_languages'], $array['old_enabled_languages']);
         $removed_language = array_diff($array['old_enabled_languages'], $array['enabled_languages']);
         dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . $core_SQLVal['enabled_languages'] . "' WHERE settings_name='enabled_languages'");
         dbquery("UPDATE " . DB_PANELS . " SET panel_languages='" . $core_SQLVal['enabled_languages'] . "'");
         dbquery("UPDATE " . DB_USERS . " SET user_language='Default' WHERE user_language NOT IN ('" . $inArray_SQLCond['enabled_languages'] . "')");
         if (!empty($added_language)) {
             foreach ($added_language as $language) {
                 /**
                  * Email templates
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:settings_languages.php


示例4: die

if (file_exists($outputfile)) {
    ?>
	<div id="errorheader"><?php 
    echo $lang["setup-alreadyconfigured"];
    ?>
</div> 
</body>
</html>
<?php 
    die(0);
}
if (!isset($_REQUEST['submit'])) {
    //No Form Submission, lets setup some defaults
    if (!isset($storagedir) | $storagedir == "") {
        $storagedir = dirname(__FILE__) . "/../filestore";
        $lang = set_language($defaultlanguage);
        # Updates $lang with $storagedir which is used in some strings.
    }
    if (isset($_SERVER['HTTP_HOST'])) {
        $baseurl = 'http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 16);
    } else {
        $baseurl = 'http://' . php_uname('n');
    }
    //Set the baseurl to the machine hostname.
    //Generate default random keys.
    $scramble_key = generatePassword();
    $spider_password = generatePassword();
    $api_scramble_key = generatePassword();
    //Setup search paths (Currently only Linux/Mac OS X)
    $os = php_uname('s');
    if ($os == 'Linux' || $os == "Darwin") {
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:setup.php


示例5: connexion_empr

function connexion_empr()
{
    global $dbh, $msg, $opac_duration_session_auth;
    global $time_expired, $erreur_session, $login, $password;
    global $auth_ok, $lang, $code, $emprlogin;
    global $first_log;
    global $erreur_connexion;
    global $opac_opac_view_activate, $pmb_opac_view_class, $opac_view_class;
    global $opac_default_style;
    //a positionner si authentification exterieure
    global $ext_auth, $empty_pwd;
    global $base_path, $class_path;
    global $cms_build_activate;
    //a positionner si les vues OPAC sont activées
    global $include_path;
    $erreur_connexion = 0;
    $log_ok = 0;
    if (!$_SESSION["user_code"]) {
        if (!get_magic_quotes_gpc()) {
            $p_login = addslashes($_POST['login']);
        } else {
            $p_login = $_POST['login'];
        }
        if ($time_expired == 0) {
            // début if ($time_expired==0) 1
            //Si pas de session en cours, vérification du login
            $verif_query = "SELECT id_empr, empr_cb, empr_nom, empr_prenom, empr_password, empr_lang, empr_date_expiration<sysdate() as isexp, empr_login, empr_ldap,empr_location, allow_opac \n\t\t\t\t\tFROM empr\n\t\t\t\t\tJOIN empr_statut ON empr_statut=idstatut\n\t\t\t\t\tWHERE empr_login='" . ($emprlogin ? $emprlogin : $p_login) . "'";
            $verif_result = mysql_query($verif_query);
            // récupération des valeurs MySQL du lecteur et injection dans les variables
            while ($verif_line = mysql_fetch_array($verif_result)) {
                $verif_empr_cb = $verif_line['empr_cb'];
                $verif_empr_login = $verif_line['empr_login'];
                $verif_empr_ldap = $verif_line['empr_ldap'];
                $verif_empr_password = $verif_line['empr_password'];
                $verif_lang = $verif_line['empr_lang'] ? $verif_line['empr_lang'] : "fr_FR";
                $verif_id_empr = $verif_line['id_empr'];
                $verif_isexp = $verif_line['isexp'];
                $verif_opac = $verif_line['allow_opac'];
                $empr_location = $verif_line['empr_location'];
            }
            $auth_ok = 0;
            if ($verif_opac) {
                if ($ext_auth) {
                    $auth_ok = $ext_auth;
                } elseif ($code) {
                    $auth_ok = connexion_auto();
                } elseif ($verif_empr_ldap) {
                    $auth_ok = auth_ldap($p_login, $password);
                } else {
                    $auth_ok = ($empty_pwd || !$empty_pwd && $verif_empr_password) && $verif_empr_password == stripslashes($password) && $verif_empr_login != "";
                }
                //auth standard
            }
            if ($auth_ok) {
                // début if ($auth_ok) 1
                //Si mot de passe correct, enregistrement dans la session de l'utilisateur
                $log_ok = 1;
                if ($_SESSION["cms_build_activate"]) {
                    $cms_build_activate = 1;
                }
                if ($_SESSION["build_id_version"]) {
                    $build_id_version = $_SESSION["build_id_version"];
                }
                //Récupération de l'environnement précédent
                $requete = "select session from opac_sessions where empr_id=" . $verif_id_empr;
                $res_session = mysql_query($requete);
                if (@mysql_num_rows($res_session)) {
                    $temp_session = unserialize(mysql_result($res_session, 0, 0));
                    $_SESSION = $temp_session;
                } else {
                    $_SESSION = array();
                }
                $_SESSION["cms_build_activate"] = $cms_build_activate;
                $_SESSION["build_id_version"] = $build_id_version;
                if (!$code) {
                    $_SESSION["connexion_empr_auto"] = 0;
                }
                $_SESSION["user_code"] = $verif_empr_login;
                $_SESSION["id_empr_session"] = $verif_id_empr;
                $_SESSION["connect_time"] = time();
                $_SESSION["lang"] = $verif_lang;
                $_SESSION["empr_location"] = $empr_location;
                $req = "select location_libelle from docs_location where idlocation='" . $_SESSION["empr_location"] . "'";
                $_SESSION["empr_location_libelle"] = mysql_result(mysql_query($req, $dbh), 0, 0);
                // change language and charset after login
                $lang = $_SESSION["lang"];
                set_language($lang);
                if (!$verif_isexp) {
                    recupere_pref_droits($_SESSION["user_code"]);
                    $_SESSION["user_expired"] = $verif_isexp;
                } else {
                    recupere_pref_droits($_SESSION["user_code"], 1);
                    $_SESSION["user_expired"] = $verif_isexp;
                    echo "<script>alert(\"" . $msg["empr_expire"] . "\");</script>";
                    $erreur_connexion = 1;
                }
                if ($opac_opac_view_activate) {
                    $_SESSION["opac_view"] = 0;
                    $_SESSION['opac_view_query'] = 0;
                    if (!$pmb_opac_view_class) {
//.........这里部分代码省略.........
开发者ID:bouchra012,项目名称:PMB,代码行数:101,代码来源:empr_func.inc.php


示例6: preg_replace

 $_POST['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $_POST['timeservers']);
 $_POST['timeservers'] = trim($_POST['timeservers']);
 foreach (explode(' ', $_POST['timeservers']) as $ts) {
     if (!is_domain($ts)) {
         $input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
     }
 }
 if (!$input_errors) {
     update_if_changed("hostname", $config['system']['hostname'], $_POST['hostname']);
     update_if_changed("domain", $config['system']['domain'], $_POST['domain']);
     update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
     update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
     update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
     if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
         $config['system']['language'] = $_POST['language'];
         set_language($config['system']['language']);
     }
     /* pfSense themes */
     if (!$g['disablethemeselection']) {
         update_if_changed("System Theme", $config['theme'], $_POST['theme']);
     }
     /* XXX - billm: these still need updating after figuring out how to check if they actually changed */
     $olddnsservers = $config['system']['dnsserver'];
     unset($config['system']['dnsserver']);
     if ($_POST['dns1']) {
         $config['system']['dnsserver'][] = $_POST['dns1'];
     }
     if ($_POST['dns2']) {
         $config['system']['dnsserver'][] = $_POST['dns2'];
     }
     if ($_POST['dns3']) {
开发者ID:OptimWIFI,项目名称:pfsense,代码行数:31,代码来源:system.php


示例7: die

// $Id: localisation.inc.php,v 1.13 2007-03-10 10:05:50 touraine37 Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
if (!defined('LOCALISATION_INC')) {
    define('LOCALISATION_INC', 1);
    // récupération classe de gestion de fichier XML
    require_once $base_path . '/classes/XMLlist.class.php';
    // variables
    $msg = "";
    if (!$lang) {
        $lang = $opac_default_lang;
    }
    if ($lang == "ar") {
        $fichier = "./styles/" . $css . "rtl/" . $css . "rtl.css";
        if (@fopen($fichier, "r")) {
            $css = $css . "rtl";
        }
    }
    function set_language($lang)
    {
        global $msg;
        global $base_path;
        $messages = new XMLlist($base_path . "/includes/messages/{$lang}.xml", 0);
        $messages->analyser();
        $msg = $messages->table;
    }
    // localisation
    set_language($lang);
}
// fin de définition de LOCALISATION_INC
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:localisation.inc.php


示例8: ob_start

/**
 * This is the User Control Panel Object.
 *
 * License for all code of this FreePBX module can be found in the license file inside the module directory
 * Copyright 2006-2014 Schmooze Com Inc.
 */
ob_start();
$bootstrap_settings = array();
$bootstrap_settings['freepbx_auth'] = false;
//TODO: We need to make sure security is 100%!
$restrict_mods = true;
//Set to true so that we just load framework and the page wont bomb out because we have no session
if (!@(include_once getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
    include_once '/etc/asterisk/freepbx.conf';
}
$lang = function_exists('set_language') ? set_language() : 'en_US';
include dirname(__FILE__) . '/includes/bootstrap.php';
try {
    $ucp = \UCP\UCP::create();
    $ucp->Modgettext->textdomain("ucp");
} catch (\Exception $e) {
    if (isset($_REQUEST['quietmode'])) {
        echo json_encode(array("status" => false, "message" => "UCP is disabled"));
    } else {
        echo "<html><head><title>UCP</title></head><body style='background-color: rgb(211, 234, 255);'><div style='border-radius: 5px;border: 1px solid black;text-align: center;padding: 5px;width: 90%;margin: auto;left: 0px;right: 0px;background-color: rgba(53, 77, 255, 0.18);'>" . _('UCP is currently disabled. Please talk to your system Administrator') . "</div></body></html>";
    }
    die;
}
ob_end_clean();
$user = $ucp->User->getUser();
if (isset($_REQUEST['logout']) && $user) {
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:31,代码来源:index.php


示例9: dirname



	//Check if config file already exists and die with an error if it does.
	if (file_exists($outputfile)){
?>
	<div id="errorheader"><?php echo $lang["setup-alreadyconfigured"];?></div> 
</body>
</html>
<?php
	die(0);
	}
	if (!(isset($_REQUEST['submit']))){ //No Form Submission, lets setup some defaults
		if (!isset($storagedir) | $storagedir=="")
			{
			$storagedir = dirname(__FILE__)."/../filestore";
			$lang = set_language($defaultlanguage); # Updates $lang with $storagedir which is used in some strings.
			}
		if (isset($_SERVER['HTTP_HOST']))
			$baseurl = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-16);
		else
			$baseurl = 'http://'.php_uname('n'); //Set the baseurl to the machine hostname. 

		//Generate default random keys.
		$scramble_key = generatePassword();
		$spider_password = generatePassword();
        $api_scramble_key = generatePassword();
		//Setup search paths (Currently only Linux/Mac OS X)
		$os=php_uname('s');
		if($os=='Linux' || $os=="Darwin"){
			$search_paths[]='/usr/bin';
			$search_paths[]='/sw/bin';
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:29,代码来源:setup.php


示例10: configurations

function configurations()
{
    return array('title' => 'Some name', 'lang' => set_language(), 'style' => 'styles/style.css', 'scripts' => array('js/jquery-1.8.1.min.js', 'js/awesome.js'), 'mailheader' => '[SSome header]', 'domaine' => 'some-domaine.com', 'sub-domaine' => 'www', 'url' => 'https://', 'cookie_salt' => '$5$rounds=2513$A3xbn9p2glIH1xTbYnctoVfIRY64lJLZ$', 'cookie_exp' => 90, 'user_lenght' => '50', 'password_lenght' => '50', 'projectname_lenght' => '50', 'version_lenght' => '20', 'upload_dir' => 'upload', 'lang_available' => array('fr' => 'Français', 'en' => 'English'), 'bugs' => array('Open' => array('Unconfirmed', 'Assigned'), 'Closed' => array('Fixed', 'WontFix', 'Invalid')), 'os' => array('Windows', 'Mac', 'Linux', 'Android'), 'arch' => array('x84', 'x64', 'arm'), 'base' => 'some_base', 'user' => 'users', 'project' => 'projects', 'bug' => 'bugs', 'inc' => 'inc');
}
开发者ID:sandipmavani,项目名称:suna,代码行数:4,代码来源:conf.php


示例11: set_language

                echo set_language($data['forum_language']);
            }
        }
    } elseif (preg_match('/index.php/i', $_SERVER['PHP_SELF']) && (isset($_GET['viewforum']) && isnum($_GET['forum_id'])) && multilang_table("FO")) {
        $data = dbarray(dbquery("SELECT forum_cat, forum_branch, forum_language FROM " . DB_FORUMS . " WHERE forum_id='" . stripinput($_GET['forum_id']) . "'"));
        if ($data['forum_language'] . " != " . LANGUAGE) {
            echo set_language($data['forum_language']);
        }
    } elseif (preg_match('/photogallery.php/i', $_SERVER['PHP_SELF']) || preg_match('|/gallery/photo/([0-9]+)/|', $_SERVER['REQUEST_URI'], $matches) && multilang_table("PG")) {
        if (isset($_GET['photo_id']) && isnum($_GET['photo_id']) || !empty($matches) && $matches['1'] > 0) {
            $data = dbarray(dbquery("SELECT pha.album_id, pha.album_language, ph.album_id\n\t\t\t\t\t\t\t\t\tFROM " . DB_PHOTO_ALBUMS . " pha\n\t\t\t\t\t\t\t\t\tLEFT JOIN " . DB_PHOTOS . " ph ON pha.album_id = ph.album_id\n\t\t\t\t\t\t\t\t\tWHERE ph.photo_id='" . (isset($_GET['photo_id']) ? $_GET['photo_id'] : $matches['1']) . "'\n\t\t\t\t\t\t\t\t\tGROUP BY ph.photo_id"));
            if ($data['album_language'] . " != " . LANGUAGE) {
                echo set_language($data['album_language']);
            }
        }
    } elseif (preg_match('/photogallery.php/i', $_SERVER['PHP_SELF']) || preg_match('|/gallery/([0-9]+)/|', $_SERVER['REQUEST_URI'], $matches) && multilang_table("PG")) {
        if (isset($_GET['album_id']) && isnum($_GET['album_id']) || !empty($matches) && $matches['1'] > 0) {
            $data = dbarray(dbquery("SELECT album_language FROM " . DB_PHOTO_ALBUMS . " WHERE album_id='" . (isset($_GET['album_id']) ? $_GET['album_id'] : $matches['1']) . "'"));
            if ($data['album_language'] . " != " . LANGUAGE) {
                echo set_language($data['album_language']);
            }
        }
    } elseif (preg_match('/weblinks.php/i', $_SERVER['PHP_SELF']) || preg_match('|/weblinks/([0-9]+)/|', $_SERVER['REQUEST_URI'], $matches) && multilang_table("WL")) {
        if (isset($_GET['cat_id']) && isnum($_GET['cat_id']) || !empty($matches) && $matches['1'] > 0) {
            $data = dbarray(dbquery("SELECT weblink_cat_language FROM " . DB_WEBLINK_CATS . " WHERE weblink_cat_id='" . (isset($_GET['cat_id']) ? $_GET['cat_id'] : $matches['1']) . "'"));
            if ($data['weblink_cat_language'] . " != " . LANGUAGE) {
                echo set_language($data['weblink_cat_language']);
            }
        }
    }
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:core_mlang_hub_include.php


示例12: change_language

function change_language($id)
{
    setcookie('lang', $id, time() + 30000000);
    set_language($id);
}
开发者ID:stenno12,项目名称:eteater,代码行数:5,代码来源:lang.php


示例13: print_hreflang

      </form>
    </div>
<?php 
}
function print_hreflang()
{
    global $languages;
    $url = get_url();
    foreach ($languages as $language => $name) {
        echo "    <link rel=\"alternate\" hreflang=\"{$language}\" href=\"" . preg_replace("/([^\\/]+\\/{2}[^\\/]+)\\//", "\$1/{$language}/", $url) . "\">\n";
    }
}
start_session();
get_languages();
if (!isset($_SESSION["language"])) {
    set_language(array_keys($languages));
}
$file = __DIR__ . "/translations/" . $_SESSION["language"];
require_once "{$file}.php";
if ($hash != ($file_hash = sha1_file("{$file}.lang"))) {
    $last_index = "";
    $translations = array();
    $append_next_line = false;
    foreach (file("{$file}.lang", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) {
        if ($append_next_line) {
            $translations[$last_index] = substr($translations[$last_index], 0, -1) . "\n{$line}";
        } else {
            $tmparray = explode("=", $line);
            $last_index = $tmparray[0];
            $translations[$last_index] = $tmparray[1];
        }
开发者ID:mcenderdragon,项目名称:Icon-Craft,代码行数:31,代码来源:language.php


示例14: __construct

 /**
  * 构造函数
  */
 function __construct()
 {
     set_language();
     c_lib()->load('sql', 'ip')->add('sql', new Sql(cfg()->get('sql', 'write'), cfg()->get('sql', 'read')));
     l_h("system.php", 'theme.php');
 }
开发者ID:ttym7993,项目名称:Linger,代码行数:9,代码来源:Hook.php


示例15: main

function main()
{
    set_language();
    test();
}
开发者ID:newmight2015,项目名称:linux,代码行数:5,代码来源:lang.php


示例16: html_page_start

/**
 * \brief Default page header for each page
 *
 * \param p_theme default theme
 * \param $p_script
 * \param $p_script2  another js script
 * Must be called only once
 * \return none
 */
function html_page_start($p_theme = "", $p_script = "", $p_script2 = "")
{
    // check not called twiced
    static $already_call = 0;
    if ($already_call == 1) {
        return;
    }
    $already_call = 1;
    $cn = new Database();
    if ($p_theme != "") {
        $Res = $cn->exec_sql("select the_filestyle from theme\n                           where the_name='" . $p_theme . "'");
        if (Database::num_row($Res) == 0) {
            $style = "style-classic.css";
        } else {
            $s = Database::fetch_array($Res, 0);
            $style = $s['the_filestyle'];
        }
    } else {
        $style = "style-classic.css";
    }
    // end if
    $title = "NOALYSS";
    if (isset($_REQUEST['ac'])) {
        if (strpos($_REQUEST['ac'], '/') != 0) {
            $m = explode('/', $_REQUEST['ac']);
            $title = $m[count($m) - 1] . "  " . $title;
        } else {
            $title = $_REQUEST['ac'] . "  " . $title;
        }
    }
    $is_msie = is_msie();
    if ($is_msie == 0) {
        echo '<!doctype html>';
        printf("\n");
        echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
        printf("\n");
    } else {
        echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN" >';
        printf("\n");
    }
    echo "<HTML>";
    if ($p_script2 != "") {
        $p_script2 = '<script src="' . $p_script2 . '?version=' . SVNINFO . '" type="text/javascript"></script>';
    }
    $style = trim($style);
    echo "<HEAD>";
    if ($is_msie == 1) {
        echo '      <meta http-equiv="x-ua-compatible" content="IE=edge"/>';
    }
    echo "\n    <TITLE>{$title}</TITLE>\n\t<link rel=\"icon\" type=\"image/ico\" href=\"favicon.ico\" />\n    <META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n    <LINK REL=\"stylesheet\" type=\"text/css\" href=\"" . $style . "?version=" . SVNINFO . "\" media=\"screen\"/>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"./style-print.css?version=" . SVNINFO . "\" media=\"print\"/>" . $p_script2 . "\n    ";
    echo '<script language="javascript" src="js/calendar.js"></script>
    <script type="text/javascript" src="js/lang/calendar-en.js"></script>
    <script language="javascript" src="js/calendar-setup.js"></script>
    <LINK REL="stylesheet" type="text/css" href="./calendar-blue.css" media="screen">
    ';
    echo load_all_script();
    echo '    </HEAD>    ';
    echo "<BODY {$p_script}>";
    echo '<div id="info_div"></div>';
    echo '<div id="error_div">' . HtmlInput::title_box(_("Erreur"), 'error_div', 'hide') . '<div id="error_content_div">' . '</div>' . '<p style="text-align:center">' . HtmlInput::button_action('Valider', '$(\'error_div\').style.visibility=\'hidden\';$(\'error_content_div\').innerHTML=\'\';') . '</p>' . '</div>';
    // language
    if (isset($_SESSION['g_lang'])) {
        set_language();
    }
}
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:74,代码来源:ac_common.php


示例17: getLanguages

 /**
  * Get Languages
  *
  * This gets unique languges:
  * OUT > Array
  * (
  * 		[en] => English
  *   	[en_GB] => English (United Kingdom)
  * )
  * @return [type] [description]
  */
 public function getLanguages()
 {
     $names = $this->getLanguageNames();
     $locations = $this->getLocationNames();
     $packagelangs = array();
     $packages = $this->getPackages();
     if (!empty($packages)) {
         foreach ($packages as $package) {
             if (!empty($package['installed'])) {
                 //Try to use local_get_display_name if it's installed
                 if (function_exists('locale_get_display_name')) {
                     $language = set_language();
                     $name = locale_get_display_name($package['language'], $language);
                 } else {
                     $lang = explode('_', $package['language'], 2);
                     if (count($lang) == 2 && !empty($locations[$lang[1]]) && !empty($names[$lang[0]])) {
                         $name = $names[$lang[0]] . ' - ' . $locations[$lang[1]];
                     } else {
                         if (!empty($names[$lang[0]])) {
                             $name = $names[$lang[0]];
                         } else {
                             $name = $lang[0];
                         }
                     }
                 }
                 $packagelangs[$package['language']] = $name;
             }
         }
     }
     $customlangs = array();
     $customs = $this->getCustomLanguages();
     if (!empty($customs)) {
         foreach ($customs as $customlang) {
             $customlangs[$customlang['language']] = $customlang['description'];
         }
     }
     $languages = array_merge($packagelangs, $customlangs);
     if (empty($languages)) {
         $languages = array('en' => $names['en']);
     }
     asort($languages);
     return $languages;
 }
开发者ID:lidl,项目名称:soundlang,代码行数:54,代码来源:Soundlang.class.php


示例18: doLogin


//.........这里部分代码省略.........
     }
     // Go to control panel by default
     $_SESSION['sessionID'] = null;
     $_SESSION['sessionName'] = null;
     $_SESSION['sessionAdmin'] = null;
     $_SESSION['hourOffset'] = null;
     $uname = stripslashes($uname);
     $pass = stripslashes($pass);
     $ok_user = $ok_pass = false;
     $use_logonname = (bool) $conf['app']['useLogonName'];
     $adminemail = strtolower($conf['app']['adminEmail']);
     if ($isCookie !== false) {
         // Cookie is set
         $cookieValue = $isCookie;
         if (($id = $this->verifyCookie($cookieValue)) !== false) {
             $ok_user = $ok_pass = true;
         } else {
             $ok_user = $ok_pass = false;
             setcookie('ID', '', time() - 3600, '/');
             // Clear out all cookies
             $msg .= translate('That cookie seems to be invalid') . '<br/>';
         }
     } else {
         if ($conf['ldap']['authentication']) {
             // Include LDAPEngine class
             include_once 'LDAPEngine.class.php';
             $ldap = new LDAPEngine($uname, $pass);
             if ($ldap->connected()) {
                 $mail = $ldap->getUserEmail();
                 if ($mail) {
                     $id = $this->db->userExists($mail);
                     if ($id) {
                         // check if LDAP and local DB are in consistancy.
                         $updates = $ldap->getUserData();
                         if ($this->db->check_updates($id, $updates)) {
                             $this->db->update_user($id, $updates);
                         }
                     } else {
                         $data = $ldap->getUserData();
                         $id = $this->do_register_user($data, false);
                     }
                     $ok_user = true;
                     $ok_pass = true;
                 } else {
                     $msg .= translate('This system requires that you have an email address.');
                 }
             } else {
                 $msg .= translate('Invalid User Name/Password.');
             }
             $ldap->disconnect();
         } else {
             // If we cant find email, set message and flag
             if (!($id = $this->db->userExists($uname, $use_logonname))) {
                 $msg .= translate('We could not find that logon in our database.') . '<br/>';
                 $ok_user = false;
             } else {
                 $ok_user = true;
             }
             // If password is incorrect, set message and flag
             if ($ok_user && !$this->db->isPassword($uname, $pass, $use_logonname)) {
                 $msg .= translate('That password did not match the one in our database.') . '<br/>';
                 $ok_pass = false;
             } else {
                 $ok_pass = true;
             }
         }
     }
     // If the login failed, notify the user and quit the app
     if (!$ok_user || !$ok_pass) {
         $msg .= translate('You can try');
         return $msg;
     } else {
         $this->is_loggedin = true;
         $user = new User($id);
         // Get user info
         // If the user wants to set a cookie, set it
         // for their ID and fname.  Expires in 30 days (2592000 seconds)
         if (!empty($cookieVal)) {
             //die ('Setting cookie');
             setcookie('ID', $this->generateCookie($user->get_id()), time() + 2592000, '/');
         }
         // If it is the admin, set session variable
         if ($user->get_email() == $adminemail || $user->get_isadmin()) {
             $_SESSION['sessionAdmin'] = $user->get_email();
         }
         // Set other session variables
         $_SESSION['sessionID'] = $user->get_id();
         $_SESSION['sessionName'] = $user->get_fname();
         $_SESSION['hourOffset'] = $user->get_timezone() - $conf['app']['timezone'];
         if ($lang != '') {
             set_language($lang);
             if ($lang != $user->get_lang()) {
                 $user->set_lang($lang);
                 // Language changed so update the DB
             }
         }
         // Send them to the control panel
         CmnFns::redirect(urldecode($resume));
     }
 }
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:Auth.class.php


示例19: framework_server_name

 $header['title'] = framework_server_name();
 $header['amp_conf'] = $amp_conf;
 $header['use_popover_css'] = $fw_popover || $fw_popover_process;
 $o = FreePBX::create()->Less->generateMainStyles();
 $header['compiled_less_files'] = $o['compiled_less_files'];
 $header['extra_compiled_less_files'] = $o['extra_compiled_less_files'];
 //if we have a module loaded, load its css
 if (isset($module_name)) {
     $header['module_name'] = $module_name;
 }
 echo load_view($amp_conf['VIEW_HEADER'], $header);
 if (isset($module_name)) {
     echo framework_include_css();
 }
 // set the language so local module languages take
 $language = set_language();
 // send menu
 $menu['fpbx_menu'] = $fpbx_menu;
 //array of modules & settings
 $menu['display'] = $display;
 //currently displayed item
 $menu['authtype'] = $amp_conf['AUTHTYPE'];
 $menu['reload_confirm'] = $amp_conf['RELOADCONFIRM'];
 $menu['language'] = array('en_US' => _('English') . " (US)");
 $langKey = !empty($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en_US';
 foreach (glob($amp_conf['AMPWEBROOT'] . "/admin/i18n/*", GLOB_ONLYDIR) as $langDir) {
     $lang = basename($langDir);
     $menu['language'][$lang] = function_exists('locale_get_display_name') ? locale_get_display_name($lang, $langKey) : $lang;
 }
 //add menu to final output
 echo load_view($amp_conf['VIEW_MENU'], $menu);
开发者ID:powerpbx,项目名称:framework,代码行数:31,代码来源:config.php


示例20: die

}
@(include_once SYSTEM_CONF_FILE);
if (!defined('SESSIONMANAGER_HOST')) {
    die('NO Session Manager host defined');
}
define('ADMIN_ROOT', realpath(dirname(dirname(__FILE__))));
define('CLASSES_DIR', ADMIN_ROOT . '/classes');
function __autoload($class_name)
{
    //what about NameSpaces ?
    $class_files = array();
    if (!class_exists($class_name)) {
        $class_files[] = CLASSES_DIR . '/' . $class_name . '.class.php';
        foreach ($class_files as $class_file) {
            if (file_exists($class_file)) {
                require_once $class_file;
                return;
            }
        }
        if (isset($autoload_die) && $autoload_die === true) {
            die_error('Class \'' . $class_name . '\' not found', __FILE__, __LINE__);
        }
    }
}
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
    $buf = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
    $buf = explode(';', $buf[0]);
    set_language($buf[0]);
}
require_once dirname(__FILE__) . '/template_server.inc.php';
@session_start();
开发者ID:bloveing,项目名称:openulteo,代码行数:31,代码来源:core-minimal.inc.php



注:本文中的set_language函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP set_locale函数代码示例发布时间:2022-05-15
下一篇:
PHP set_lang函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap