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


PHP SitePress::get_flag_url方法代码示例

本文整理汇总了PHP中SitePress::get_flag_url方法的典型用法代码示例。如果您正苦于以下问题:PHP SitePress::get_flag_url方法的具体用法?PHP SitePress::get_flag_url怎么用?PHP SitePress::get_flag_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SitePress的用法示例。


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

示例1: get_metabox_status

 public function get_metabox_status()
 {
     $result = '';
     if ($this->got_package()) {
         $result .= '<div id="wpml_package_status">';
         if ($this->show_status && $this->metabox_data['statuses']) {
             if ($this->status_container_tag) {
                 $result .= $this->get_tag($this->status_container_tag . ' ' . $this->status_container_attributes_html);
             }
             foreach ($this->metabox_data['statuses'] as $code => $status) {
                 $result .= $this->get_tag($this->status_element_tag);
                 $result .= '<img src="' . $this->sitepress->get_flag_url($code) . '"> ' . $status['name'] . ' : ' . $status['status'];
                 $result .= $this->get_tag($this->status_element_tag, 'closed');
             }
             if ($this->status_container_tag) {
                 $result .= $this->get_tag($this->status_container_tag, 'closed');
             }
         }
         if ($this->show_link) {
             if ($this->is_package_language_active()) {
                 $result .= '<p><a style="float:right" class="button-secondary" href="' . $this->dashboard_link . '" target="_blank">' . $this->metabox_data['translate_title'] . '</a></p>';
             } else {
                 $result .= '<p><a style="float:right" class="button-secondary" href="' . $this->strings_link . '" target="_blank">' . $this->metabox_data['translate_title'] . '</a></p>';
             }
         }
         $result .= '<br /><br /></div>';
     }
     return $result;
 }
开发者ID:aarongillett,项目名称:B22-151217,代码行数:29,代码来源:wpml-package-translation-metabox.class.php

示例2: getFlagUrl

 /**
  * get flag url
  */
 public static function getFlagUrl($code)
 {
     self::validateWpmlExists();
     $wpml = new SitePress();
     if (empty($code) || $code == "all") {
         $url = ICL_PLUGIN_URL . '/res/img/icon16.png';
     } else {
         $url = $wpml->get_flag_url($code);
     }
     //default: show all
     if (empty($url)) {
         $url = ICL_PLUGIN_URL . '/res/img/icon16.png';
     }
     return $url;
 }
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:18,代码来源:wpml.class.php

示例3: wpml_get_table_taxonomies

 public static function wpml_get_table_taxonomies(SitePress $sitepress)
 {
     $taxonomies = $sitepress->get_wp_api()->get_taxonomies(array(), 'objects');
     $result = array("taxonomies" => array(), "activeLanguages" => array(), "allLanguages" => array());
     $sitepress->set_admin_language();
     $active_langs = $sitepress->get_active_languages();
     $default_lang = $sitepress->get_default_language();
     $result["activeLanguages"][$default_lang] = array("label" => $active_langs[$default_lang]['display_name'], "flag" => $sitepress->get_flag_url($default_lang));
     foreach ($active_langs as $code => $lang) {
         if ($code !== $default_lang) {
             $result["activeLanguages"][$code] = array("label" => $lang['display_name'], "flag" => $sitepress->get_flag_url($code));
         }
     }
     $all_languages = $sitepress->get_languages();
     foreach ($all_languages as $code => $lang) {
         $result["allLanguages"][$code] = array("label" => $lang['display_name'], "flag" => $sitepress->get_flag_url($code));
     }
     foreach ($taxonomies as $key => $tax) {
         if ($sitepress->is_translated_taxonomy($key)) {
             $result["taxonomies"][$key] = array("label" => $tax->label, "singularLabel" => $tax->labels->singular_name, "hierarchical" => $tax->hierarchical, "name" => $key);
         }
     }
     return $result;
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:24,代码来源:taxonomy-translation-display.class.php

示例4: getFlagUrl

 /**
  * get flag url
  */
 public static function getFlagUrl($code)
 {
     self::validateWpmlExists();
     $wpml = new SitePress();
     if (empty($code) || $code == "all") {
         $url = RS_PLUGIN_URL . 'admin/assets/images/icon-all.png';
     } else {
         $url = $wpml->get_flag_url($code);
     }
     /* NEW:
     		if ( empty( $code ) || $code == "all" ) {
                 $url = ICL_PLUGIN_URL . '/res/img/icon16.png';
             } else {
                 $active_languages = apply_filters( 'wpml_active_languages', array() );
                 $url = isset( $active_languages[$code]['country_flag_url'] ) ? $active_languages[$code]['country_flag_url'] : null;
             }
     		*/
     //default: show all
     if (empty($url)) {
         $url = RS_PLUGIN_URL . 'admin/assets/images/icon-all.png';
         // NEW: $url = ICL_PLUGIN_URL . '/res/img/icon16.png';
     }
     return $url;
 }
开发者ID:amptdesign,项目名称:ampt-2016,代码行数:27,代码来源:wpml.class.php


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