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

PHP get_languages函数代码示例

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

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



在下文中一共展示了get_languages函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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');
}
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:27,代码来源:language_switch.inc.php


示例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);
     }
 }
开发者ID:ECP-Black,项目名称:ECP,代码行数:33,代码来源:texte.php


示例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);
 }
开发者ID:Kheros,项目名称:Plexis,代码行数:60,代码来源:admin_model.php


示例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 ? '?' : '&amp;';
    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&amp;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>';
}
开发者ID:elevenfox,项目名称:VTree,代码行数:66,代码来源:header.php


示例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 ? '?' : '&amp;';
    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&amp;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>';
}
开发者ID:planetangel,项目名称:Planet-Angel-Website,代码行数:57,代码来源:header.php


示例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;
}
开发者ID:bwssytems,项目名称:domuslink,代码行数:10,代码来源:lang.func.php


示例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');
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:57,代码来源:view.adminwizard.php


示例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);
}
开发者ID:Godjqb,项目名称:Php-test,代码行数:12,代码来源:settings.php


示例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);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:13,代码来源:calendar.php


示例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);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:13,代码来源:cms.php


示例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);
         }
     }
 }
开发者ID:xemmex,项目名称:codeigniter3-website-template,代码行数:50,代码来源:Emails.php


示例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);
     }
 }
开发者ID:ECP-Black,项目名称:ECP,代码行数:47,代码来源:settings.php


示例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;
}
开发者ID:BackupTheBerlios,项目名称:gdrestfulwebint-svn,代码行数:17,代码来源:inc.helpers.php


示例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);
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:45,代码来源:4_NewModules.php


示例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'));
 }
开发者ID:Morvatud,项目名称:ci3-fire-starter,代码行数:47,代码来源:MY_Controller.php


示例16: getJSLanguage

/**
 * Retrieves the requested js language file, building it if it doesn't exist.
 */
function getJSLanguage()
{
    require_once 'include/language/jsLanguage.php';
    global $app_list_strings;
    if (empty($_REQUEST['lang'])) {
        echo "No language specified";
        return;
    }
    $lang = clean_path($_REQUEST['lang']);
    $languages = get_languages();
    if (!preg_match("/^\\w\\w_\\w\\w\$/", $lang) || !isset($languages[$lang])) {
        if (!preg_match("/^\\w\\w_\\w\\w\$/", $lang)) {
            echo "did not match regex<br/>";
        } else {
            echo "{$lang} was not in list . <pre>" . print_r($languages, true) . "</pre>";
        }
        echo "Invalid language specified";
        return;
    }
    if (empty($_REQUEST['module']) || $_REQUEST['module'] === 'app_strings') {
        $file = sugar_cached('jsLanguage/') . $lang . '.js';
        if (!sugar_is_file($file)) {
            $jsLanguage = new jsLanguage();
            $jsLanguage->createAppStringsCache($lang);
        }
    } else {
        $module = clean_path($_REQUEST['module']);
        $fullModuleList = array_merge($GLOBALS['moduleList'], $GLOBALS['modInvisList']);
        if (!isset($app_list_strings['moduleList'][$module]) && !in_array($module, $fullModuleList)) {
            echo "Invalid module specified";
            return;
        }
        $file = sugar_cached('jsLanguage/') . $module . "/" . $lang . '.js';
        if (!sugar_is_file($file)) {
            jsLanguage::createModuleStringsCache($module, $lang);
        }
    }
    //Setup cache headers
    header("Content-Type: application/javascript");
    header("Cache-Control: max-age=31556940, private");
    header("Pragma: ");
    header("Expires: " . gmdate('D, d M Y H:i:s \\G\\M\\T', time() + 31556940));
    readfile($file);
}
开发者ID:BilalArcher,项目名称:SuiteCRM,代码行数:47,代码来源:getJSLanguage.php


示例17: admin_awards

