35 include_once 
"./classes/class.ilObjectGUI.php";
 
   36 include_once 
"./Modules/ILinc/classes/class.ilObjiLincClassroom.php";
 
   52                 $this->
id = $a_icla_id;
 
   53                 $this->parent = $a_icrs_id;
 
   64                 $this->lng->loadLanguageModule(
'ilinc');
 
   66                 $this->formaction = array();
 
   67                 $this->return_location = array();
 
   68                 $this->target_frame = array();
 
   71                 $this->sub_objects = 
"";
 
   93                 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
 
  101                         'instructoruserid' => 0,
 
  106                 include_once 
'Modules/ILinc/classes/class.ilObjiLincCourse.php';
 
  108                 $data[
'akclassvalue1'] = $akclassvalues[0];
 
  109                 $data[
'akclassvalue2'] = $akclassvalues[1];
 
  111                 $this->form_gui->setValuesByArray( 
$data );
 
  123                 if($this->form_gui->checkInput())
 
  125                         $_POST[
'Fobject'][
'title'] = $this->form_gui->getInput(
'title');
 
  126                         $_POST[
'Fobject'][
'desc'] = $this->form_gui->getInput(
'desc');  
 
  127                         $_POST[
'Fobject'][
'instructoruserid'] = $this->form_gui->getInput(
'instructoruserid');
 
  128                         $_POST[
'Fobject'][
'alwaysopen'] = $this->form_gui->getInput(
'alwaysopen');
 
  131                         if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
 
  134                                 include_once 
'Modules/ILinc/classes/class.ilObjiLincCourse.php';
 
  137                                 $_POST[
'Fobject'][
'akclassvalue1'] = $akclassvalues[0];
 
  138                                 $_POST[
'Fobject'][
'akclassvalue2'] = $akclassvalues[1];
 
  143                         $this->
object->ilincAPI->addClass($ilinc_course_id, 
$_POST[
'Fobject']);
 
  144                         $response = $this->
object->ilincAPI->sendRequest(
'addClass');                   
 
  145                         if($response->isError())
 
  147                                 $this->ilErr->raiseError($response->getErrorMsg(), $this->ilErr->MESSAGE);
 
  153                         $this->ctrl->redirectByClass(
'ilobjilinccoursegui');
 
  157                         if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
 
  160                                 include_once 
'Modules/ILinc/classes/class.ilObjiLincCourse.php';
 
  163                                 $_POST[
'akclassvalue1'] = $akclassvalues[0];
 
  164                                 $_POST[
'akclassvalue2'] = $akclassvalues[1];
 
  167                         $this->form_gui->setValuesByPost();
 
  168                         return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
 
  175                 $url = $this->
object->joinClass($this->ilias->account,
$_GET[
'class_id']);
 
  179                         $this->ilias->raiseError($this->object->getErrorMsg(),$this->ilias->error_obj->FATAL);
 
  189                 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());      
 
  195                         'title' => $this->object->getTitle(),
 
  196                         'desc' => $this->
object->getDescription(),
 
  197                         'alwaysopen' => $this->
object->getStatus(),
 
  198                         'instructoruserid' => $this->
object->getDocentId()
 
  202                 include_once 
'Modules/ILinc/classes/class.ilObjiLincCourse.php';
 
  204                 $data[
'akclassvalue1'] = $akclassvalues[0];
 
  205                 $data[
'akclassvalue2'] = $akclassvalues[1];
 
  207                 $this->form_gui->setValuesByArray( 
$data );
 
  212                 include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  215                 $this->form_gui->setTableWidth(
'600');
 
  216                 if($a_mode == 
'create')
 
  218                         $this->form_gui->setTitle($this->lng->txt(
'icla_add'));
 
  222                         $this->form_gui->setTitle($this->lng->txt(
'icla_edit'));
 
  227                 $text_input = 
new ilTextInputGUI($this->lng->txt(
'title'), 
'title');
 
  229                 $this->form_gui->addItem($text_input);
 
  233                 $this->form_gui->addItem($text_area);
 
  236                 $sel = 
new ilSelectInputGUI($this->lng->txt(ILINC_MEMBER_DOCENT), 
'instructoruserid');
 
  237                 $docentlist = $this->
object->getDocentList();
 
  238                 $docent_options = array();              
 
  239                 $docent_options[0] = $this->lng->txt(
'please_choose');
 
  240                 foreach((array)$docentlist as $id => 
$data)
 
  242                         $docent_options[$id] = 
$data[
'fullname'];
 
  244                 $sel->setOptions($docent_options);
 
  245                 $this->form_gui->addItem($sel);         
 
  250                         $ro = 
new ilRadioOption($this->lng->txt(
'ilinc_classroom_open'), 1);
 
  252                         $ro = 
new ilRadioOption($this->lng->txt(
'ilinc_classroom_closed'), 0);
 
  254                 $this->form_gui->addItem($rg);  
 
  257                 if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
 
  259                         $text_input = 
