ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilChatroomCreateGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
16  public function save()
17  {
18  require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
19  $formFactory = new ilChatroomFormFactory();
20  $form = $formFactory->getCreationForm();
21 
22  if ($form->checkInput()) {
23  $roomObj = $this->gui->insertObject();
24  $room = ilChatroom::byObjectId($roomObj->getId());
25 
26  $connector = $this->gui->getConnector();
27  $response = $connector->sendCreatePrivateRoom($room->getRoomId(), 0, $roomObj->getOwner(), $roomObj->getTitle());
28 
29  $this->ilCtrl->setParameter($this->gui, 'ref_id', $this->gui->getRefId());
30  $this->ilCtrl->redirect($this->gui, 'settings-general');
31  } else {
32  $this->executeDefault('create');
33  }
34  }
35 
39  public function executeDefault($method)
40  {
41  $this->gui->switchToVisibleMode();
42  $this->gui->createObject();
43  return;
44  }
45 }
setParameter($a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
This class provides processing control methods.
Class ilChatroomFormFactory.
if(isset($_POST['submit'])) $form
Class ilChatroomGUIHandler.
save()
Inserts new object into gui.
Class ilChatroomCreateGUI.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
$response
redirect($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to another command.