ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 @access 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 @access 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
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 @access public.

Reimplemented from ilPageContentGUI.

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

25 {
26 global $DIC;
27
28 $this->tpl = $DIC["tpl"];
29 $this->ctrl = $DIC->ctrl();
30 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
31 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ create()

ilPCMyCoursesGUI::create ( )

Create new courses.

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

137 {
138 $form = $this->initForm(true);
139 if ($form->checkInput()) {
140 $sort = $form->getInput("sort");
141
142 $this->content_obj = new ilPCMyCourses($this->getPage());
143 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
144 $this->content_obj->setData($sort);
145 $this->updated = $this->pg_obj->update();
146 if ($this->updated === true) {
147 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
148 }
149 }
150
151 $form->setValuesByPost();
152 return $this->insert($form);
153 }
initForm($a_insert=false)
Init courses form.
insert(ilPropertyFormGUI $a_form=null)
Insert courses form.
Class ilPCMyCourses.
if(isset($_POST['submit'])) $form

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

+ 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 79 of file class.ilPCMyCoursesGUI.php.

80 {
82
84
85 if (!$a_form) {
86 $a_form = $this->initForm();
87 }
88 $tpl->setContent($a_form->getHTML());
89 }
displayValidationError()
display validation errors

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

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCMyCoursesGUI::executeCommand ( )

execute command

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

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

References $ret.

◆ initForm()

ilPCMyCoursesGUI::initForm (   $a_insert = false)
protected

Init courses form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

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

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

References ilPageContentGUI\$ctrl, $form, and $ilCtrl.

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

+ 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 58 of file class.ilPCMyCoursesGUI.php.

59 {
61
62 /* #12816 - no form needed yet
63 $this->create();
64 */
65
67
68 if (!$a_form) {
69 $a_form = $this->initForm(true);
70 }
71 $tpl->setContent($a_form->getHTML());
72 }

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

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCMyCoursesGUI::update ( )

Update courses.

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

159 {
160 $form = $this->initForm();
161 if ($form->checkInput()) {
162 $sort = $form->getInput("sort");
163
164 $this->content_obj->setData($sort);
165 $this->updated = $this->pg_obj->update();
166 if ($this->updated === true) {
167 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
168 }
169 }
170
171 $this->pg_obj->addHierIDs();
172 $form->setValuesByPost();
173 return $this->edit($form);
174 }
edit(ilPropertyFormGUI $a_form=null)
Edit courses form.

References $form, edit(), and initForm().

+ Here is the call graph for this function:

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