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

PHP set_lang函数代码示例

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

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



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

示例1: page_admin_menu_edit

function page_admin_menu_edit($parent_id = "", $act = "", $id = "")
{
    requires_admin();
    set_lang("other");
    use_layout("admin");
    if (!$parent_id) {
        $parent_id = 0;
    }
    $o = "";
    if ($act == "del") {
        $rec = db_object_get("menu", $id);
        if ($rec->fixed == 'Y') {
            $act = "-";
            $o .= '<script>alert("Эту запись нельзя удалить.")</script>';
        }
    }
    global $tables;
    $tables['menu']['fields'][] = "title";
    $tables['menu']['fields'][] = "link";
    $tables['menu']['weight'] = true;
    if ($parent_id) {
        $o .= menu_path($parent_id);
    }
    global $table_edit_props;
    $table_edit_props->use_rename_icon_for_edit = true;
    $o .= table_edit("menu", "admin/menu/edit/{$parent_id}", $act, $id, "parent_id", $parent_id, "", "on_menu");
    $o .= "<style> input[type='submit'] { padding: 5px 10px; width: auto;}\r\n\t  input{ width:400px; }\r\n\t</style>";
    return $o;
}
开发者ID:NazarK,项目名称:sqp,代码行数:29,代码来源:menu.php


示例2: page_admin_menu_edit

function page_admin_menu_edit($parent_id = "", $act = "", $id = "")
{
    requires_admin();
    set_lang("other");
    use_template("admin");
    if (!$parent_id) {
        $parent_id = 0;
    }
    $o = "";
    if ($act == "del") {
        $rec = db_object_get("menu", $id);
        if ($rec->fixed == 'Y') {
            $act = "-";
            $o .= '<script>alert("Эту запись нельзя удалить.")</script>';
        }
    }
    global $tables;
    $tables['menu']['fields'][] = "title";
    $tables['menu']['fields'][] = "link";
    $tables['menu']['weight'] = true;
    if ($parent_id) {
        $o .= menu_path($parent_id);
    }
    $o .= table_edit("menu", "admin/menu/edit/{$parent_id}", $act, $id, "parent_id", $parent_id, "", "on_menu");
    return $o;
}
开发者ID:NazarK,项目名称:timedesk,代码行数:26,代码来源:menu.php


示例3: set_emoncms_lang

function set_emoncms_lang($lang)
{
    // If no language defined use the language browser
    if ($lang == '') {
        set_lang(lang_http_accept());
    } else {
        set_lang_by_user($lang);
    }
}
开发者ID:UbiCollab,项目名称:PersuasiveCommunities,代码行数:9,代码来源:locale.php


示例4: set_emoncms_lang

function set_emoncms_lang($userid)
{
    // Get language from database user
    $lang = get_user_lang($userid);
    // If no language defined use the language browser
    if ($lang == '') {
        set_lang(lang_http_accept());
    } else {
        set_lang_by_user($lang);
    }
}
开发者ID:jan-munneke,项目名称:emoncms3,代码行数:11,代码来源:locale.php


示例5: defined

All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.

---------------------------------------------------------------------
Emoncms - open source energy visualisation
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org
*/
// no direct access
defined('EMONCMS_EXEC') or die('Restricted access');
global $path, $session, $allowusersregister;
require_once 'Includes/locale.php';
// gets the accepted language browser list
$accepted_languages = lang_http_accept();
// set to the apropiated language
set_lang($accepted_languages);
?>

<div style="margin: 0px auto; max-width:392px; padding:10px;">
	<div style="max-width:392px; margin-right:20px; padding-top:45px; padding-bottom:15px; color: #888;">
		<img style="margin:12px;" src="<?php 
echo get_theme_path();
?>
/emoncms_logo.png" />
	</div>

	<div class="login-container">
		<div style="text-align:left">
			<form class="well" action="" method="post">
				<p>
					<?php 
开发者ID:lineuve,项目名称:emoncms3,代码行数:31,代码来源:login_block.php


示例6: set_include_path

<?php

set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
include_once "aur.inc.php";
set_lang();
check_sid();
include_once 'stats.inc.php';
html_header(__("Home"));
?>

<div id="content-left-wrapper">
	<div id="content-left">
		<div id="intro" class="box">
			<h2>AUR <?php 
echo __("Home");
?>
</h2>
			<p>
			<?php 
echo __('Welcome to the AUR! Please read the %sAUR User Guidelines%s and %sAUR TU Guidelines%s for more information.', '<a href="https://wiki.archlinux.org/index.php/AUR_User_Guidelines">', '</a>', '<a href="https://wiki.archlinux.org/index.php/AUR_Trusted_User_Guidelines">', '</a>');
?>
			<?php 
echo __('Contributed PKGBUILDs %smust%s conform to the %sArch Packaging Standards%s otherwise they will be deleted!', '<strong>', '</strong>', '<a href="https://wiki.archlinux.org/index.php/Arch_Packaging_Standards">', '</a>');
?>
			<?php 
echo __('Remember to vote for your favourite packages!');
?>
			<?php 
echo __('Some packages may be provided as binaries in [community].');
?>
			</p>
开发者ID:pyp22,项目名称:aurweb,代码行数:31,代码来源:home.php


示例7: user_login

/**
 * Effectively logs the user in
 * @param string $login
 * @param string $passwd
 */
