本文整理汇总了PHP中get_languages函数的典型用法代码示例。如果您正苦于以下问题:PHP get_languages函数的具体用法?PHP get_languages怎么用?PHP get_languages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_languages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: language_controler_flags
function language_controler_flags()
{
global $user, $template, $conf, $page;
$available_lang = get_languages();
if (isset($conf['no_flag_languages'])) {
$available_lang = array_diff_key($available_lang, array_flip($conf['no_flag_languages']));
}
$url_starting = get_query_string_diff(array('lang'));
if (isset($page['section']) and $page['section'] == 'additional_page' and isset($page['additional_page'])) {
$base_url = make_index_url(array('section' => 'page')) . '/' . (isset($page['additional_page']['permalink']) ? $page['additional_page']['permalink'] : $page['additional_page']['id']);
} else {
$base_url = duplicate_index_url();
}
foreach ($available_lang as $code => $displayname) {
$qlc = array('url' => add_url_params($base_url, array('lang' => $code)), 'alt' => ucwords($displayname), 'title' => substr($displayname, 0, -4), 'code' => $code);
$lsw['flags'][$code] = $qlc;
if ($code == $user['language']) {
$lsw['Active'] = $qlc;
}
}
$safe_themes = array('clear', 'dark', 'elegant', 'Sylvia', 'simple-grey', 'simple-black', 'simple-white', 'kardon', 'luciano', 'montblancxl');
// stripped (2.6)
$template->assign(array('lang_switch' => $lsw, 'LANGUAGE_SWITCH_PATH' => LANGUAGE_SWITCH_PATH, 'LANGUAGE_SWITCH_LOAD_STYLE' => !in_array($user['theme'], $safe_themes)));
$template->set_filename('language_flags', dirname(__FILE__) . '/flags.tpl');
$template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('language_flags', true));
$template->clear_assign('lang_switch');
}
示例2: admin_texte
function admin_texte()
{
global $db, $countries;
if (isset($_POST['submit'])) {
foreach ($_POST as $key => $value) {
if (strpos($key, '_h_')) {
$lang = substr($key, 0, strpos($key, '_'));
$name = substr($key, strpos($key, '_') + 3);
$sql = sprintf('UPDATE ' . DB_PRE . 'ecp_texte SET content = \'%s\', content2 = \'%s\' WHERE name= \'%s\' AND lang = \'%s\';', strsave($_POST[$lang . '_' . $name]), strsave($value), strsave($name), strsave($lang));
$db->query($sql);
}
}
header('Location: ?section=admin&site=texte');
} else {
$tpl = new smarty();
$lang = get_languages();
$db->query('SELECT * FROM ' . DB_PRE . 'ecp_texte ORDER BY lang ASC');
while ($row = $db->fetch_assoc()) {
foreach ($lang as $key => $value) {
if ($value['lang'] == $row['lang']) {
$lang[$key]['data'][$row['name']] = htmlspecialchars($row['content']);
$lang[$key]['headline'][$row['name']] = htmlspecialchars($row['content2']);
}
}
}
$tpl->assign('lang', $lang);
ob_start();
$tpl->display(DESIGN . '/tpl/admin/texte.html');
$content = ob_get_contents();
ob_end_clean();
main_content(TEXTE, $content, '', 1);
}
}
示例3: site_settings_options
public function site_settings_options()
{
// Process installed realms
$query = "SELECT `id`, `name` FROM `pcms_realms`";
$result = $this->DB->query($query)->fetchAll();
// Create our realms options
if ($result != FALSE && !empty($result)) {
$default = config('default_realm_id');
foreach ($result as $realm) {
// Get our selected option
$selected = '';
if ($default == $realm['id']) {
$selected = 'selected="selected" ';
}
// Add the language folder to the array
$realms[] = '<option value="' . $realm['id'] . '" ' . $selected . '>' . $realm['name'] . '</option>';
}
} else {
// No realms installed
$realms[] = '<option value="0">No realms Installed!</option>';
}
// Process installed templates
$default = config('default_templates');
$list = get_installed_templates();
foreach ($list as $file) {
// Get our selected option
$selected = '';
$name = $file['name'];
if ($default == $name) {
$selected = 'selected="selected" ';
}
// Add the language folder to the array
$templates[] = '<option value="' . $name . '" ' . $selected . '>' . $name . '</option>';
}
// Process languages
$default = config('default_language');
$list = get_languages();
foreach ($list as $file) {
// Get our selected option
$selected = '';
if ($default == $file) {
$selected = 'selected="selected" ';
}
// Add the language folder to the array
$languages[] = '<option value="' . $file . '" ' . $selected . '>' . ucfirst($file) . '</option>';
}
// Process installed emulators
$default = config('emulator');
$list = get_emulators();
foreach ($list as $name) {
// Get our selected option
$selected = '';
if ($default == $name) {
$selected = 'selected="selected" ';
}
// Add the language folder to the array
$emu[] = '<option value="' . $name . '" ' . $selected . '>' . ucfirst($name) . '</option>';
}
return array('realms' => $realms, 'templates' => $templates, 'languages' => $languages, 'emulators' => $emu);
}
示例4: show_header
/**
* @version $Id: header.php 187 2011-01-18 15:25:24Z soeren $
* @package eXtplorer
* @copyright soeren 2007-2009
* @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
* @author The The QuiX project (http://quixplorer.sourceforge.net)
*
* @license
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU General Public License Version 2 or later (the "GPL"), in
* which case the provisions of the GPL are applicable instead of
* those above. If you wish to allow use of your version of this file only
* under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this file
* under either the MPL or the GPL."
*
* This is the file, which prints the header row with the Logo
*/
function show_header($dirlinks = '')
{
$url = str_replace(array('&dir=', '&action=', '&file_mode='), array('&a=', '&b=', '&c='), $_SERVER['REQUEST_URI']);
$url_appendix = strpos($url, '?') === false ? '?' : '&';
echo "<link rel=\"stylesheet\" href=\"" . _EXT_URL . "/style/style.css\" type=\"text/css\" />\n";
echo "<div id=\"ext_header\">\n";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n";
$mode = extGetParam($_SESSION, 'file_mode', $GLOBALS['ext_conf']['authentication_method_default']);
$logoutlink = ' <a href="' . $GLOBALS['script_name'] . '?option=com_extplorer&action=logout" title="' . $GLOBALS['messages']['logoutlink'] . '">[' . $GLOBALS['messages']['logoutlink'] . ']</a>';
$alternate_modes = array();
foreach ($GLOBALS['ext_conf']['authentication_methods_allowed'] as $method) {
if ($method != $mode) {
$onclick = '';
if (empty($_SESSION['credentials_' . $method])) {
$onclick = "onclick=\"openActionDialog('switch_file_mode', '" . $method . "_authentication');return false;\"";
}
$alternate_modes[] = "<a {$onclick} href=\"{$url}" . $url_appendix . "file_mode={$method}\">{$method}</a>";
}
}
echo '<tr><td width="20%">';
if (is_object($GLOBALS['_VERSION']) || class_exists('jversion')) {
echo '<a href="' . basename($_SERVER['SCRIPT_NAME']) . '">Back to ' . (!empty($GLOBALS['_VERSION']->PRODUCT) ? @$GLOBALS['_VERSION']->PRODUCT : 'Joomla!') . '</a>';
} else {
echo ext_selectList('language_selector', $GLOBALS['language'], get_languages(), 1, '', 'onchange="document.location.href=\'' . $GLOBALS['script_name'] . '?lang=\' + this.options[this.selectedIndex].value;"');
}
// Logo
echo "</td><td style=\"color:black;\" width=\"10%\">";
//echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
echo "<a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\" title=\"eXtplorer Project\">\r\n\t\t<img src=\"" . _EXT_URL . "/images/eXtplorer_logo.png\" alt=\"eXtplorer Logo\" border=\"0\" /></a>\r\n\t\t</td>";
//echo "</div>";
echo "<td style=\"padding-left: 15px; color:black;\" id=\"bookmark_container\" width=\"35%\"></td>\n";
echo "<td width=\"25%\" style=\"padding-left: 15px; color:black;\">" . sprintf($GLOBALS['messages']['switch_file_mode'], $mode . $logoutlink, implode(', ', $alternate_modes)) . "\r\n\t</td>\n";
echo '</tr></table>';
echo '</div>';
}
示例5: show_header
/**
* @version $Id: header.php 116 2009-01-15 20:39:58Z soeren $
* @package eXtplorer
* @copyright soeren 2007
* @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
* @author The The QuiX project (http://quixplorer.sourceforge.net)
*
* @license
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU General Public License Version 2 or later (the "GPL"), in
* which case the provisions of the GPL are applicable instead of
* those above. If you wish to allow use of your version of this file only
* under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this file
* under either the MPL or the GPL."
*
* This is the file, which prints the header row with the Logo
*/
function show_header($dirlinks = '')
{
$url = str_replace('&dir=', '&ignore=', $_SERVER['REQUEST_URI']);
$url_appendix = strpos($url, '?') === false ? '?' : '&';
echo "<link rel=\"stylesheet\" href=\"" . _EXT_URL . "/style/style.css\" type=\"text/css\" />\n";
echo "<div id=\"ext_header\">\n";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n";
$mode = extGetParam($_SESSION, 'file_mode', 'file');
$logoutlink = $mode == 'ftp' ? ' <a href="' . $GLOBALS['script_name'] . '?option=com_extplorer&action=ftp_logout" title="' . $GLOBALS['messages']['logoutlink'] . '">[' . $GLOBALS['messages']['logoutlink'] . ']</a>' : '';
$alternate_mode = $mode == 'file' ? 'ftp' : 'file';
echo '<tr><td width="20%">';
if (is_object($GLOBALS['_VERSION']) || class_exists('jversion')) {
echo "<a href=\"index2.php\">Back to " . (!empty($GLOBALS['_VERSION']->PRODUCT) ? @$GLOBALS['_VERSION']->PRODUCT : 'Joomla!') . '</a>';
} else {
echo ext_selectList('language_selector', $GLOBALS['language'], get_languages(), 1, '', 'onchange="document.location.href=\'' . $GLOBALS['script_name'] . '?lang=\' + this.options[this.selectedIndex].value;"');
}
// Logo
echo "</td><td style=\"color:black;\" width=\"10%\">";
//echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
echo "<a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\" title=\"eXtplorer Project\">\r\n\t\t<img src=\"" . _EXT_URL . "/images/eXtplorer.gif\" alt=\"eXtplorer Logo\" border=\"0\" /></a>\r\n\t\t</td>";
//echo "</div>";
echo "<td style=\"padding-left: 15px; color:black;\" id=\"bookmark_container\" width=\"35%\"></td>\n";
echo "<td width=\"25%\" style=\"padding-left: 15px; color:black;\">" . sprintf($GLOBALS['messages']['switch_file_mode'], $mode . $logoutlink, "<a id=\"switch_file_mode\" href=\"{$url}" . $url_appendix . "file_mode={$alternate_mode}\">{$alternate_mode}</a>") . "\r\n\t</td>\n";
echo '</tr></table>';
echo '</div>';
}
示例6: lang_load
function lang_load($cfglang)
{
$lang = array();
if ($cfglang != "") {
include_once LANG_FILE_LOCATION . $cfglang . '.php';
} else {
include_once LANG_FILE_LOCATION . get_languages('header') . '.php';
}
return $lang;
}
示例7: display
/**
* @see SugarView::display()
*/
public function display()
{
global $current_user, $mod_strings, $app_list_strings, $sugar_config, $locale, $sugar_version;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$themeObject = SugarThemeRegistry::current();
$configurator = new Configurator();
$sugarConfig = SugarConfig::getInstance();
$focus = new Administration();
$focus->retrieveSettings();
$ut = $GLOBALS['current_user']->getPreference('ut');
if (empty($ut)) {
$this->ss->assign('SKIP_URL', 'index.php?module=Users&action=Wizard&skipwelcome=1');
} else {
$this->ss->assign('SKIP_URL', 'index.php?module=Home&action=index');
}
// Always mark that we have got past this point
$focus->saveSetting('system', 'adminwizard', 1);
$css = $themeObject->getCSS();
$favicon = $themeObject->getImageURL('sugar_icon.ico', false);
$this->ss->assign('FAVICON_URL', getJSPath($favicon));
$this->ss->assign('SUGAR_CSS', $css);
$this->ss->assign('MOD_USERS', return_module_language($GLOBALS['current_language'], 'Users'));
$this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="' . SugarThemeRegistry::current()->getCSSURL('wizard.css') . '" />');
$this->ss->assign('LANGUAGES', get_languages());
$this->ss->assign('config', $sugar_config);
$this->ss->assign('SUGAR_VERSION', $sugar_version);
$this->ss->assign('settings', $focus->settings);
$this->ss->assign('exportCharsets', get_select_options_with_id($locale->getCharsetSelect(), $sugar_config['default_export_charset']));
$this->ss->assign('getNameJs', $locale->getNameJs());
$this->ss->assign('NAMEFORMATS', $locale->getUsableLocaleNameOptions($sugar_config['name_formats']));
$this->ss->assign('JAVASCRIPT', get_set_focus_js() . get_configsettings_js());
$this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
$this->ss->assign('mail_smtptype', $focus->settings['mail_smtptype']);
$this->ss->assign('mail_smtpserver', $focus->settings['mail_smtpserver']);
$this->ss->assign('mail_smtpport', $focus->settings['mail_smtpport']);
$this->ss->assign('mail_smtpuser', $focus->settings['mail_smtpuser']);
$this->ss->assign('mail_smtppass', $focus->settings['mail_smtppass']);
$this->ss->assign('mail_smtpauth_req', $focus->settings['mail_smtpauth_req'] ? "checked='checked'" : '');
$this->ss->assign('MAIL_SSL_OPTIONS', get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
$this->ss->assign('notify_allow_default_outbound_on', !empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound'] == 2 ? 'CHECKED' : '');
$this->ss->assign('THEME', SugarThemeRegistry::current()->__toString());
// get javascript
ob_start();
$this->options['show_javascript'] = true;
$this->renderJavascript();
$this->options['show_javascript'] = false;
$this->ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
ob_end_clean();
$this->ss->assign('langHeader', get_language_header());
$this->ss->assign('START_PAGE', !empty($_REQUEST['page']) ? $_REQUEST['page'] : 'welcome');
$this->ss->display('modules/Configurator/tpls/adminwizard.tpl');
}
示例8: config_form
function config_form()
{
global $phpc_script, $phpc_user_tz, $phpc_user_lang, $phpc_token;
$tz_input = create_multi_select('timezone', get_timezone_list(), $phpc_user_tz);
$languages = array("" => __("Default"));
foreach (get_languages() as $lang) {
$languages[$lang] = $lang;
}
$lang_input = create_select('language', $languages, $phpc_user_lang);
$form = tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes("class=\"phpc-container\""), tag('caption', __('Settings')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('phpc_token', $phpc_token), create_hidden('action', 'settings'), create_hidden('phpc_submit', 'settings'), create_submit(__('Submit'))))), tag('tbody', tag('tr', tag('th', __('Timezone')), tag('td', $tz_input)), tag('tr', tag('th', __('Language')), tag('td', $lang_input)))));
return tag('div', attrs('id="phpc-config"'), $form);
}
示例9: admin_calendar
function admin_calendar()
{
global $db, $countries;
$tpl = new smarty();
$tpl->assign('events', get_events());
$tpl->assign('lang', get_languages());
$tpl->assign('rights', get_form_rights());
ob_start();
$tpl->display(DESIGN . '/tpl/admin/calendar.html');
$content = ob_get_contents();
ob_end_clean();
main_content(CALENDAR, $content, '', 1);
}
示例10: admin_cms
function admin_cms()
{
global $db;
$tpl = new Smarty();
$tpl->assign('cms', get_cms());
$tpl->assign('lang', get_languages());
$tpl->assign('rights', get_form_rights(@$_POST['rights']));
ob_start();
$tpl->display(DESIGN . '/tpl/admin/cms.html');
$content = ob_get_contents();
ob_end_clean();
main_content(OWN_SITES, $content, '', 1);
}
示例11: template_edit
public function template_edit($uID = NULL)
{
if (!isset($uID) || !is_numeric($uID)) {
show_404();
}
if ($this->input->is_ajax_request()) {
if ($this->input->post('ajax_submit')) {
// Libreary
$this->load->library('form_validation');
// Validation Rules
foreach (get_languages(TRUE) as $language) {
$this->form_validation->set_rules('templates[' . $language['uID'] . '][subject]', tr('_GLOBAL_subject_'), 'required|max_length[255]|trim');
}
// Return Data
$json = array('csrf' => array($this->security->get_csrf_token_name() => $this->security->get_csrf_hash()));
// Check Validation
if (!$this->form_validation->run()) {
$json['status'] = FALSE;
$json['message'] = validation_errors();
// Validation Rules
foreach (get_languages(TRUE) as $language) {
$json['rules']['templates[' . $language['uID'] . '][subject]'] = form_error('templates[' . $language['uID'] . '][subject]') ? 'has-error' : 'has-success';
}
} else {
// Load library
$this->load->model('backend/emails_model');
// Form Values
$form['uID'] = $uID;
$form['subject'] = $this->input->post('key', TRUE);
$form['templates'] = $this->input->post('templates', FALSE);
if ($this->emails_model->template_edit($form)) {
$json['status'] = TRUE;
$json['message'] = tr('_PAGE_BACKEND_LANGUAGES_SUCCESS_edit_template_');
} else {
$json['status'] = FALSE;
$json['message'] = tr('_PAGE_BACKEND_LANGUAGES_ERROR_edit_template_');
}
}
// Output
$this->output->set_header('Content-Type: application/json; charset=utf-8')->set_content_type('application/json')->set_output(json_encode($json));
} else {
// Load Model
$this->load->model('backend/emails_model');
// Load Template
$data['data'] = $this->emails_model->template_get($uID);
// Load View
$this->template->view('emails/modal/_template_edit', $data);
}
}
}
示例12: admin_settings
function admin_settings()
{
global $db, $countries;
if (isset($_POST['submit'])) {
unset($_POST['submit']);
$_POST['SITE_URL'] = strrpos($_POST['SITE_URL'], '/') !== strlen($_POST['SITE_URL']) - 1 ? check_url($_POST['SITE_URL'] . '/') : check_url($_POST['SITE_URL']);
$sql = 'UPDATE ' . DB_PRE . 'ecp_settings SET ';
foreach ($_POST as $key => $value) {
$sql .= $key . ' = "' . strsave($value) . '", ';
}
$sql = substr($sql, 0, strlen($sql) - 2);
if ($db->query($sql)) {
header('Location: ?section=admin&site=settings');
}
} else {
$dir = scan_dir('templates', true);
$designs = '';
foreach ($dir as $value) {
if (is_dir('templates/' . $value)) {
$designs .= '<option ' . ($value == DESIGN ? 'selected="selected"' : '') . ' value="' . $value . '">' . $value . '</option>';
}
}
$tpl = new smarty();
$tpl->assign('designs', $designs);
$tpl->assign('langs', get_languages());
$dir = scan_dir('module', true);
$start = '';
foreach ($dir as $value) {
if (is_dir('module/' . $value)) {
$start .= '<option ' . ('modul|' . $value == STARTSEITE ? 'selected="selected"' : '') . ' value="modul|' . $value . '">' . $value . '</option>';
}
}
$start .= '<option value="">-----' . OWN_SITES . '----</option>';
$db->query('SELECT headline, cmsID FROM ' . DB_PRE . 'ecp_cms ORDER BY headline ASC');
while ($row = $db->fetch_assoc()) {
$title = json_decode($row['headline'], true);
isset($title[LANGUAGE]) ? $title = $title[LANGUAGE] : ($title = $title[DEFAULT_LANG]);
$start .= '<option ' . ('cms|' . $row['cmsID'] == STARTSEITE ? 'selected="selected"' : '') . ' value="cms|' . $row['cmsID'] . '">' . $title . '</option>';
}
$tpl->assign('startseite', $start);
ob_start();
$tpl->display(DESIGN . '/tpl/admin/settings.html');
$content = ob_get_contents();
ob_end_clean();
main_content(SETTINGS, $content, '', 1);
}
}
示例13: get_language_select_options
function get_language_select_options($default = "")
{
$str = "";
$json = json_decode(get_languages());
$str .= '<option value="">wie Album</option>';
$str .= "\n";
foreach ($json as $language) {
$str .= '<option value="' . $language->id . '" ';
if (isset($default) && (string) $language->id == $default) {
$str .= "selected";
}
$str .= ' >';
$str .= $language->language . '</option>';
$str .= "\n";
}
return $str;
}
示例14: run
public function run()
{
if (empty($this->upgrader->state['old_moduleList'])) {
$this->log("Did not find old modules?");
return;
}
include 'include/language/en_us.lang.php';
$en_strings = $app_list_strings;
$newModules = array_diff($en_strings['moduleList'], $this->upgrader->state['old_moduleList']);
if (empty($newModules)) {
return;
}
$this->log("New modules to add: " . var_export($newModules, true));
$keyList = array('moduleList', 'moduleListSingular');
foreach (get_languages() as $langKey => $langName) {
if (!file_exists("custom/include/language/{$langKey}.lang.php")) {
// no custom file, nothing to do
continue;
}
$app_list_strings = array();
if (file_exists("include/language/{$langKey}.lang.php")) {
include "include/language/{$langKey}.lang.php";
}
$orig_lang_strings = $app_list_strings;
$all_strings = return_app_list_strings_language($langKey);
$addModStrings = array();
foreach ($newModules as $modKey => $modName) {
foreach ($keyList as $appKey) {
if (empty($all_strings[$appKey][$modKey])) {
if (!empty($orig_lang_strings[$appKey][$modKey])) {
$addModStrings[$appKey][$modKey] = $orig_lang_strings[$appKey][$modKey];
} elseif (!empty($en_strings[$appKey][$modKey])) {
$addModStrings[$appKey][$modKey] = $en_strings[$appKey][$modKey];
} else {
$this->log("Weird, did not find name in {$appKey} for {$modKey} in {$langKey}");
$addModStrings[$appKey][$modKey] = $modKey;
}
}
}
}
if (!empty($addModStrings)) {
$this->updateCustomFile($langKey, $addModStrings);
}
}
}
示例15: __construct
/**
* Constructor
*/
function __construct()
{
parent::__construct();
// get settings
$settings = $this->settings_model->get_settings();
$this->settings = new stdClass();
foreach ($settings as $setting) {
$this->settings->{$setting['name']} = @unserialize($setting['value']) !== FALSE ? unserialize($setting['value']) : $setting['value'];
}
$this->settings->site_version = $this->config->item('site_version');
$this->settings->root_folder = $this->config->item('root_folder');
// get current uri
$this->current_uri = "/" . uri_string();
// set the time zone
$timezones = $this->config->item('timezones');
date_default_timezone_set($timezones[$this->settings->timezones]);
// get current user
$this->user = $this->session->userdata('logged_in');
// get languages
$this->languages = get_languages();
// set language according to this priority:
// 1) First, check session
// 2) If session not set, use the users language
// 3) Finally, if no user, use the configured languauge
if ($this->session->language) {
// language selected from nav
$this->config->set_item('language', $this->session->language);
} elseif ($this->user['language']) {
// user's saved language
$this->config->set_item('language', $this->user['language']);
} else {
// default language
$this->config->set_item('language', $this->config->item('language'));
}
// save selected language to session
$this->session->language = $this->config->item('language');
// load the core language file
$this->lang->load('core');
// set global header data - can be merged with or overwritten in controllers
$this->add_external_css(array("//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css", "//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css", "//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css", "/themes/core/css/core.css"))->add_external_js(array("//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", "//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"));
$this->includes['js_files_i18n'] = array($this->jsi18n->translate("/themes/core/js/core_i18n.js"));
// enable the profiler?
$this->output->enable_profiler($this->config->item('profiler'));
}