| 
|   | __construct (private readonly ilCtrlInterface $ilCtrl, private readonly ilLanguage $ilLng, private readonly ilChatroomObjectGUI $gui, private readonly ilChatroom $room, private readonly ilChatroomServerSettings $settings, private readonly ilObjUser $user, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer,) | 
|   | 
|   | template (bool $read_only, array $initial, string $input, string $output) | 
|   | 
|   | initialData (array $users, bool $show_auto_messages, ?string $redirect_url, array $userinfo, array $messages) | 
|   | 
Definition at line 35 of file BuildChat.php.
 
◆ __construct()
◆ initialData()
      
        
          | ILIAS\Chatroom\BuildChat::initialData  | 
          ( | 
          array  | 
          $users,  | 
        
        
           | 
           | 
          bool  | 
          $show_auto_messages,  | 
        
        
           | 
           | 
          ?string  | 
          $redirect_url,  | 
        
        
           | 
           | 
          array  | 
          $userinfo,  | 
        
        
           | 
           | 
          array  | 
          $messages  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 73 of file BuildChat.php.
References ilUtil\getImagePath(), and ILIAS\Repository\settings().
   76         $initial[
'users'] = $users;
    77         $initial[
'redirect_url'] = $redirect_url;
    78         $initial[
'profile_image_url'] = $this->
ilCtrl->getLinkTarget($this->gui, 
'view-getUserProfileImages', 
'', 
true);
    80         $initial[
'subdirectory'] = $this->
settings->getSubDirectory();
    82         $initial[
'userinfo'] = $userinfo;
    83         $initial[
'messages'] = $messages;
    87             'show_auto_msg' => $show_auto_messages,
    88             'system_message_update_url' => $this->
ilCtrl->getFormAction($this->gui, 
'view-toggleAutoMessageDisplayState', 
'', 
true, 
false),
 static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
 
 
 
◆ renderLanguageVariables()
  
  
      
        
          | ILIAS\Chatroom\BuildChat::renderLanguageVariables  | 
          ( | 
          ilTemplate  | 
          $room_tpl | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Definition at line 94 of file BuildChat.php.
References Vendor\Package\$a, ilUtil\getImagePath(), and HTML_Template_IT\setVariable().
Referenced by ILIAS\Chatroom\BuildChat\template().
   99             'LBL_MAINROOM' => 
'chat_mainroom',
   100             'LBL_JOIN' => 
'chat_join',
   101             'LBL_INVITE_TO_PRIVATE_ROOM' => 
'invite_to_private_room',
   102             'LBL_KICK' => 
'chat_kick',
   103             'LBL_BAN' => 
'chat_ban',
   104             'LBL_KICK_QUESTION' => 
'kick_question',
   105             'LBL_BAN_QUESTION' => 
'ban_question',
   106             'LBL_ADDRESS' => 
'chat_address',
   107             'LBL_WHISPER' => 
'chat_whisper',
   108             'LBL_CONNECT' => 
'chat_connection_established',
   109             'LBL_DISCONNECT' => 
'chat_connection_disconnected',
   110             'LBL_TO_MAINROOM' => 
'chat_to_mainroom',
   111             'LBL_WELCOME_TO_CHAT' => 
'welcome_to_chat',
   112             'LBL_USER_INVITED' => 
'user_invited',
   113             'LBL_USER_KICKED' => 
'user_kicked',
   114             'LBL_USER_BANNED' => 
'user_banned',
   115             'LBL_USER_INVITED_SELF' => 
'user_invited_self',
   116             'LBL_PRIVATE_ROOM_CLOSED' => 
'private_room_closed',
   117             'LBL_PRIVATE_ROOM_ENTERED' => 
'private_room_entered',
   118             'LBL_PRIVATE_ROOM_LEFT' => 
'private_room_left',
   119             'LBL_PRIVATE_ROOM_ENTERED_USER' => 
'private_room_entered_user',
   120             'LBL_KICKED_FROM_PRIVATE_ROOM' => 
'kicked_from_private_room',
   122             'LBL_DELETE' => 
'delete',
   123             'LBL_INVITE' => 
'chat_invite',
   124             'LBL_CANCEL' => 
'cancel',
   125             'LBL_HISTORY_CLEARED' => 
'history_cleared',
   126             'LBL_CLEAR_ROOM_HISTORY' => 
'clear_room_history',
   127             'LBL_CLEAR_ROOM_HISTORY_QUESTION' => 
'clear_room_history_question',
   128             'LBL_END_WHISPER' => 
'end_whisper',
   129             'LBL_TIMEFORMAT' => 
'lang_timeformat_no_sec',
   130             'LBL_DATEFORMAT' => 
'lang_dateformat',
   131             'LBL_START_PRIVATE_CHAT' => 
'start_private_chat',
   135             fn($v) => json_encode($this->ilLng->txt($v), JSON_THROW_ON_ERROR),
   139         $this->ilLng->toJSMap([
   140             'chat_user_x_is_typing' => $this->ilLng->txt(
'chat_user_x_is_typing'),
   141             'chat_users_are_typing' => $this->ilLng->txt(
'chat_users_are_typing'),
   145             'LBL_LAYOUT' => 
'layout',
   146             'LBL_SHOW_SETTINGS' => 
'show_settings',
   147             'LBL_USER_IN_ROOM' => 
'user_in_room',
   148             'LOADING_IMAGE' => 
'media/loader.svg',
   151         $set_vars(
array_map($this->ilLng->txt(...), $vars));
 
setVariable($variable, $value='')
Sets a variable value. 
 
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples 
 
 
 
 
◆ template()
      
        
          | ILIAS\Chatroom\BuildChat::template  | 
          ( | 
          bool  | 
          $read_only,  | 
        
        
           | 
           | 
          array  | 
          $initial,  | 
        
        
           | 
           | 
          string  | 
          $input,  | 
        
        
           | 
           | 
          string  | 
          $output  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 49 of file BuildChat.php.
References ILIAS\Chatroom\BuildChat\renderLanguageVariables(), ILIAS\Repository\settings(), ILIAS\Chatroom\BuildChat\timeFormat(), and ILIAS\Repository\user().
   51         $room_tpl = 
new ilTemplate(
'tpl.chatroom.html', 
true, 
true, 
'components/ILIAS/Chatroom');
    52         $set_json_var = fn($var, $value) => $room_tpl->setVariable($var, json_encode($value));
    53         $set_json_var(
'BASEURL', $this->
settings->generateClientUrl());
    54         $set_json_var(
'INSTANCE', $this->
settings->getInstance());
    55         $set_json_var(
'SCOPE', $this->room->getRoomId());
    56         $set_json_var(
'POSTURL', ILIAS_HTTP_PATH . 
'/' . $this->
ilCtrl->getLinkTarget($this->gui, 
'postMessage', 
'', 
true));
    57         $room_tpl->setVariable(
'JS_CALL', 
'il.Chatroom.' . ($read_only ? 
'runReadOnly' : 
'run'));
    59         $set_json_var(
'INITIAL_DATA', $initial);
    60         $set_json_var(
'INITIAL_USERS', $this->room->getConnectedUsers());
    61         $set_json_var(
'DATE_FORMAT', (
string) $this->
user->getDateFormat());
    62         $set_json_var(
'TIME_FORMAT', $this->
timeFormat());
    63         $set_json_var(
'NOTHING_FOUND', $this->ui_renderer->render($this->ui_factory->messageBox()->info($this->ilLng->txt(
'chat_osc_no_usr_found'))));
    65         $room_tpl->setVariable(
'CHAT_OUTPUT', $output);
    66         $room_tpl->setVariable(
'CHAT_INPUT', $input);
 
renderLanguageVariables(ilTemplate $room_tpl)
 
 
 
 
◆ timeFormat()
  
  
      
        
          | ILIAS\Chatroom\BuildChat::timeFormat  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this class was generated from the following file: