当前位置: 首页>>代码示例>>PHP>>正文


PHP icl_disp_language函数代码示例

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


在下文中一共展示了icl_disp_language函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mbdmaster_languages_list

function mbdmaster_languages_list()
{
    if (function_exists(icl_get_languages)) {
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if (!empty($languages)) {
            echo '<div id="language-selector"><ul>';
            foreach ($languages as $l) {
                if (!$l['active']) {
                    echo '<li class="active">';
                } else {
                    echo '<li class="inactive">';
                }
                if (!$l['active']) {
                    echo '<a href="' . $l['url'] . '">';
                }
                echo icl_disp_language($l['native_name'], $l['translated_name']);
                if (!$l['active']) {
                    echo '</a>';
                }
                echo '</li>';
            }
            echo '</ul></div>';
        }
    }
}
开发者ID:markbaindesign,项目名称:mbd-wp-theme,代码行数:25,代码来源:language-switcher.php

示例2: display_language_menu_accordion

function display_language_menu_accordion()
{
    $menu = "";
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    if (!empty($languages)) {
        $menu .= '<div class="ui inverted accordion">';
        $menu .= '<div class="active title">';
        $menu .= '<i class="dropdown icon"></i>';
        $menu .= __('Languages', 'sage');
        $menu .= '<i class="translate icon"></i>';
        $menu .= '</div>';
        $menu .= '<div class="active content">';
        foreach ($languages as $l) {
            if (!$l['active']) {
                $menu .= "<a class=\"item\" href=\"" . $l['url'] . "\">";
                $menu .= icl_disp_language($l['native_name'], $l['translated_name']);
                $menu .= '</a>';
            } else {
                $menu .= "<a class=\"item\" href=\"#\">";
                $menu .= icl_disp_language($l['native_name'], $l['translated_name']);
                $menu .= '</a>';
            }
        }
        $menu .= "</div>";
        $menu .= "</div>";
    }
    echo $menu;
}
开发者ID:gabzon,项目名称:experiensa,代码行数:28,代码来源:languages.php

示例3: add_language_switcher

function add_language_switcher($items, $args)
{
    if ($args->theme_location == 'main') {
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if (!empty($languages)) {
            foreach ($languages as $l) {
                $li = '<li class="language">';
                if ($l['country_flag_url']) {
                    if (!$l['active']) {
                        $li .= '<a href="' . $l['url'] . '">';
                        $li .= icl_disp_language($l['native_name']);
                        $li .= '</a>';
                    }
                    $li .= '</li>';
                }
            }
        }
        $items .= $li;
    }
    return $items;
}
开发者ID:8ozStudios,项目名称:code-samples,代码行数:21,代码来源:functions.php

示例4: icl_disp_language

            } else {
                $lang_translated_hidden = true;
            }
        } else {
            if ($this->settings['icl_lso_native_lang']) {
                $lang_native = $lang['native_name'];
            } else {
                $lang_native = false;
            }
            if ($this->settings['icl_lso_display_lang']) {
                $lang_translated = $lang['translated_name'];
            } else {
                $lang_translated = false;
            }
        }
        echo icl_disp_language($lang_native, $lang_translated, $lang_native_hidden, $lang_translated_hidden);
        ?>
                    </a>
                </li>
                <?php 
    }
    ?>
            </ul>            
            <?php 
    if (isset($ie_ver) && $ie_ver <= 6) {
        ?>
</td></tr></table></a><?php 
    }
    ?>
 
            <?php 
开发者ID:kitfrench,项目名称:Futurestep,代码行数:31,代码来源:language-selector.php