new ilTextInputGUI($this->lng->txt(
'akclassvalue1'), 
'akclassvalue1');
 
  261                         $this->form_gui->addItem($text_input);
 
  263                         $text_input = 
new ilTextInputGUI($this->lng->txt(
'akclassvalue2'), 
'akclassvalue2');
 
  265                         $this->form_gui->addItem($text_input);                  
 
  269                 if($a_mode == 
'create')
 
  271                         $this->ctrl->setParameter($this, 
'mode', 
'create');
 
  272                         $this->ctrl->setParameter($this, 
'new_type', 
'icla');
 
  274                         $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'icla_add'));
 
  275                         $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  276                         $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'save'));
 
  280                         $this->ctrl->setParameter($this, 
'class_id', $this->object->id);
 
  282                         $this->form_gui->addCommandButton(
'updateClassroom', $this->lng->txt(
'save'));
 
  283                         $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  284                         $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'updateClassroom'));
 
  309                 $this->data[
"cols"] = array(
"type", 
"title", 
"last_change");
 
  311                 $this->data[
"data"][
$_GET[
'class_id']] = array(
 
  312                                                                                         "type"        => $this->object->getType(),
 
  313                                                                                         "title"       => $this->
object->getTitle().
"#separator#".$this->
object->getDescription().
" ",   
 
  314                                                                                         "last_update" => 
"n/a" 
  317                 $this->data[
"buttons"] = array( 
"confirmedDeleteClassroom"  => $this->lng->txt(
"confirm"),
 
  318                                                                   "cancelDeleteClassroom"  => $this->lng->txt(
"cancel"));
 
  327                 $obj_str = 
"&class_id=".$this->object->id;
 
  328                 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction(
"delete",$this->ctrl->getFormAction($this).$obj_str));
 
  331                 foreach ($this->data[
"cols"] as $key)
 
  333                         $this->tpl->setCurrentBlock(
"table_header");
 
  334                         $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
 
  335                         $this->tpl->parseCurrentBlock();
 
  342                 foreach ($this->data[
"data"] as $key => $value)
 
  345                         foreach ($value as $key => $cell_data)
 
  347                                 $this->tpl->setCurrentBlock(
"table_cell");
 
  354                                 elseif ($key == 
"title")
 
  356                                         $name_field = explode(
"#separator#",$cell_data);
 
  358                                         $this->tpl->setVariable(
"TEXT_CONTENT", 
"<b>".$name_field[0].
"</b>");
 
  360                                         $this->tpl->setCurrentBlock(
"subtitle");
 
  361                                         $this->tpl->setVariable(
"DESC", $name_field[1]);
 
  362                                         $this->tpl->parseCurrentBlock();
 
  363                                         $this->tpl->setCurrentBlock(
"table_cell");
 
  367                                         $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
 
  370                                 $this->tpl->parseCurrentBlock();
 
  373                         $this->tpl->setCurrentBlock(
"table_row");
 
  375                         $this->tpl->parseCurrentBlock();
 
  381                 foreach ($this->data[
"buttons"] as $name => $value)
 
  383                         $this->tpl->setCurrentBlock(
"operation_btn");
 
  385                         $this->tpl->setVariable(
"BTN_NAME",$name);
 
  386                         $this->tpl->setVariable(
"BTN_VALUE",$value);
 
  387                         $this->tpl->parseCurrentBlock();
 
  399                 if($this->form_gui->checkInput())
 
  401                         $this->
object->setTitle( $this->form_gui->getInput(
'title' ));
 
  402                         $this->
object->setDescription( $this->form_gui->getInput(
'desc') );
 
  403                         $this->
object->setDocentId( $this->form_gui->getInput(
'instructoruserid') );
 
  404                         $this->
object->setStatus( $this->form_gui->getInput(
'alwaysopen') );
 
  406                         if(!$this->object->update())
 
  408                                 $this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE);
 
  413                         $this->ctrl->redirectByClass(
'ilobjilinccoursegui');
 
  417                         if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
 
  420                                 include_once 
'Modules/ILinc/classes/class.ilObjiLincCourse.php';
 
  423                                 $_POST[
'akclassvalue1'] = $akclassvalues[0];
 
  424                                 $_POST[
'akclassvalue2'] = $akclassvalues[1];
 
  427                         $this->form_gui->setValuesByPost();
 
  428                         return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
 
  434                 $next_class = $this->ctrl->getNextClass($this);
 
  435                 $cmd = $this->ctrl->getCmd();
 
  454                 session_unregister(
"saved_post");
 
  458                 $this->ctrl->redirectByClass(
"ilobjilinccoursegui");
 
  466                 if (!$this->object->delete())
 
  468                         $msg = $this->
object->getErrorMsg();
 
  472                         $msg = $this->lng->txt(
'icla_deleted');
 
  478                 $this->ctrl->redirectByClass(
"ilobjilinccoursegui");
 
  483                 return $this->
object->result_msg;
 
  494                 $this->ctrl->redirectByClass(
"ilobjilinccoursegui");