ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjLearningResourcesSettingsGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Object/classes/class.ilObjectGUI.php");
5include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
6
20{
21 private static $ERROR_MESSAGE;
27 public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
28 {
29 $this->type = 'lrss';
30 parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
31
32 $this->lng->loadLanguageModule('content');
33 }
34
41 public function executeCommand()
42 {
43 global $rbacsystem,$ilErr,$ilAccess;
44
45 $next_class = $this->ctrl->getNextClass($this);
46 $cmd = $this->ctrl->getCmd();
47
48 $this->prepareOutput();
49
50 if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
51 {
52 $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
53 }
54
55 switch($next_class)
56 {
57 case 'illicenseoverviewgui':
58 include_once("./Services/License/classes/class.ilLicenseOverviewGUI.php");
60 $ret =& $this->ctrl->forwardCommand($license_gui);
61 break;
62
63 case 'ilpermissiongui':
64 $this->tabs_gui->setTabActive('perm_settings');
65 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
66 $perm_gui =& new ilPermissionGUI($this);
67 $ret =& $this->ctrl->forwardCommand($perm_gui);
68 break;
69
70 default:
71 if(!$cmd || $cmd == 'view')
72 {
73 $cmd = "editSettings";
74 }
75
76 $this->$cmd();
77 break;
78 }
79 return true;
80 }
81
88 public function getAdminTabs()
89 {
90 global $rbacsystem, $ilAccess, $ilSetting;
91
92 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
93 {
94 $this->tabs_gui->addTarget("cont_edit_lrs_settings",
95 $this->ctrl->getLinkTarget($this, "editSettings"),
96 array("editSettings", "view"));
97
98 include_once("Services/License/classes/class.ilLicenseAccess.php");
100 {
101 $this->tabs_gui->addTarget("licenses",
102 $this->ctrl->getLinkTargetByClass('illicenseoverviewgui', ''),
103 "", "illicenseoverviewgui");
104 }
105 }
106
107 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
108 {
109 $this->tabs_gui->addTarget("perm_settings",
110 $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
111 array(),'ilpermissiongui');
112 }
113 }
114
118 public function editSettings()
119 {
120 global $ilCtrl, $lng, $ilSetting;
121
122 $lm_set = new ilSetting("lm");
123 $lic_set = new ilSetting("license");
124 $lng->loadLanguageModule("license");
125 $lng->loadLanguageModule("scormdebug");
126
127 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
128 $form = new ilPropertyFormGUI();
129 $form->setFormAction($ilCtrl->getFormAction($this));
130 $form->setTitle($lng->txt("cont_lrs_settings"));
131
132 // Page History
133 $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_enable_page_history"),
134 "page_history");
135 $cb_prop->setInfo($lng->txt("cont_enable_page_history_info"));
136 $cb_prop->setChecked($lm_set->get("page_history", 1));
137 $form->addItem($cb_prop);
138
139 // Time scheduled page activation
140 $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_enable_time_scheduled_page_activation"),
141 "time_scheduled_page_activation");
142 $cb_prop->setInfo($lng->txt("cont_enable_time_scheduled_page_activation_info"));
143 $cb_prop->setChecked($lm_set->get("time_scheduled_page_activation"));
144 $form->addItem($cb_prop);
145
146 // Activate replace media object function
147 $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_replace_mob_feature"),
148 "replace_mob_feature");
149 $cb_prop->setInfo($lng->txt("cont_replace_mob_feature_info"));
150 $cb_prop->setChecked($lm_set->get("replace_mob_feature"));
151 $form->addItem($cb_prop);
152
153 // Activate HTML export IDs
154 $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_html_export_ids"),
155 "html_export_ids");
156 $cb_prop->setInfo($lng->txt("cont_html_export_ids_info"));
157 $cb_prop->setChecked($lm_set->get("html_export_ids"));
158 $form->addItem($cb_prop);
159
160 // Upload dir for learning resources
161 $tx_prop = new ilTextInputGUI($lng->txt("cont_upload_dir"),
162 "cont_upload_dir");
163 $tx_prop->setInfo($lng->txt("cont_upload_dir_info"));
164 $tx_prop->setValue($lm_set->get("cont_upload_dir"));
165 $form->addItem($tx_prop);
166
167
168 // license activation
169 $cb_prop = new ilCheckboxInputGUI($lng->txt("license_counter"),
170 "license_counter");
171 $cb_prop->setInfo($lng->txt("license_counter_info"));
172 $cb_prop->setChecked($lic_set->get("license_counter"));
173 $form->addItem($cb_prop);
174
175 // license warning
176 $tx_prop = new ilNumberInputGUI($lng->txt("license_warning"),
177 "license_warning");
178 $tx_prop->setSize(5);
179 $tx_prop->setInfo($lng->txt("license_warning_info"));
180 $tx_prop->setValue($lic_set->get("license_warning"));
181 $form->addItem($tx_prop);
182
183 // scormDebugger activation
184 $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_global_activate"),"scormdebug_global_activate");
185 $cb_prop->setInfo($lng->txt("scormdebug_global_activate_info"));
186 $cb_prop->setChecked($lm_set->get("scormdebug_global_activate"));
187 $form->addItem($cb_prop);
188
189 // scorm2004 login instead of userId for cmi.learner_id
190 $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_login_as_learner_id"),
191 "scorm_login_as_learner_id");
192 $cb_prop->setInfo($lng->txt("scorm_login_as_learner_id_info"));
193 $cb_prop->setChecked($lm_set->get("scorm_login_as_learner_id"));
194 $form->addItem($cb_prop);
195
196 // scorm2004 disableRTECaching
197 $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_disable_cache"),
198 "scormdebug_disable_cache");
199 $cb_prop->setInfo($lng->txt("scormdebug_disable_cache_info"));
200 $cb_prop->setChecked($lm_set->get("scormdebug_disable_cache"));
201 $form->addItem($cb_prop);
202
203 // scorm2004 without session
204 $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_without_session"),
205 "scorm_without_session");
206 $cb_prop->setInfo($lng->txt("scorm_without_session_info"));
207 $cb_prop->setChecked($lm_set->get("scorm_without_session"));
208 $form->addItem($cb_prop);
209
211 $check = new ilCheckboxInputGui($lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
212 $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
213 $check->setChecked($privacy->enabledSahsProtocolData());
214 $form->addItem($check);
215
216 // show and export protocol data with name
217 $check = new ilCheckboxInputGui($this->lng->txt('ps_export_scorm'), 'export_scorm');
218 $check->setInfo($this->lng->txt('enable_export_scorm_desc'));
219 $check->setChecked($privacy->enabledExportSCORM());
220 $form->addItem($check);
221
222 // scorm auto-setting for learning progress
223 $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_lp_auto_activate"),"scorm_lp_auto_activate");
224 $cb_prop->setInfo($lng->txt("scorm_lp_auto_activate_info"));
225 $cb_prop->setChecked($lm_set->get("scorm_lp_auto_activate"));
226 $form->addItem($cb_prop);
227
228 // command buttons
229 $form->addCommandButton("saveSettings", $lng->txt("save"));
230 $form->addCommandButton("view", $lng->txt("cancel"));
231
232 $this->tpl->setContent($form->getHTML());
233 }
234
238 public function saveSettings()
239 {
240 global $ilCtrl, $ilSetting;
241
242 $lm_set = new ilSetting("lm");
243 $lm_set->set("time_scheduled_page_activation",
244 ilUtil::stripSlashes($_POST["time_scheduled_page_activation"]));
245 $lm_set->set("page_history",
246 (int) ilUtil::stripSlashes($_POST["page_history"]));
247 $lm_set->set("replace_mob_feature",
248 ilUtil::stripSlashes($_POST["replace_mob_feature"]));
249 $lm_set->set("html_export_ids",
250 ilUtil::stripSlashes($_POST["html_export_ids"]));
251 $lm_set->set("cont_upload_dir",
252 ilUtil::stripSlashes($_POST["cont_upload_dir"]));
253 $lm_set->setScormDebug("scormdebug_global_activate",
254 ilUtil::stripSlashes($_POST["scormdebug_global_activate"]));
255 $lm_set->set("scorm_login_as_learner_id",
256 ilUtil::stripSlashes($_POST["scorm_login_as_learner_id"]));
257 $lm_set->set("scormdebug_disable_cache",
258 ilUtil::stripSlashes($_POST["scormdebug_disable_cache"]));
259 $lm_set->set("scorm_without_session",
260 ilUtil::stripSlashes($_POST["scorm_without_session"]));
261 $lm_set->set("scorm_lp_auto_activate",
262 ilUtil::stripSlashes($_POST["scorm_lp_auto_activate"]));
263 $lic_set = new ilSetting("license");
264 $lic_set->set("license_counter",
265 ilUtil::stripSlashes($_POST["license_counter"]));
266 $lic_set->set("license_warning",
267 ilUtil::stripSlashes($_POST["license_warning"]));
268
270 $privacy->enableSahsProtocolData((int) $_POST['enable_sahs_pd']);
271 $privacy->enableExportSCORM((int) $_POST['export_scorm']);
272 $privacy->save();
273
274 ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
275
276 $ilCtrl->redirect($this, "view");
277 }
278
279 public function addToExternalSettingsForm($a_form_id)
280 {
281 switch($a_form_id)
282 {
284
286
287 $fields = array('enable_sahs_protocol_data' => array($privacy->enabledSahsProtocolData(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
288
289 return array(array("editSettings", $fields));
290 }
291 }
292}
293
294?>
This class represents a checkbox property in a property form.
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
This class represents a number property in a property form.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getInstance()
Get instance of ilPrivacySettings.
This class represents a property form user interface.
ILIAS Setting Class.
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:40
$cmd
Definition: sahs_server.php:35
$lm_set