Browse Source

Add hide_username_in_course_chat conf setting - refs BT#14769

Angel Fernando Quiroz Campos 6 years ago
parent
commit
7b6f760c0c
2 changed files with 9 additions and 0 deletions
  1. 3 0
      main/install/configuration.dist.php
  2. 6 0
      main/template/default/chat/chat.tpl

+ 3 - 0
main/install/configuration.dist.php

@@ -962,6 +962,9 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
 // Example: using api_get_user_info()['complete_name_with_username'] or $user->getCompleteNameWithUsername()
 //$_configuration['hide_username_with_complete_name'] = false;
 
+// Hide the username in course chat
+//$_configuration['hide_username_in_course_chat'] = false;
+
 // ------ Custom DB changes (keep this at the end)
 // Add user activation by confirmation email
 // This option prevents the new user to login in the platform if your account is not confirmed via email

+ 6 - 0
main/template/default/chat/chat.tpl

@@ -121,7 +121,13 @@ $(document).on('ready', function () {
                         '           </button>';
                 }
                 html += '           </li>' +
+
+                    {% if not 'hide_username_in_course_chat'|api_get_configuration_value %}
                     '           <li><small>' + user.username + '</small></li>' +
+                    {% else %}
+                    '           <li>&nbsp;</li>' +
+                    {% endif %}
+
                     '       </ul>' +
                     '   </div>' +
                     '</li>';