function admin_awards()
{
    global $db;
    $awards = array();
    $db->query('SELECT `awardID`, `eventname`, `eventdatum`, `url`, `platz` FROM ' . DB_PRE . 'ecp_awards ORDER BY eventdatum DESC');
    while ($row = $db->fetch_assoc()) {
        $row['eventdatum'] = date('d.m.Y', $row['eventdatum']);
        $awards[] = $row;
    }
    $tpl = new Smarty();
    $tpl->assign('awards', $awards);
    $tpl->assign('teams', get_teams_form());
    $tpl->assign('games', get_games_form());
    $tpl->assign('lang', get_languages());
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/awards.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(AWARDS, $content, '', 1);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:20,代码来源:awards.php


示例18: admin_downloads

function admin_downloads()
{
    global $db;
    $tpl = new smarty();
    $tpl->assign('lang', get_languages());
    $tpl->assign('rights', get_form_rights(@$_POST['rights']));
    $tpl->assign('kate', download_get_cate(@$_POST['subID']));
    $db->query('SELECT name, dID FROM ' . DB_PRE . 'ecp_downloads ORDER BY name ASC');
    $dl = '<option value="0">' . CHOOSE . '</option>';
    while ($row = $db->fetch_assoc()) {
        $dl .= '<option value="' . $row['dID'] . '">' . $row['name'] . '</option>';
    }
    $tpl->assign('dls', $dl);
    //foreach($_POST AS $key=>$value) $tpl->assign($key, $value);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/downloads.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(DOWNLOADS, $content, '', 1);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:20,代码来源:downloads.php


示例19: __construct

 function __construct(&$config, $dn = NULL, $object = NULL)
 {
     #definition des variables
     $attributesInfo = self::getAttributesInfo();
     /* Languages */
     $languages = get_languages(TRUE);
     asort($languages);
     $languages = array_merge(array("" => _("Automatic")), $languages);
     $attributesInfo['look_n_feel']['attrs'][0]->setChoices(array_keys($languages), array_values($languages));
     /* Timezones */
     $attributesInfo['look_n_feel']['attrs'][2]->setChoices(timezone::_get_tz_zones());
     /* Password methods */
     $methods = passwordMethod::get_available_methods();
     $methods = $methods['name'];
     $attributesInfo['password']['attrs'][0]->setChoices($methods);
     parent::__construct($config, $dn, $object, $attributesInfo);
     $this->fusionConfigMd5 = md5_file(CACHE_DIR . "/" . CLASS_CACHE);
     $this->attributesAccess['fdEnableSnapshots']->setManagedAttributes(array('disable' => array(FALSE => array('fdSnapshotBase'))));
     $this->attributesAccess['fdForceSSL']->setManagedAttributes(array('disable' => array(TRUE => array('fdWarnSSL'))));
     $this->attributesAccess['fdIdAllocationMethod']->setManagedAttributes(array('erase' => array('traditional' => array('fdUidNumberPoolMin', 'fdUidNumberPoolMax', 'fdGidNumberPoolMin', 'fdGidNumberPoolMax'))));
 }
开发者ID:anne-nicolas,项目名称:depot_main,代码行数:21,代码来源:class_configInLdap.php


示例20: display

 public function display()
 {
     global $mod_strings, $locale;
     $bak_mod_strings = $mod_strings;
     $smarty = new Sugar_Smarty();
     $smarty->assign('mod_strings', $mod_strings);
     $package_name = $_REQUEST['view_package'];
     $module_name = $_REQUEST['view_module'];
     require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
     $mb = new ModuleBuilder();
     $mb->getPackage($_REQUEST['view_package']);
     $package = $mb->packages[$_REQUEST['view_package']];
     $package->getModule($module_name);
     $mbModule = $package->modules[$module_name];
     if (!empty($_REQUEST['selected_lang'])) {
         $selected_lang = $_REQUEST['selected_lang'];
     } else {
         $selected_lang = $locale->getAuthenticatedUserLanguage();
     }
     //need to change the following to interface with MBlanguage.
     $smarty->assign('MOD', $mbModule->getModStrings($selected_lang));
     $smarty->assign('APP', $GLOBALS['app_strings']);
     $smarty->assign('selected_lang', $selected_lang);
     $smarty->assign('view_package', $package_name);
     $smarty->assign('view_module', $module_name);
     $smarty->assign('mb', '1');
     $smarty->assign('available_languages', get_languages());
     /////////////// 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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