ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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_consultation_hours ()
 
 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 ()
 
 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 ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ilObjUser $user
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
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 = ""
 
DOMDocument $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 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 172 of file class.ilPCConsultationHoursGUI.php.

172 : void
173 {
174 $form = $this->initForm(true);
175 if ($form->checkInput()) {
176 $grp_ids = null;
177 $mode = $form->getInput("mode");
178 if ($mode == "manual") {
179 $grp_ids = $form->getInput("grp");
180 }
181
182 $this->content_obj = new ilPCConsultationHours($this->getPage());
183 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
184 $this->content_obj->setData($mode, (array) $grp_ids);
185 $this->updated = $this->pg_obj->update();
186 if ($this->updated === true) {
187 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
188 }
189 }
190
191 $form->setValuesByPost();
192 $this->insert($form);
193 }
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().

Referenced by create_consultation_hours().

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

◆ create_consultation_hours()

ilPCConsultationHoursGUI::create_consultation_hours ( )

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

167 : void
168 {
169 $this->create();
170 }

References create().

+ 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 ILIAS\UICore\GlobalTemplate\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;
94 $ilUser = $this->user;
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 // begin-abandon ch_groups
115 $mode->setValue('auto');
116 /*
117 $opt_manual = new ilRadioOption($this->lng->txt("cont_cach_mode_manual"), "manual");
118 $opt_manual->setInfo($this->lng->txt("cont_cach_mode_manual_info"));
119 $mode->addOption($opt_manual);
120
121 if (!$this->getPageConfig()->getEnablePCType("PlaceHolder")) {
122 $grp_ids = ilConsultationHourGroups::getGroupsOfUser($ilUser->getId());
123 if (count($grp_ids)) {
124 $this->lng->loadLanguageModule("dateplaner");
125 $groups = new ilCheckboxGroupInputGUI($this->lng->txt("cal_ch_app_grp"), "grp");
126 $groups->setRequired(true);
127 $opt_manual->addSubItem($groups);
128
129 foreach ($grp_ids as $grp_obj) {
130 $groups->addOption(new ilCheckboxOption($grp_obj->getTitle(), $grp_obj->getGroupId()));
131 }
132 } else {
133 $opt_manual->setDisabled(true);
134 }
135 } else {
136 $opt_manual->setDisabled(true);
137 }
138 */
139 // end-abandon ch_groups
140
141 if ($a_insert) {
142 $mode->setValue("auto");
143
144 $form->addCommandButton("create_consultation_hours", $this->lng->txt("select"));
145 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
146 } else {
147 // begin-abandon ch_groups
148 // set values
149 /*
150 $grp_ids = $this->content_obj->getGroupIds();
151 if (count($grp_ids)) {
152 $mode->setValue("manual");
153 $groups->setValue($grp_ids);
154 } else {
155 $mode->setValue("auto");
156 }
157 */
158 // end-abandon ch_groups
159
160 $form->addCommandButton("update", $this->lng->txt("select"));
161 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
162 }
163
164 return $form;
165 }
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.

References ilPageContentGUI\$ctrl, $user, 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 ILIAS\UICore\GlobalTemplate\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 195 of file class.ilPCConsultationHoursGUI.php.

195 : void
196 {
197 $form = $this->initForm();
198 if ($form->checkInput()) {
199 $grp_ids = array();
200 $mode = $form->getInput("mode");
201 if ($mode == "manual") {
202 $grp_ids = $form->getInput("grp");
203 }
204
205 $this->content_obj->setData($mode, $grp_ids);
206 $this->updated = $this->pg_obj->update();
207 if ($this->updated === true) {
208 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
209 }
210 }
211
212 $this->pg_obj->addHierIDs();
213 $form->setValuesByPost();
214 $this->edit($form);
215 }
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: