本文整理汇总了PHP中get_language函数的典型用法代码示例。如果您正苦于以下问题:PHP get_language函数的具体用法?PHP get_language怎么用?PHP get_language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_language函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
require_once "modules/{$module_name}/libs/PaloSantoRepositories.class.php";
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
$contenidoModulo = listRepositories($smarty, $module_name, $local_templates_dir, $arrConf);
return $contenidoModulo;
}
示例2: developers_clear_strings
/**
* Clear all the strings so the raw descriptor strings are displayed
*/
function developers_clear_strings()
{
global $CONFIG;
$language = get_language();
$CONFIG->translations[$language] = array();
$CONFIG->translations['en'] = array();
}
示例3: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
include_once "modules/{$module_name}/libs/paloSantoSoftphones.class.php";
//include file language agree to elastix configuration
//if file language not exists, then include language by default (en)
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
$content = "";
switch ($action) {
default:
// view_form
$content = viewFormSoftphones($smarty, $module_name, $local_templates_dir, $arrConf);
break;
}
return $content;
}
示例4: init
function init()
{
elgg_extend_view('css/elgg', 'css/elgg_recaptcha');
elgg_register_plugin_hook_handler('view', 'all', __NAMESPACE__ . '\\view_hook');
elgg_register_plugin_hook_handler('action', 'all', __NAMESPACE__ . '\\action_hook');
elgg_define_js('google_recaptcha', array('src' => 'https://www.google.com/recaptcha/api.js?render=explicit&onload=elgg_recaptcha_render&hl=' . get_language()));
}
示例5: About
function About()
{
parent::Controller();
$this->load->library('Form_validation');
$this->load->helper('simian_view_helper');
$this->load->helper('simian_facebook_helper');
$this->lang->load('simian_grid', get_language());
}
示例6: redirectToI18nUrl
static function redirectToI18nUrl()
{
$uri = get_request_uri();
$pos = strpos($uri, "/" . get_sub_root() . get_language());
if ($pos === false || $pos !== false && $pos != 0) {
$uri = get_request_uri(false);
$uri = preg_replace('/\\/' . str_replace('/', '\\/', get_sub_root()) . '/', get_language() . '/', $uri, 1);
HTML::forward($uri);
}
}
示例7: Region
function Region()
{
parent::Controller();
$this->load->library('table');
$this->load->library('SimianGrid');
$this->load->library('table');
$this->load->helper('form');
$this->load->helper('simian_view_helper');
$this->load->helper('simian_facebook_helper');
$this->lang->load('simian_grid', get_language());
}
示例8: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
include_once "modules/{$module_name}/libs/Ticket_Delivery.class.php";
require_once "modules/{$module_name}/libs/JSON.php";
//include file language agree to elastix configuration
//if file language not exists, then include language by default (en)
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
$pDB = new paloDB($arrConf['cadena_dsn']);
$pDB_2 = new paloDB($arrConf['elastix_dsn']['acl']);
//actions
$action = getParameter('action');
switch ($action) {
case 'assign':
$content = assign_TicketDelivery($pDB, $pDB_2);
break;
case 'collect':
$content = CashCollection($pDB, $pDB_2);
break;
case 'update_row':
$content = updateRow_TicketDelivery($pDB, $pDB_2, $module_name);
break;
case 'process':
$content = TicketProcess(&$pDB);
break;
case 'expand':
$content = TicketExpand($pDB);
break;
default:
$content = report_TicketDelivery($smarty, $module_name, $local_templates_dir, $pDB, $pDB_2);
break;
}
return $content;
}
示例9: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
include_once "modules/{$module_name}/libs/paloSantoRegestion.class.php";
include_once "modules/{$module_name}/libs/paloSantoCrearcampania.class.php";
//include file language agree to elastix configuration
//if file language not exists, then include language by default (en)
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
//conexion resource
$pDB = new paloDB($arrConf['dsn_conn_database']);
//actions
$action = getAction();
$content = "";
switch ($action) {
// Ver form con información de la campaña padre para proceder a armar la regestión
case 'view_edit':
$content = viewFormCrearcampaña($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf);
break;
// Grabar la regestión
// Grabar la regestión
case 'save_edit':
case 'save_new':
saveNewRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
$content = reportRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
break;
// Reporte de campañas padres
// Reporte de campañas padres
default:
$content = reportRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
break;
}
return $content;
}
示例10: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
include_once "modules/{$module_name}/libs/paloSantoOverall_setting.class.php";
require_once "modules/{$module_name}/libs/JSON.php";
//include file language agree to elastix configuration
//if file language not exists, then include language by default (en)
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
//conexion resource
$pDB = new paloDB($arrConf['cadena_dsn']);
$pACL = new paloACL($arrConf['elastix_dsn']['acl']);
//actions
$action = getAction();
switch ($action) {
case "update":
$content = updateNotification($pDB);
break;
case 'refresh':
$content = refreshNotification($pDB);
break;
case "update_rate":
$content = updateRate($pDB, $pACL);
break;
case 'refresh_rate':
$content = refreshRate($pDB, $pACL);
break;
default:
// view_form
$content = viewFormOverall_setting($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
break;
}
return $content;
}
示例11: Auth
function Auth()
{
parent::Controller();
$this->load->library('Openid');
$this->load->library('Form_validation');
$this->load->helper('url');
$this->load->helper('form');
$this->load->helper('simian_openid_helper');
$this->load->helper('simian_facebook_helper');
$this->load->helper('simian_form_helper');
$this->lang->load('simian_grid', get_language());
$this->lang->load('openid', get_language());
$this->lang->load('form_validation', get_language());
}
示例12: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
include_once "modules/{$module_name}/libs/paloSantoMissedCalls.class.php";
//include file language agree to elastix configuration
//if file language not exists, then include language by default (en)
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
// cdr connection
$dsn = generarDSNSistema('asteriskuser', 'asteriskcdrdb');
$pDB_cdr = new paloDB($dsn);
// call_center connection
$pDB_callcenter = new paloDB($arrConf['cadena_dsn']);
$pDBACL = new paloDB($arrConf['elastix_dsn']['acl']);
if (!empty($pDBACL->errMsg)) {
return "ERROR DE DB: {$pDBACL->errMsg}";
}
$pACL = new paloACL($pDBACL);
if (!empty($pACL->errMsg)) {
return "ERROR DE ACL: {$pACL->errMsg}";
}
//actions
$action = getAction();
switch ($action) {
case 'call2phone':
$content = call2phone();
break;
default:
$content = reportMissedCalls($smarty, $module_name, $local_templates_dir, $pDB_callcenter, $pDBACL, $pACL, $arrConf, $pDB_cdr);
break;
}
return $content;
}
示例13: load_language_module
function load_language_module($module_id, $ruta_base = '')
{
$lang = get_language($ruta_base);
include_once $ruta_base . "modules/{$module_id}/lang/en.lang";
$lang_file_module = $ruta_base . "modules/{$module_id}/lang/{$lang}.lang";
if ($lang != 'en' && file_exists("{$lang_file_module}")) {
$arrLangEN = $arrLangModule;
include_once "{$lang_file_module}";
$arrLangModule = array_merge($arrLangEN, $arrLangModule);
}
global $arrLang;
global $arrLangModule;
$arrLang = array_merge($arrLang, $arrLangModule);
}
示例14: CargarIdiomas
function CargarIdiomas()
{
global $arrConf;
$module_name = "summary_by_extension";
include_once $arrConf['basePath'] . "/libs/misc.lib.php";
$lang = get_language($arrConf['basePath'] . '/');
if (file_exists($arrConf['basePath'] . "/modules/{$module_name}/lang/{$lang}.lang")) {
include_once $arrConf['basePath'] . "/modules/{$module_name}/lang/{$lang}.lang";
} else {
include_once $arrConf['basePath'] . "/modules/{$module_name}/lang/en.lang";
}
global $arrLangModule;
$this->arrLang = $arrLangModule;
}
示例15: formLanguage
function formLanguage($smarty, $module_name, $local_templates_dir, $arrConf, $pACL, $uid)
{
global $arrPermission;
$lang = get_language();
$error_msg = '';
$archivos = array();
$langElastix = array();
$contenido = '';
$msgError = '';
$arrDefaultRate = array();
$conexionDB = FALSE;
include "configs/languages.conf.php";
//este archivo crea el arreglo language que contine los idiomas soportados
//por elastix
leer_directorio("/usr/share/elastix/lang", $error_msg, $archivos);
if (count($archivos) > 0) {
foreach ($languages as $lang => $lang_name) {
if (in_array("{$lang}.lang", $archivos)) {
$langElastix[$lang] = $lang_name;
}
}
}
if (count($langElastix) > 0) {
$arrFormLanguage = createFieldForm($langElastix);
$oForm = new paloForm($smarty, $arrFormLanguage);
if (empty($pACL->errMsg)) {
$conexionDB = TRUE;
} else {
$msgError = _tr("You can't change language") . '.-' . _tr("ERROR") . ":" . $pACL->errMsg;
}
// $arrDefaultRate['language']="es";
$smarty->assign("CAMBIAR", _tr("Save"));
$smarty->assign("MSG_ERROR", $msgError);
$smarty->assign("conectiondb", $conexionDB);
$smarty->assign("icon", "web/apps/{$module_name}/images/system_preferencies_language.png");
if (in_array('edit', $arrPermission)) {
$smarty->assign('EDIT_LANG', true);
}
//obtener el valor del lenguage por defecto
$defLang = $pACL->getUserProp($uid, 'language');
if (empty($defLang) || $defLang === false) {
$defLang = "en";
}
$arrDefault['language'] = $defLang;
$htmlForm = $oForm->fetchForm("{$local_templates_dir}/language.tpl", _tr("Language"), $arrDefault);
$contenido = "<form method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
}
return $contenido;
}