本文整理汇总了PHP中Translations::setLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Translations::setLanguage方法的具体用法?PHP Translations::setLanguage怎么用?PHP Translations::setLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translations
的用法示例。
在下文中一共展示了Translations::setLanguage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupGlobalVars
function setupGlobalVars($type, $opts = array())
{
global $coach, $lng, $leagues, $divisions, $tours, $settings, $rules, $admin_menu;
switch ($type) {
case T_SETUP_GLOBAL_VARS__COMMON:
$coach = isset($_SESSION['logged_in']) ? new Coach($_SESSION['coach_id']) : null;
# Create global coach object.
list($leagues, $divisions, $tours) = Coach::allowedNodeAccess(Coach::NODE_STRUCT__FLAT, is_object($coach) ? $coach->coach_id : false, $extraFields = array(T_NODE_TOURNAMENT => array('locked' => 'locked', 'type' => 'type', 'f_did' => 'f_did'), T_NODE_DIVISION => array('f_lid' => 'f_lid'), T_NODE_LEAGUE => array('tie_teams' => 'tie_teams')));
setupGlobalVars(T_SETUP_GLOBAL_VARS__LOAD_LEAGUE_SETTINGS);
$_LANGUAGE = is_object($coach) && isset($coach->settings['lang']) ? $coach->settings['lang'] : $settings['lang'];
if (!is_object($lng)) {
$lng = new Translations($_LANGUAGE);
} else {
$lng->setLanguage($_LANGUAGE);
}
break;
case T_SETUP_GLOBAL_VARS__POST_LOAD_MODULES:
$admin_menu = is_object($coach) ? $coach->getAdminMenu() : array();
break;
case T_SETUP_GLOBAL_VARS__LOAD_LEAGUE_SETTINGS:
// Local league settings exist?
$file = "localsettings/settings_ID.php";
// Update selected node $_SESSION vars if node selector form submission made (will make HTMLOUT::getSelectedNodeLid(), below, catch the correct league straight as opposed to on second page reload).
HTMLOUT::updateNodeSelectorLeagueVars();
// Selected
if (isset($opts['lid']) && is_numeric($opts['lid'])) {
$id = $opts['lid'];
} else {
if ($_lid = HTMLOUT::getSelectedNodeLid()) {
$id = $_lid;
} else {
if (is_object($coach) && isset($coach->settings['home_lid'])) {
$id = $coach->settings['home_lid'];
} else {
$id = isset($settings['default_visitor_league']) ? $settings['default_visitor_league'] : '';
}
}
}
$settingsFile = str_replace("ID", $id, $file);
if ($localsettings = file_exists($settingsFile) ? $settingsFile : false) {
include $localsettings;
} else {
include str_replace("ID", 'none', $file);
# Empty settings file.
}
break;
case T_SETUP_GLOBAL_VARS__POST_COACH_LOGINOUT:
setupGlobalVars(T_SETUP_GLOBAL_VARS__COMMON);
setupGlobalVars(T_SETUP_GLOBAL_VARS__POST_LOAD_MODULES);
break;
}
}