function user_login($login, $passwd)
{
    global $input;
    global $template_folder;
    global $error;
    global $ezplayer_url;
    // 0) Sanity checks
    if (empty($login) || empty($passwd)) {
        $error = template_get_message('empty_username_password', get_lang());
        view_login_form();
        die;
    }
    $login_parts = explode("/", $login);
    // checks if runas
    if (count($login_parts) == 2) {
        if (!file_exists('admin.inc')) {
            $error = "Not admin. runas login failed";
            view_login_form();
            die;
        }
        include 'admin.inc';
        //file containing an assoc array of admin users
        if (!isset($admin[$login_parts[0]])) {
            $error = "Not admin. runas login failed";
            view_login_form();
            die;
        }
        $_SESSION['user_is_admin'] = true;
        $_SESSION['user_runas'] = true;
    } else {
        if (file_exists('admin.inc')) {
            include 'admin.inc';
            //file containing an assoc array of admin users
            if (isset($admin[$login])) {
                $_SESSION['user_is_admin'] = true;
            }
        }
    }
    $res = checkauth(strtolower($login), $passwd);
    if (!$res) {
        $error = checkauth_last_error();
        view_login_form();
        die;
    }
    // 1) Initializing session vars
    $_SESSION['ezplayer_logged'] = "user_logged";
    // "boolean" stating that we're logged
    $_SESSION['user_login'] = $res['login'];
    $_SESSION['user_real_login'] = $res['real_login'];
    $_SESSION['user_full_name'] = $res['full_name'];
    $_SESSION['user_email'] = $res['email'];
    $_SESSION['admin_enabled'] = false;
    //check flash plugin or GET parameter no_flash
    if (!isset($_SESSION['has_flash'])) {
        //no noflash param when login
        //check flash plugin
        if ($input['has_flash'] == 'N') {
            $_SESSION['has_flash'] = false;
        } else {
            $_SESSION['has_flash'] = true;
        }
    }
    // 2) Initializing the ACLs
    acl_init($login);
    // 3) Setting correct language
    set_lang($input['lang']);
    // 4) Resetting the template path to the one of the language chosen
    template_repository_path($template_folder . get_lang());
    // 5) Logging the login operation
    log_append("login");
    log_append("user's browser : " . $_SESSION['browser_full']);
    // lvl, action, browser_name, browser_version, user_os, browser_full_info
    trace_append(array("1", "login", $_SESSION['browser_name'], $_SESSION['browser_version'], $_SESSION['user_os'], $_SESSION['browser_full'], session_id()));
    // 6) Displaying the page
    //    view_main();
    if (count($_SESSION['first_input']) > 0) {
        $ezplayer_url .= '/index.php?';
    }
    foreach ($_SESSION['first_input'] as $key => $value) {
        $ezplayer_url .= "{$key}={$value}&";
    }
    header("Location: " . $ezplayer_url);
    load_page();
}
开发者ID:jingyexu,项目名称:ezcast,代码行数:89,代码来源:web_index.php


示例8: requires_admin

function requires_admin()
{
    global $apptitle;
    if (admin()) {
        set_lang("ru");
        return true;
    } else {
        $pass = db_result(db_query("SELECT admin_pass FROM settings"));
        if ($pass == "") {
            session_set("admin", true);
            return true;
        }
        redir("admin/login");
    }
}
开发者ID:NazarK,项目名称:sqp,代码行数:15,代码来源:admin.php


示例9: set_lang_by_user

                $lang = 'fr_FR';
                break;
            case 'it':
                $lang = 'it_IT';
                break;
            case 'nl':
                $lang = 'nl_NL';
                break;
                //case 'nl': $lang='nl_BE'; break;
        }
        set_lang_by_user($lang);
    }
}
// get browser language.
//to do: get user config
set_lang(lang_http_accept());
// Loaded like JS File, so we need to specify domain for getText translation
$domain = "messages";
bindtextdomain($domain, "locale");
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);
?>

// Create a Javascript associative array who contain all sentences from module
var LANG_JS = new Array();

function _Tr(key)
{
    // will return the default value if LANG_JS[key] is not defined.
    return LANG_JS[key] || key;
}
开发者ID:barriquello,项目名称:simon,代码行数:31,代码来源:dashboard_langjs.php


示例10: Smarty

<?php

require_once 'inc/functions.php';
require 'inc/languages.php';
require 'Smarty.class.php';
$smarty = new Smarty();
$current_lang = set_lang();
$smarty->assign('lang', $lang[$current_lang]);
$loaded_ext = get_loaded_extensions();
foreach ($loaded_ext as $ext) {
    $extensions .= $ext . ', ';
}
$smarty->assign('extensions', $extensions);
if (extension_loaded('mysqli') && @mysqli_connect('localhost', 'root', 'vertrigo')) {
    $smarty->assign('password_status', false);
} else {
    $smarty->assign('password_status', true);
}
$smarty->assign('php_version', phpversion());
$smarty->display('index.tpl');
开发者ID:joel-medeiros,项目名称:firenze,代码行数:20,代码来源:vertrigoversao.php


示例11: get_lang

/**
 * @see set_lang()
 * @return string The language available.
 */
function get_lang()
{
    return set_lang();
}
开发者ID:joswilson,项目名称:NotJustOK,代码行数:8,代码来源:fns.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP set_language函数代码示例发布时间:2022-05-15
下一篇:
PHP set_js_var函数代码示例发布时间: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