示例5: get_desktop_language_selector

    function get_desktop_language_selector()
    {
        $active_languages = $this->get_ls_languages();
        if ($active_languages) {
            /**
             * @var $main_language bool|string
             * @used_by menu/language-selector.php
             */
            foreach ($active_languages as $k => $al) {
                if ($al['active'] == 1) {
                    unset($active_languages[$k]);
                    break;
                }
            }
        } else {
            return '';
        }
        global $w_this_lang;
        global $icl_language_switcher_preview;
        if ($w_this_lang['code'] == 'all') {
            $main_language['native_name'] = __('All languages', 'sitepress');
            $main_language['translated_name'] = $main_language['native_name'];
            $main_language['language_code'] = 'all';
        }
        if (empty($main_language)) {
            $main_language['native_name'] = $w_this_lang['display_name'];
            $main_language['translated_name'] = $w_this_lang['display_name'];
            $main_language['language_code'] = $w_this_lang['code'];
        }
        $style_display_none_icl_lang_sel_type = $this->settings['icl_lang_sel_type'] == 'list' ? ' style="display:none;"' : '';
        $class_icl_rtl = $this->is_rtl() ? 'class="icl_rtl"' : '';
        $language_selector = '<div id="lang_sel" ' . $style_display_none_icl_lang_sel_type . ' ' . $class_icl_rtl . ' >
				<ul>
						<li><a href="#" class="lang_sel_sel icl-' . $w_this_lang['code'] . '">';
        if ($this->settings['icl_lso_flags'] || $icl_language_switcher_preview) {
            $flag = $this->get_flag($w_this_lang['code']);
            if (isset($flag->from_template) && $flag->from_template && isset($flag->flag)) {
                $wp_upload_dir = wp_upload_dir();
                $main_language['country_flag_url'] = $wp_upload_dir['baseurl'] . '/flags/' . $flag->flag;
            } else {
                if (isset($flag->flag)) {
                    $main_language['country_flag_url'] = ICL_PLUGIN_URL . '/res/flags/' . $flag->flag;
                } else {
                    $main_language['country_flag_url'] = ICL_PLUGIN_URL . '/res/img/icon16.png';
                }
            }
            $language_selector .= '<img ' . (!$this->settings['icl_lso_flags'] ? 'style="display:none"' : '') . ' class="iclflag" ' . 'src="' . $main_language['country_flag_url'] . '" ' . 'alt="' . $main_language['language_code'] . '"  ' . 'title="' . ($this->settings['icl_lso_display_lang'] ? esc_attr($main_language['translated_name']) : esc_attr($main_language['native_name'])) . '" />                                
								&nbsp;';
        }
        if ($icl_language_switcher_preview) {
            $lang_native = $main_language['native_name'];
            if ($this->settings['icl_lso_native_lang']) {
                $lang_native_hidden = false;
            } else {
                $lang_native_hidden = true;
            }
            $lang_translated = $main_language['translated_name'];
            if ($this->settings['icl_lso_display_lang']) {
                $lang_translated_hidden = false;
            } else {
                $lang_translated_hidden = true;
            }
        } else {
            if ($this->settings['icl_lso_native_lang']) {
                $lang_native = $main_language['native_name'];
            } else {
                $lang_native = false;
            }
            if ($this->settings['icl_lso_display_lang']) {
                $lang_translated = $main_language['translated_name'];
            } else {
                $lang_translated = false;
            }
            $lang_native_hidden = false;
            $lang_translated_hidden = false;
        }
        $language_selector .= icl_disp_language($lang_native, $lang_translated, $lang_native_hidden, $lang_translated_hidden);
        if (!isset($ie_ver) || $ie_ver > 6) {
            $language_selector .= '</a> ';
        }
        if (!empty($active_languages)) {
            if (isset($ie_ver) && $ie_ver <= 6) {
                $language_selector .= '<table><tr><td>';
            }
            $language_selector .= '<ul>';
            $active_languages_ordered = $this->order_languages($active_languages);
            foreach ($active_languages_ordered as $lang) {
                $language_selector .= '<li class="icl-' . $lang['language_code'] . '">          
				<a href="' . apply_filters('WPML_filter_link', $lang['url'], $lang) . '">';
                if ($this->settings['icl_lso_flags'] || $icl_language_switcher_preview) {
                    $language_selector .= '<img ' . (!$this->settings['icl_lso_flags'] ? 'style="display:none"' : '') . ' class="iclflag" ' . 'src="' . $lang['country_flag_url'] . '" ' . 'alt="' . $lang['language_code'] . '" ' . 'title="' . ($this->settings['icl_lso_display_lang'] ? esc_attr($lang['translated_name']) : esc_attr($lang['native_name'])) . '" />&nbsp;';
                }
                if ($icl_language_switcher_preview) {
                    $lang_native = $lang['native_name'];
                    if ($this->settings['icl_lso_native_lang']) {
                        $lang_native_hidden = false;
                    } else {
                        $lang_native_hidden = true;
                    }
                    $lang_translated = $lang['translated_name'];
//.........这里部分代码省略.........
开发者ID:pablomarsan,项目名称:iftheme-docs,代码行数:101,代码来源:sitepress.class.php

示例6: widget_list

    function widget_list()
    {
        global $sitepress, $w_this_lang, $icl_language_switcher_preview;
        if ($w_this_lang['code'] == 'all') {
            $main_language['native_name'] = __('All languages', 'sitepress');
        }
        $active_languages = icl_get_languages('orderby=id&order=asc&skip_missing=0');
        if (empty($active_languages)) {
            return;
        }
        ?>
        
<div id="lang_sel_list"<?php 
        if (empty($this->settings['icl_lang_sel_type']) || $this->settings['icl_lang_sel_type'] == 'dropdown') {
            echo ' style="display:none;"';
        }
        ?>
>           
            <ul>
                <?php 
        foreach ($active_languages as $lang) {
            ?>
                <li class="icl-<?php 
            echo $lang['language_code'];
            ?>
">          
                    <a href="<?php 
            echo apply_filters('WPML_filter_link', $lang['url'], $lang);
            ?>
"<?php 
            if ($lang['language_code'] == $sitepress->get_current_language()) {
                echo ' class="lang_sel_sel"';
            } else {
                echo ' class="lang_sel_other"';
            }
            ?>
>
                    <?php 
            if ($this->settings['icl_lso_flags'] || $icl_language_switcher_preview) {
                ?>
                
                    <img <?php 
                if (!$this->settings['icl_lso_flags']) {
                    ?>
style="display:none"<?php 
                }
                ?>
 class="iclflag" src="<?php 
                echo $lang['country_flag_url'];
                ?>
" alt="<?php 
                echo $lang['language_code'];
                ?>
" />&nbsp;                    
                    <?php 
            }
            ?>
                    <?php 
            if ($icl_language_switcher_preview) {
                $lang_native = $lang['native_name'];
                if ($this->settings['icl_lso_native_lang']) {
                    $lang_native_hidden = false;
                } else {
                    $lang_native_hidden = true;
                }
                $lang_translated = $lang['translated_name'];
                if ($this->settings['icl_lso_display_lang']) {
                    $lang_translated_hidden = false;
                } else {
                    $lang_translated_hidden = true;
                }
            } else {
                if ($this->settings['icl_lso_native_lang']) {
                    $lang_native = $lang['native_name'];
                } else {
                    $lang_native = false;
                }
                if ($this->settings['icl_lso_display_lang']) {
                    $lang_translated = $lang['translated_name'];
                } else {
                    $lang_translated = false;
                }
            }
            echo @icl_disp_language($lang_native, $lang_translated, $lang_native_hidden, $lang_translated_hidden);
            ?>
                    </a>
                </li>
                <?php 
        }
        ?>
            </ul>
</div>
<?php 
    }
开发者ID:envickery,项目名称:staging.xylemwatermark.org,代码行数:94,代码来源:language-switcher.php

示例7: languages_list_header

function languages_list_header()
{
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    $selector = "";
    $separator = "&nbsp;|&nbsp;";
    if (!empty($languages)) {
        foreach ($languages as $l) {
            if (!$l['active']) {
                $selector .= '<a href="' . $l['url'] . '">';
            }
            $selector .= icl_disp_language($l['native_name'], $l['translated_name']);
            if (!$l['active']) {
                $selector .= '</a>';
            }
            $selector .= $separator;
        }
        $selector = substr($selector, 0, -strlen($separator));
        echo $selector;
    }
}
开发者ID:plaste,项目名称:pulvermuhle,代码行数:20,代码来源:pulvermuhle-functions.php

示例8: icl_get_languages

    ?>
    <?php 
    if (!empty($options_alice['global_menu_language_button']) && $options_alice['global_menu_language_button'] == 'enable') {
        ?>
	<?php 
        if (class_exists('SitePress')) {
            if (function_exists('icl_get_languages')) {
                $languages = icl_get_languages('skip_missing=0&orderby=code');
                if (!empty($languages)) {
                    echo '<div id="az_header_language_list">';
                    foreach ($languages as $l) {
                        echo '<span class="lang">';
                        if (!$l['active']) {
                            echo '<a href="' . $l['url'] . '">';
                        }
                        echo icl_disp_language($l['language_code'], 0);
                        if (!$l['active']) {
                            echo '</a>';
                        }
                        echo '</span>';
                    }
                    echo '</div>';
                }
            }
        }
        ?>
	<?php 
    }
    ?>
</div>
<!-- End Search/Share Menu -->
开发者ID:pattysanchez,项目名称:letsrumbl-wordpress,代码行数:31,代码来源:az-header-optional-menu.php

示例9: render_ls_li_item

 public function render_ls_li_item($lang, $lang_native_hidden = false, $lang_translated_hidden = false, $language_selected = "")
 {
     global $icl_language_switcher_preview;
     $country_flag_url = $lang['country_flag_url'];
     $language_url = apply_filters('WPML_filter_link', $lang['url'], $lang);
     $language_flag_title = $this->settings['icl_lso_display_lang'] ? esc_attr($lang['translated_name']) : esc_attr($lang['native_name']);
     $ls_settings = $this->get_ls_settings($lang, $lang_native_hidden, $lang_translated_hidden);
     if (is_wp_error($language_url)) {
         return '';
     }
     $language_selector = '<li class="icl-' . $lang['language_code'] . '"><a href="' . $language_url . '" ' . $language_selected . '>';
     if ($this->settings['icl_lso_flags'] || $icl_language_switcher_preview) {
         $language_selector .= '<img ' . (!$this->settings['icl_lso_flags'] ? 'style="display:none"' : '') . ' class="iclflag" ' . 'src="' . $country_flag_url . '" ' . 'alt="' . $lang['language_code'] . '" ' . 'title="' . $language_flag_title . '" />&nbsp;';
     }
     $ls_settings = $this->get_ls_settings($lang, $ls_settings['lang_native_hidden'], $ls_settings['lang_translated_hidden']);
     $language_selector .= icl_disp_language($ls_settings['lang_native'], $ls_settings['lang_translated'], $ls_settings['lang_native_hidden'], $ls_settings['lang_translated_hidden']);
     $language_selector .= '</a></li>';
     return $language_selector;
 }
开发者ID:phucanh92,项目名称:vietlong,代码行数:19,代码来源:sitepress.class.php

示例10: porto_mobile_view_switcher

function porto_mobile_view_switcher()
{
    global $porto_settings;
    ob_start();
    if (!$porto_settings['wpml-switcher'] && has_nav_menu('view_switcher')) {
        wp_nav_menu(array('theme_location' => 'view_switcher', 'container' => '', 'menu_class' => 'view-switcher accordion-menu show-arrow', 'before' => '', 'after' => '', 'depth' => 2, 'link_before' => '', 'link_after' => '', 'fallback_cb' => false, 'walker' => new porto_accordion_navwalker()));
    }
    if ($porto_settings['wpml-switcher'] && function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if (!empty($languages)) {
            $active_lang = '';
            $other_langs = '';
            foreach ($languages as $l) {
                if (!$l['active']) {
                    $other_langs .= '<li class="menu-item"><a href="' . esc_url($l['url']) . '">';
                }
                if ($l['country_flag_url']) {
                    if ($l['active']) {
                        $active_lang .= '<span class="flag"><img src="' . esc_url($l['country_flag_url']) . '" height="12" alt="' . esc_attr($l['language_code']) . '" width="18" /></span>';
                    } else {
                        $other_langs .= '<span class="flag"><img src="' . esc_url($l['country_flag_url']) . '" height="12" alt="' . esc_attr($l['language_code']) . '" width="18" /></span>';
                    }
                }
                if ($l['active']) {
                    $active_lang .= icl_disp_language($l['native_name'], $l['translated_name']);
                } else {
                    $other_langs .= icl_disp_language($l['native_name'], $l['translated_name']);
                }
                if (!$l['active']) {
                    $other_langs .= '</a></li>';
                }
            }
            ?>
            <ul id="menu-view-switcher" class="view-switcher accordion-menu show-arrow">
                <li class="menu-item<?php 
            if ($other_langs) {
                echo ' has-sub';
            }
            ?>
 narrow">
                    <h5><?php 
            echo $active_lang;
            ?>
</h5>
                    <?php 
            if ($other_langs) {
                ?>
                        <span class="arrow"></span>
                        <ul class="sub-menu">
                            <?php 
                echo $other_langs;
                ?>
                        </ul>
                    <?php 
            }
            ?>
                </li>
            </ul>
        <?php 
        }
    }
    return apply_filters('porto_mobile_view_switcher', str_replace('&nbsp;', '', ob_get_clean()));
}
开发者ID:booklein,项目名称:wpbookle,代码行数:63,代码来源:layout.php

示例11: language_selector_footer

 function language_selector_footer()
 {
     if ($this->settings['footer_skip_languages'] == 'checked') {
         $this->settings['footer_skip_languages'] = 1;
     }
     $skip = is_singular() ? intval($this->settings['footer_skip_languages']) : 0;
     $languages = icl_get_languages('skip_missing=' . $skip);
     if (!empty($languages)) {
         global $sitepress_settings;
         echo '
             <div id="icl_lang_selector_footer">
                 <ul>
                 ';
         foreach ($languages as $l) {
             echo '<li>';
             if (!$l['active']) {
                 echo '<a href="' . $l['url'] . '">';
             }
             if ($sitepress_settings['icl_lso_flags']) {
                 echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['language_code'] . '" />&nbsp;';
             }
             if (!$l['active']) {
                 echo '</a>';
             }
             if (!$l['active']) {
                 echo '<a href="' . $l['url'] . '">';
             }
             echo icl_disp_language($sitepress_settings['icl_lso_native_lang'] ? $l['native_name'] : null, $sitepress_settings['icl_lso_display_lang'] ? $l['translated_name'] : null);
             if (!$l['active']) {
                 echo '</a>';
             }
             echo '</li>
                 ';
         }
         echo '
                 </ul>
             </div>';
     }
 }
开发者ID:winyatasenjaya,项目名称:sitepress-multilingual-cms,代码行数:39,代码来源:wpml-package.class.php

示例12: get_language_selector_footer

    static function get_language_selector_footer()
    {
        global $sitepress;
        $language_selector_footer = '';
        $languages = array();
        if (!function_exists('wpml_home_url_ls_hide_check') || !wpml_home_url_ls_hide_check()) {
            $languages = $sitepress->get_ls_languages();
        }
        if (!empty($languages)) {
            $language_selector_footer = '
							<div id="lang_sel_footer">
									<ul>
									';
            foreach ($languages as $lang) {
                $alt_title_lang = $sitepress->get_setting('icl_lso_display_lang') ? esc_attr($lang['translated_name']) : esc_attr($lang['native_name']);
                $language_selector_footer .= '    <li>';
                $language_selector_footer .= '<a href="' . apply_filters('WPML_filter_link', $lang['url'], $lang) . '"';
                if ($lang['active']) {
                    $language_selector_footer .= ' class="lang_sel_sel"';
                }
                $language_selector_footer .= '>';
                if ($sitepress->get_setting('icl_lso_flags') || $sitepress->footer_preview) {
                    $language_selector_footer .= '<img src="' . $lang['country_flag_url'] . '" alt="' . $alt_title_lang . '" class="iclflag" title="' . $alt_title_lang . '" ';
                }
                if (!$sitepress->get_setting('icl_lso_flags') && $sitepress->footer_preview) {
                    $language_selector_footer .= ' style="display:none;"';
                }
                if ($sitepress->get_setting('icl_lso_flags') || $sitepress->footer_preview) {
                    $language_selector_footer .= ' />&nbsp;';
                }
                if ($sitepress->footer_preview) {
                    $lang_native = $lang['native_name'];
                    $lang_native_hidden = false;
                    $lang_translated = $lang['translated_name'];
                    $lang_translated_hidden = false;
                } else {
                    if ($sitepress->get_setting('icl_lso_native_lang')) {
                        $lang_native = $lang['native_name'];
                    } else {
                        $lang_native = false;
                    }
                    if ($sitepress->get_setting('icl_lso_display_lang')) {
                        $lang_translated = $lang['translated_name'];
                    } else {
                        $lang_translated = false;
                    }
                    $lang_native_hidden = false;
                    $lang_translated_hidden = false;
                }
                $language_selector_footer .= icl_disp_language($lang_native, $lang_translated, $lang_native_hidden, $lang_translated_hidden);
                $language_selector_footer .= '</a>';
                $language_selector_footer .= '</li>
									';
            }
            $language_selector_footer .= '</ul>
							</div>';
        }
        return $language_selector_footer;
    }
开发者ID:aarongillett,项目名称:B22-151217,代码行数:59,代码来源:language-switcher.php

示例13: languages_list_header

 function languages_list_header()
 {
     //cf. http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/
     $languages = icl_get_languages('skip_missing=0&orderby=code');
     if (!empty($languages)) {
         echo '<div id="header_language_list"><ul>';
         foreach ($languages as $l) {
             $class = $l['active'] ? 'class="active"' : '';
             echo '<li ' . $class . '>';
             if (!$l['active']) {
                 echo '<a href="' . $l['url'] . '">';
             }
             //echo icl_disp_language($l['native_name'], $l['translated_name']);
             echo icl_disp_language($l['language_code'], '');
             if (!$l['active']) {
                 echo '</a>';
             }
             echo '</li>';
         }
         echo '</ul></div>';
     }
 }
开发者ID:mngoe,项目名称:iftheme,代码行数:22,代码来源:functions.php

示例14: icl_get_languages

    if (!empty($options_alice['global_menu_search_button']) && $options_alice['global_menu_search_button'] == 'enable') {
        $search_btn = '<li><a class="menu-search open-modal-search"><i class="font-icon-search"></i></a></li>';
    }
    // Language Switcher
    if (!empty($options_alice['global_menu_language_button']) && $options_alice['global_menu_language_button'] == 'enable') {
        if (class_exists('SitePress')) {
            if (function_exists('icl_get_languages')) {
                $languages = icl_get_languages('skip_missing=0&orderby=code');
                if (!empty($languages)) {
                    $lang_switch .= '<li class="lang_switch"><div id="az_header_language_list">';
                    foreach ($languages as $l) {
                        $lang_switch .= '<span class="lang">';
                        if (!$l['active']) {
                            $lang_switch .= '<a href="' . $l['url'] . '">';
                        }
                        $lang_switch .= icl_disp_language($l['language_code'], 0);
                        if (!$l['active']) {
                            $lang_switch .= '</a>';
                        }
                        $lang_switch .= '</span>';
                    }
                    $lang_switch .= '</div></li>';
                }
            }
        }
    }
}
?>

<!-- Start Menu Panel -->
<nav class="mm-classic-panel">
开发者ID:pattysanchez,项目名称:letsrumbl-wordpress,代码行数:31,代码来源:az-header-classic-menu.php


注:本文中的icl_disp_language函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。