/**
  * Fill data section
  */
 public function fillDataSection()
 {
     /**
      * @var $tpl	ilTemplate
      * @var $lng	ilLanguage
      * @var $ilCtrl ilCtrl
      */
     global $tpl, $lng, $ilCtrl;
     //@todo: Dirty hack
     if ($ilCtrl->isAsynch()) {
         return $this->getMessages();
     }
     $tpl->addJavascript('./Modules/Chatroom/js/chatviewer.js');
     $tpl->addCss('./Modules/Chatroom/templates/default/style.css');
     $chatblock = new ilChatroomBlock();
     $body_tpl = new ilTemplate('tpl.chatroom_block_message_body.html', true, true, 'Modules/Chatroom');
     $height = 120;
     if ($this->getCurrentDetailLevel() > 0 && $this->getCurrentDetailLevel() <= 3) {
         $height *= $this->getCurrentDetailLevel();
     }
     $body_tpl->setVariable('BLOCK_HEIGHT', $height);
     $body_tpl->setVariable('TXT_ENABLE_AUTOSCROLL', $lng->txt('chat_enable_autoscroll'));
     $ilCtrl->setParameterByClass('ilcolumngui', 'block_id', 'block_' . $this->getBlockType() . '_' . (int) $this->getBlockId());
     $ilCtrl->setParameterByClass('ilcolumngui', 'ref_id', '#__ref_id');
     $body_tpl->setVariable('CHATBLOCK_BASE_URL', $ilCtrl->getLinkTargetByClass('ilcolumngui', 'updateBlock', '', true));
     $ilCtrl->setParameterByClass('ilcolumngui', 'block_id', '');
     $ilCtrl->setParameterByClass('ilcolumngui', 'ref_id', '');
     $smilieys = array();
     $settings = ilChatroomServerSettings::loadDefault();
     if ($settings->getSmiliesEnabled()) {
         $smilies_array = ilChatroomSmilies::_getSmilies();
         foreach ($smilies_array as $smiley_array) {
             foreach ($smiley_array as $key => $value) {
                 if ($key == 'smiley_keywords') {
                     $new_keys = explode("\n", $value);
                 }
                 if ($key == 'smiley_fullpath') {
                     $new_val = $value;
                 }
             }
             foreach ($new_keys as $new_key) {
                 $smilieys[$new_key] = $new_val;
             }
         }
     } else {
         $smilieys = new stdClass();
     }
     $body_tpl->setVariable('SMILIES', json_encode($smilieys));
     $js_translations = array('LBL_CONNECT' => 'chat_connection_established', 'LBL_DISCONNECT' => 'chat_connection_disconnected', 'LBL_TIMEFORMAT' => 'lang_timeformat_no_sec', 'LBL_DATEFORMAT' => 'lang_dateformat');
     foreach ($js_translations as $placeholder => $lng_variable) {
         $body_tpl->setVariable($placeholder, json_encode($lng->txt($lng_variable)));
     }
     $content = $body_tpl->get() . $chatblock->getRoomSelect();
     $this->setDataSection($content);
 }
 protected function getChatroomSelectionList()
 {
     $result = new stdClass();
     $result->ok = true;
     $chatblock = new ilChatroomBlock();
     $result->html = $chatblock->getRoomSelect();
     include_once 'Services/JSON/classes/class.ilJsonUtil.php';
     echo ilJsonUtil::encode($result);
     exit;
 }