/**
  * Saves settings fetched from $_POST.
  */
 public function saveGeneral()
 {
     /**
      * @var $ilCtrl ilCtrl
      * @var $lng    ilLanguage
      */
     global $ilCtrl, $lng;
     $formFactory = new ilChatroomFormFactory();
     $settingsForm = $formFactory->getSettingsForm();
     if (!$settingsForm->checkInput()) {
         $this->general($settingsForm);
     } else {
         $this->gui->object->setTitle($settingsForm->getInput('title'));
         $this->gui->object->setDescription($settingsForm->getInput('desc'));
         $this->gui->object->update();
         // @todo: Do not rely on raw post data
         $settings = $_POST;
         $room = ilChatRoom::byObjectId($this->gui->object->getId());
         if (!$room) {
             $room = new ilChatRoom();
             $settings['object_id'] = $this->gui->object->getId();
         }
         $room->saveSettings($settings);
         ilUtil::sendSuccess($lng->txt('saved_successfully'), true);
         $ilCtrl->redirect($this->gui, 'settings-general');
     }
 }
 /**
  * Saves settings fetched from $_POST.
  *
  * @global ilCtrl2 $ilCtrl
  */
 public function saveGeneral()
 {
     global $ilCtrl, $lng;
     $formFactory = new ilChatroomFormFactory();
     $settingsForm = $formFactory->getSettingsForm();
     if (!$settingsForm->checkInput()) {
         $this->general($settingsForm);
     } else {
         $this->gui->object->setTitle($_POST['title']);
         $this->gui->object->setDescription($_POST['desc']);
         $this->gui->object->update();
         $settings = $_POST;
         $room = ilChatRoom::byObjectId($this->gui->object->getId());
         if (!$room) {
             $room = new ilChatRoom();
             $settings['object_id'] = $this->gui->object->getId();
         }
         //var_dump($settings);exit;
         $room->saveSettings($settings);
         ilUtil::sendSuccess($lng->txt('saved_successfully'), true);
         $ilCtrl->redirect($this->gui, 'settings-general');
     }
 }