本文整理汇总了PHP中ext_Lang::detect_lang方法的典型用法代码示例。如果您正苦于以下问题:PHP ext_Lang::detect_lang方法的具体用法?PHP ext_Lang::detect_lang怎么用?PHP ext_Lang::detect_lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ext_Lang
的用法示例。
在下文中一共展示了ext_Lang::detect_lang方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onShowLoginForm
//.........这里部分代码省略.........
name: "password",
value: "<?php
echo $Pass;
?>
",
inputType: "password",
width:175,
allowBlank:false
}, new Ext.form.ComboBox({
fieldLabel: "<?php
echo ext_Lang::msg('misclang', true);
?>
",
store: new Ext.data.SimpleStore({
fields: ['language', 'langname'],
data : [
<?php
$langs = get_languages();
$i = 0;
$c = count($langs);
foreach ($langs as $language => $name) {
echo "['{$language}', '{$name}' ]";
if (++$i < $c) {
echo ',';
}
}
?>
]
}),
displayField:"langname",
valueField: "language",
value: "<?php
echo ext_Lang::detect_lang();
?>
",
hiddenName: "lang",
disableKeyFilter: true,
editable: false,
triggerAction: "all",
mode: "local",
allowBlank: false,
selectOnFocus:true
}),
{
xtype: "displayfield",
id: "statusBar"
}
],
buttons: [{
text: "<?php
echo ext_Lang::msg('btnlogin', true);
?>
",
type: "submit",
handler: function() {
Ext.get( "statusBar").update( "Please wait..." );
Ext.getCmp("simpleform").getForm().submit({
reset: false,
success: function(form, action) { location.reload() },
failure: function(form, action) {
if( !action.result ) return;
Ext.Msg.alert('<?php
echo ext_Lang::err('error', true);
?>
', action.result.error, function() {
示例2: define
define("_EXT_PATH", realpath(dirname(__FILE__) . '/../../administrator/components/com_extplorer'));
define("_EXT_URL", $mosConfig_live_site . "/administrator/components/com_extplorer");
require _EXT_PATH . "/application.php";
require _EXT_PATH . "/libraries/File_Operations.php";
require _EXT_PATH . "/include/functions.php";
require _EXT_PATH . "/include/header.php";
require _EXT_PATH . "/include/result.class.php";
if (!class_exists('InputFilter')) {
require_once _EXT_PATH . '/libraries/inputfilter.php';
}
$GLOBALS['ERROR'] = '';
$GLOBALS['__GET'] =& $_GET;
$GLOBALS['__POST'] =& $_POST;
$GLOBALS['__SERVER'] =& $_SERVER;
$GLOBALS['__FILES'] =& $_FILES;
$default_lang = !empty($GLOBALS['mosConfig_lang']) ? $GLOBALS['mosConfig_lang'] : ext_Lang::detect_lang();
echo $default_lang;
if (file_exists(_EXT_PATH . "/languages/{$default_lang}.php")) {
require _EXT_PATH . "/languages/{$default_lang}.php";
} else {
require _EXT_PATH . "/languages/english.php";
}
if (file_exists(_EXT_PATH . "/languages/" . $default_lang . "_mimes.php")) {
require _EXT_PATH . "/languages/" . $default_lang . "_mimes.php";
} else {
require _EXT_PATH . "/languages/english_mimes.php";
}
require _EXT_PATH . "/config/mimes.php";
// the filename of the QuiXplorer script: (you rarely need to change this)
if ($_SERVER['SERVER_PORT'] == 443) {
$GLOBALS["script_name"] = "https://" . $GLOBALS['__SERVER']['HTTP_HOST'] . $GLOBALS['__SERVER']["PHP_SELF"];
示例3: login
//.........这里部分代码省略.........
echo "['{$language}', '{$name}' ]";
if (++$i < $c) {
echo ',';
}
}
?>
]
});
var simple = new Ext.form.Form({
labelWidth: 125, // label settings here cascade unless overridden
url:'<?php
echo basename($GLOBALS['script_name']);
?>
'
});
simple.add(
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('miscusername', true);
?>
',
name: 'p_user',
width:175,
allowBlank:false
}),
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('miscpassword', true);
?>
',
name: 'p_pass',
inputType: 'password',
width:175,
allowBlank:false
}),
new Ext.form.ComboBox({
fieldLabel: '<?php
echo ext_Lang::msg('misclang', true);
?>
',
store: languages,
displayField:'langname',
valueField: 'language',
value: '<?php
echo ext_Lang::detect_lang();
?>
',
hiddenName: 'lang',
disableKeyFilter: true,
editable: false,
triggerAction: 'all',
mode: 'local',
allowBlank: false,
selectOnFocus:true
})
);
simple.addButton({text: '<?php
echo ext_Lang::msg('btnlogin', true);
?>
', type: 'submit'}, function() {
Ext.get( 'statusBar').update( 'Please wait...' );
simple.submit({
//reset: true,
reset: false,
success: function(form, action) {
Ext.get( 'statusBar').update( action.result.message );
location.href = '<?php
echo basename($GLOBALS['script_name']);
?>
?extplorer';
},
failure: function(form, action) {
if( !action.result ) return;
Ext.MessageBox.alert('Error!', action.result.error);
Ext.get( 'statusBar').update( action.result.error );
simple.findField( 'p_pass').setValue('');
simple.findField( 'p_user').focus();
},
scope: simple,
// add some vars to the request, similar to hidden fields
params: {option: 'com_extplorer',
action: 'login'
}
})
});
simple.addButton('<?php
echo ext_Lang::msg('btnreset', true);
?>
', function() { simple.reset(); } );
simple.render('adminForm');
Ext.get( 'formContainer').center();
Ext.get( 'formContainer').setTop(100);
simple.findField('p_user').focus();
</script><?php
define('_LOGIN_REQUIRED', 1);
}
}
}