ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPCMyCoursesGUI Class Reference

Class ilPCMyCoursesGUI. More...

+ Inheritance diagram for ilPCMyCoursesGUI:
+ Collaboration diagram for ilPCMyCoursesGUI:

Public Member Functions

 __construct ($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 insert (ilPropertyFormGUI $a_form=null)
 Insert courses form. More...
 
 edit (ilPropertyFormGUI $a_form=null)
 Edit courses form. More...
 
 create ()
 Create new courses. More...
 
 update ()
 Update courses. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions ($a_type)
 Get table templates. More...
 

Protected Member Functions

 initForm ($a_insert=false)
 Init courses form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Attributes inherited from ilPageContentGUI
 $log
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCMyCoursesGUI.

Handles user commands on my courses data

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$I$

Definition at line 18 of file class.ilPCMyCoursesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCMyCoursesGUI::__construct (   $a_pg_obj,
  $a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

Definition at line 24 of file class.ilPCMyCoursesGUI.php.

25  {
26  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
27  }

Member Function Documentation

◆ create()

ilPCMyCoursesGUI::create ( )

Create new courses.

Definition at line 141 of file class.ilPCMyCoursesGUI.php.

References ilPageContentGUI\getPage(), initForm(), and insert().

142  {
143  $form = $this->initForm(true);
144  if($form->checkInput())
145  {
146  $sort = $form->getInput("sort");
147 
148  $this->content_obj = new ilPCMyCourses($this->getPage());
149  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
150  $this->content_obj->setData($sort);
151  $this->updated = $this->pg_obj->update();
152  if ($this->updated === true)
153  {
154  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
155  }
156  }
157 
158  $form->setValuesByPost();
159  return $this->insert($form);
160  }
initForm($a_insert=false)
Init courses form.
Class ilPCMyCourses.
insert(ilPropertyFormGUI $a_form=null)
Insert courses form.
+ Here is the call graph for this function:

◆ edit()

ilPCMyCoursesGUI::edit ( ilPropertyFormGUI  $a_form = null)

Edit courses form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 77 of file class.ilPCMyCoursesGUI.php.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

Referenced by update().

78  {
79  global $tpl;
80 
81  $this->displayValidationError();
82 
83  if(!$a_form)
84  {
85  $a_form = $this->initForm();
86  }
87  $tpl->setContent($a_form->getHTML());
88  }
initForm($a_insert=false)
Init courses form.
displayValidationError()
display validation errors
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCMyCoursesGUI::executeCommand ( )

execute command

Definition at line 32 of file class.ilPCMyCoursesGUI.php.

References $cmd, and $ret.

33  {
34  // get next class that processes or forwards current command
35  $next_class = $this->ctrl->getNextClass($this);
36 
37  // get current command
38  $cmd = $this->ctrl->getCmd();
39 
40  switch($next_class)
41  {
42  default:
43  $ret =& $this->$cmd();
44  break;
45  }
46 
47  return $ret;
48  }
$cmd
Definition: sahs_server.php:35
$ret
Definition: parser.php:6

◆ initForm()

ilPCMyCoursesGUI::initForm (   $a_insert = false)
protected

Init courses form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

Definition at line 96 of file class.ilPCMyCoursesGUI.php.

References $ilCtrl, and ilFormPropertyGUI\setInfo().

Referenced by create(), edit(), insert(), and update().

97  {
98  global $ilCtrl;
99 
100  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
101  $form = new ilPropertyFormGUI();
102  $form->setFormAction($ilCtrl->getFormAction($this));
103  if ($a_insert)
104  {
105  $form->setTitle($this->lng->txt("cont_insert_my_courses"));
106  }
107  else
108  {
109  $form->setTitle($this->lng->txt("cont_update_my_courses"));
110  }
111 
112  $sort = new ilRadioGroupInputGUI($this->lng->txt("cont_mycourses_sortorder"), "sort");
113  $sort->setInfo($this->lng->txt("cont_mycourses_sortorder_info")); //#15511
114  $sort->setRequired(true);
115  $form->addItem($sort);
116 
117  $sort->addOption(new ilRadioOption($this->lng->txt("cont_mycourses_sortorder_alphabetical"), "alpha"));
118  $sort->addOption(new ilRadioOption($this->lng->txt("cont_mycourses_sortorder_location"), "loc"));
119 
120  if ($a_insert)
121  {
122  $sort->setValue("alpha");
123 
124  $form->addCommandButton("create_my_courses", $this->lng->txt("save"));
125  $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
126  }
127  else
128  {
129  $sort->setValue($this->content_obj->getSorting());
130 
131  $form->addCommandButton("update", $this->lng->txt("save"));
132  $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
133  }
134 
135  return $form;
136  }
This class represents an option in a radio group.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCMyCoursesGUI::insert ( ilPropertyFormGUI  $a_form = null)

Insert courses form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 55 of file class.ilPCMyCoursesGUI.php.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

Referenced by create().

56  {
57  global $tpl;
58 
59  /* #12816 - no form needed yet
60  $this->create();
61  */
62 
63  $this->displayValidationError();
64 
65  if(!$a_form)
66  {
67  $a_form = $this->initForm(true);
68  }
69  $tpl->setContent($a_form->getHTML());
70  }
initForm($a_insert=false)
Init courses form.
displayValidationError()
display validation errors
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCMyCoursesGUI::update ( )

Update courses.

Definition at line 165 of file class.ilPCMyCoursesGUI.php.

References edit(), and initForm().

166  {
167  $form = $this->initForm();
168  if($form->checkInput())
169  {
170  $sort = $form->getInput("sort");
171 
172  $this->content_obj->setData($sort);
173  $this->updated = $this->pg_obj->update();
174  if ($this->updated === true)
175  {
176  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
177  }
178  }
179 
180  $this->pg_obj->addHierIDs();
181  $form->setValuesByPost();
182  return $this->edit($form);
183  }
initForm($a_insert=false)
Init courses form.
edit(ilPropertyFormGUI $a_form=null)
Edit courses form.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: