ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 
 $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
 $error
 
 $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

Definition at line 12 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 18 of file class.ilPCMyCoursesGUI.php.

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

19  {
20  global $DIC;
21 
22  $this->tpl = $DIC["tpl"];
23  $this->ctrl = $DIC->ctrl();
24  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
25  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCMyCoursesGUI::create ( )

Create new courses.

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

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

130  {
131  $form = $this->initForm(true);
132  if ($form->checkInput()) {
133  $sort = $form->getInput("sort");
134 
135  $this->content_obj = new ilPCMyCourses($this->getPage());
136  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
137  $this->content_obj->setData($sort);
138  $this->updated = $this->pg_obj->update();
139  if ($this->updated === true) {
140  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
141  }
142  }
143 
144  $form->setValuesByPost();
145  return $this->insert($form);
146  }
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 73 of file class.ilPCMyCoursesGUI.php.

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

Referenced by update().

74  {
75  $tpl = $this->tpl;
76 
77  $this->displayValidationError();
78 
79  if (!$a_form) {
80  $a_form = $this->initForm();
81  }
82  $tpl->setContent($a_form->getHTML());
83  }
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 30 of file class.ilPCMyCoursesGUI.php.

References $ret.

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

◆ initForm()

ilPCMyCoursesGUI::initForm (   $a_insert = false)
protected

Init courses form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

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

References ilPageContentGUI\$ctrl, $ilCtrl, and ilFormPropertyGUI\setInfo().

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

92  {
94 
95  $form = new ilPropertyFormGUI();
96  $form->setFormAction($ilCtrl->getFormAction($this));
97  if ($a_insert) {
98  $form->setTitle($this->lng->txt("cont_insert_my_courses"));
99  } else {
100  $form->setTitle($this->lng->txt("cont_update_my_courses"));
101  }
102 
103  $sort = new ilRadioGroupInputGUI($this->lng->txt("cont_mycourses_sortorder"), "sort");
104  $sort->setInfo($this->lng->txt("cont_mycourses_sortorder_info")); //#15511
105  $sort->setRequired(true);
106  $form->addItem($sort);
107 
108  $sort->addOption(new ilRadioOption($this->lng->txt("cont_mycourses_sortorder_alphabetical"), "alpha"));
109  $sort->addOption(new ilRadioOption($this->lng->txt("cont_mycourses_sortorder_location"), "loc"));
110 
111  if ($a_insert) {
112  $sort->setValue("alpha");
113 
114  $form->addCommandButton("create_my_courses", $this->lng->txt("save"));
115  $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
116  } else {
117  $sort->setValue($this->content_obj->getSorting());
118 
119  $form->addCommandButton("update", $this->lng->txt("save"));
120  $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
121  }
122 
123  return $form;
124  }
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 52 of file class.ilPCMyCoursesGUI.php.

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

Referenced by create().

53  {
54  $tpl = $this->tpl;
55 
56  /* #12816 - no form needed yet
57  $this->create();
58  */
59 
60  $this->displayValidationError();
61 
62  if (!$a_form) {
63  $a_form = $this->initForm(true);
64  }
65  $tpl->setContent($a_form->getHTML());
66  }
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 151 of file class.ilPCMyCoursesGUI.php.

References edit(), and initForm().

152  {
153  $form = $this->initForm();
154  if ($form->checkInput()) {
155  $sort = $form->getInput("sort");
156 
157  $this->content_obj->setData($sort);
158  $this->updated = $this->pg_obj->update();
159  if ($this->updated === true) {
160  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
161  }
162  }
163 
164  $this->pg_obj->addHierIDs();
165  $form->setValuesByPost();
166  return $this->edit($form);
167  }
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: