ILIAS  release_8 Revision v8.24
ilPCConsultationHoursGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPCConsultationHoursGUI:
+ Collaboration diagram for ilPCConsultationHoursGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 insert (ilPropertyFormGUI $a_form=null)
 Insert consultation hours form. More...
 
 edit (ilPropertyFormGUI $a_form=null)
 Edit consultation hours form. More...
 
 create ()
 
 update ()
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 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 ()
 
 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 (string $a_type="")
 Get table templates. More...
 

Protected Member Functions

 initForm (bool $a_insert=false)
 Init consultation hours form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 

Protected Attributes

ilObjUser $user
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
php4DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilPCConsultationHoursGUI Handles user commands on consultation hour 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 24 of file class.ilPCConsultationHoursGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCConsultationHoursGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Reimplemented from ilPageContentGUI.

Definition at line 28 of file class.ilPCConsultationHoursGUI.php.

33 {
34 global $DIC;
35
36 $this->tpl = $DIC["tpl"];
37 $this->ctrl = $DIC->ctrl();
38 $this->user = $DIC->user();
39 $this->lng = $DIC->language();
40 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
41 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCConsultationHoursGUI::create ( )

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

158 : void
159 {
160 $form = $this->initForm(true);
161 if ($form->checkInput()) {
162 $grp_ids = null;
163 $mode = $form->getInput("mode");
164 if ($mode == "manual") {
165 $grp_ids = $form->getInput("grp");
166 }
167
168 $this->content_obj = new ilPCConsultationHours($this->getPage());
169 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
170 $this->content_obj->setData($mode, (array) $grp_ids);
171 $this->updated = $this->pg_obj->update();
172 if ($this->updated === true) {
173 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
174 }
175 }
176
177 $form->setValuesByPost();
178 $this->insert($form);
179 }
initForm(bool $a_insert=false)
Init consultation hours form.
insert(ilPropertyFormGUI $a_form=null)
Insert consultation hours form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ilPageContentGUI\getPage(), initForm(), and insert().

+ Here is the call graph for this function:

◆ edit()

ilPCConsultationHoursGUI::edit ( ilPropertyFormGUI  $a_form = null)

Edit consultation hours form.

Definition at line 76 of file class.ilPCConsultationHoursGUI.php.

76 : void
77 {
79
81
82 if (!$a_form) {
83 $a_form = $this->initForm();
84 }
85 $tpl->setContent($a_form->getHTML());
86 }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

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

Referenced by update().

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

◆ executeCommand()

ilPCConsultationHoursGUI::executeCommand ( )

Definition at line 43 of file class.ilPCConsultationHoursGUI.php.

43 : void
44 {
45 // get next class that processes or forwards current command
46 $next_class = $this->ctrl->getNextClass($this);
47
48 // get current command
49 $cmd = $this->ctrl->getCmd();
50
51 switch ($next_class) {
52 default:
53 $this->$cmd();
54 break;
55 }
56 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initForm()

ilPCConsultationHoursGUI::initForm ( bool  $a_insert = false)
protected

Init consultation hours form.

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

92 {
93 $ilCtrl = $this->ctrl;
95
96 $groups = null;
97
98 $form = new ilPropertyFormGUI();
99 $form->setFormAction($ilCtrl->getFormAction($this));
100 if ($a_insert) {
101 $form->setTitle($this->lng->txt("cont_insert_consultation_hours"));
102 } else {
103 $form->setTitle($this->lng->txt("cont_update_consultation_hours"));
104 }
105
106 $mode = new ilRadioGroupInputGUI($this->lng->txt("cont_cach_mode"), "mode");
107 $mode->setRequired(true);
108 $form->addItem($mode);
109
110 $opt_auto = new ilRadioOption($this->lng->txt("cont_cach_mode_automatic"), "auto");
111 $opt_auto->setInfo($this->lng->txt("cont_cach_mode_automatic_info"));
112 $mode->addOption($opt_auto);
113
114 $opt_manual = new ilRadioOption($this->lng->txt("cont_cach_mode_manual"), "manual");
115 $opt_manual->setInfo($this->lng->txt("cont_cach_mode_manual_info"));
116 $mode->addOption($opt_manual);
117
118 if (!$this->getPageConfig()->getEnablePCType("PlaceHolder")) {
120 if (count($grp_ids)) {
121 $this->lng->loadLanguageModule("dateplaner");
122 $groups = new ilCheckboxGroupInputGUI($this->lng->txt("cal_ch_app_grp"), "grp");
123 $groups->setRequired(true);
124 $opt_manual->addSubItem($groups);
125
126 foreach ($grp_ids as $grp_obj) {
127 $groups->addOption(new ilCheckboxOption($grp_obj->getTitle(), $grp_obj->getGroupId()));
128 }
129 } else {
130 $opt_manual->setDisabled(true);
131 }
132 } else {
133 $opt_manual->setDisabled(true);
134 }
135
136 if ($a_insert) {
137 $mode->setValue("auto");
138
139 $form->addCommandButton("create_consultation_hours", $this->lng->txt("select"));
140 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
141 } else {
142 // set values
143 $grp_ids = $this->content_obj->getGroupIds();
144 if (count($grp_ids)) {
145 $mode->setValue("manual");
146 $groups->setValue($grp_ids);
147 } else {
148 $mode->setValue("auto");
149 }
150
151 $form->addCommandButton("update", $this->lng->txt("select"));
152 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
153 }
154
155 return $form;
156 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getGroupsOfUser(int $a_user_id)
Get a all groups of an user.
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34

References ilPageContentGUI\$ctrl, $ilUser, $user, ilConsultationHourGroups\getGroupsOfUser(), ilPageContentGUI\getPageConfig(), and ILIAS\Repository\lng().

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

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

◆ insert()

ilPCConsultationHoursGUI::insert ( ilPropertyFormGUI  $a_form = null)

Insert consultation hours form.

Definition at line 61 of file class.ilPCConsultationHoursGUI.php.

61 : void
62 {
64
66
67 if (!$a_form) {
68 $a_form = $this->initForm(true);
69 }
70 $tpl->setContent($a_form->getHTML());
71 }

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

Referenced by create().

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

◆ update()

ilPCConsultationHoursGUI::update ( )

Definition at line 181 of file class.ilPCConsultationHoursGUI.php.

181 : void
182 {
183 $form = $this->initForm();
184 if ($form->checkInput()) {
185 $grp_ids = array();
186 $mode = $form->getInput("mode");
187 if ($mode == "manual") {
188 $grp_ids = $form->getInput("grp");
189 }
190
191 $this->content_obj->setData($mode, $grp_ids);
192 $this->updated = $this->pg_obj->update();
193 if ($this->updated === true) {
194 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
195 }
196 }
197
198 $this->pg_obj->addHierIDs();
199 $form->setValuesByPost();
200 $this->edit($form);
201 }
edit(ilPropertyFormGUI $a_form=null)
Edit consultation hours form.

References ILIAS\Repository\ctrl(), edit(), and initForm().

+ Here is the call graph for this function:

Field Documentation

◆ $user

ilObjUser ilPCConsultationHoursGUI::$user
protected

Definition at line 26 of file class.ilPCConsultationHoursGUI.php.

Referenced by initForm().


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