Browse Source

add the configuration variable social_show_language_flag_in_profile - refs #2880

Alex Aragón 5 years ago
parent
commit
ac4172fef6
2 changed files with 6 additions and 2 deletions
  1. 2 0
      main/inc/lib/social.lib.php
  2. 4 2
      main/template/default/social/user_block.tpl

+ 2 - 0
main/inc/lib/social.lib.php

@@ -2206,8 +2206,10 @@ class SocialManager extends UserManager
         }
 
         $extraFieldBlock = self::getExtraFieldBlock($userId, true);
+        $showLanguageFlag = api_get_configuration_value('social_show_language_flag_in_profile');
 
         $template->assign('user', $userInfo);
+        $template->assign('show_language_flag', $showLanguageFlag);
         $template->assign('extra_info', $extraFieldBlock);
         $template->assign('social_avatar_block', $socialAvatarBlock);
         $template->assign('profile_edition_link', $profileEditionLink);

+ 4 - 2
main/template/default/social/user_block.tpl

@@ -32,9 +32,10 @@
                             </div>
                         {% endif %}
                         <!-- END TYPE PROFILE -->
+
+                        {% if show_language_flag %}
                         <!-- LM -->
                         <div class="avatar-lm">
-                            <h5></h5>
                             {% if user.language %}
                                 {% if user.language.code == 'fr' %}
                                     <img src="{{ _p.web }}web/assets/flag-icon-css/flags/4x3/fr.svg" width="36px">
@@ -52,7 +53,6 @@
                         <!-- END LM -->
                         <!-- LC -->
                         <div class="avatar-lc">
-                            <h5></h5>
                             {% for item in extra_info %}
                                 {% if item.variable == 'langue_cible' %}
                                     {% if item.value == 'French2' %}
@@ -72,6 +72,8 @@
                             {% endfor %}
                         </div>
                         <!-- END LC -->
+                        {% endif %}
+
                     </div>
                     {# Ofaj #}
                     <ul class="list-user-data">