/** * Prepares and displays name selection. * Fetches name option by calling getChatNameSuggestions method on * given $chat_user object. * @param ilChatroomUser $chat_user */ private function showNameSelection(ilChatroomUser $chat_user) { /** * @var $lng ilLanguage * @var $ilCtrl ilCtrl * @var $tpl ilTemplate */ global $lng, $ilCtrl, $tpl; require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php'; $name_options = $chat_user->getChatNameSuggestions(); $formFactory = new ilChatroomFormFactory(); $selectionForm = $formFactory->getUserChatNameSelectionForm($name_options); $ilCtrl->saveParameter($this->gui, 'sub'); $selectionForm->addCommandButton('view-joinWithCustomName', $lng->txt('enter')); $selectionForm->setFormAction($ilCtrl->getFormAction($this->gui, 'view-joinWithCustomName')); $tpl->setVariable('ADM_CONTENT', $selectionForm->getHtml()); }