4 require_once
'Services/Object/classes/class.ilObjectGUI.php';
6 require_once
'Services/LTI/classes/InternalProvider/class.ilLTIToolConsumer.php';
7 require_once
'Services/LTI/classes/class.ilLTIDataConnector.php';
28 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
31 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
34 $GLOBALS[
'DIC']->language()->loadLanguageModule(
'lti');
39 $next_class = $this->ctrl->getNextClass($this);
40 $cmd = $this->ctrl->getCmd();
44 switch ($next_class) {
45 case 'ilpermissiongui':
46 $GLOBALS[
'ilTabs']->activateTab(
'perm_settings');
47 require_once
'Services/AccessControl/classes/class.ilPermissionGUI.php';
49 $this->ctrl->forwardCommand($perm_gui);
53 if (!$cmd || $cmd ==
'view') {
54 $cmd =
'listConsumers';
55 } elseif ($cmd ==
'createconsumer') {
56 $cmd =
"initConsumerForm";
72 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
78 $this->tabs_gui->addTab(
80 $this->lng->txt(
"consumers"),
81 $this->ctrl->getLinkTarget($this,
"listConsumers")
84 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
85 $this->tabs_gui->addTab(
87 $this->lng->txt(
"lti_released_objects"),
88 $this->ctrl->getLinkTarget($this,
"releasedObjects")
92 if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
93 $this->tabs_gui->addTab(
95 $this->lng->txt(
"perm_settings"),
96 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
106 $this->tabs_gui->activateTab(
"settings");
107 $this->tpl->setContent(
$form->getHTML());
113 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
179 $this->tpl->setContent(
$form->getHTML());
188 $this->tabs_gui->activateTab(
"consumers");
190 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
194 $ti_title =
new ilTextInputGUI($this->lng->txt(
"title"),
'title');
196 $ti_description =
new ilTextInputGUI($this->lng->txt(
"description"),
'description');
197 $ti_prefix =
new ilTextInputGUI($this->lng->txt(
"prefix"),
'prefix');
199 #$ti_key = new ilTextInputGUI($this->lng->txt("lti_consumer_key"), 'key'); 200 #$ti_key->setRequired(true); 201 #$ti_secret = new ilTextInputGUI($this->lng->txt("lti_consumer_secret"), 'secret'); 202 #$ti_secret->setRequired(true); 204 $languages = $this->lng->getInstalledLanguages();
205 $array_lang =
array();
206 foreach ($languages as $lang_key) {
210 $si_language =
new ilSelectInputGUI($this->lng->txt(
"language"),
"language");
215 $form->addItem($cb_active);
216 $form->addItem($ti_title);
217 $form->addItem($ti_description);
218 $form->addItem($ti_prefix);
219 #$form->addItem($ti_key); 220 #$form->addItem($ti_secret); 221 $form->addItem($si_language);
226 $valid_obj_types = $this->
object->getLTIObjectTypes();
227 foreach ($valid_obj_types as $obj_type) {
228 $object_name =
$GLOBALS[
'DIC']->language()->txt(
'objs_' . $obj_type);
231 $form->addItem($cb_obj_types);
234 $roles = $this->
object->getLTIRoles();
235 foreach ($roles as $role_id => $role_name) {
238 $si_roles =
new ilSelectInputGUI($this->lng->txt(
"gbl_roles_to_users"),
'role');
240 $form->addItem($si_roles);
242 if ($a_mode ==
'edit') {
243 $form->setFormAction($this->ctrl->getFormAction($this,
'editLTIConsumer'));
244 $form->setTitle($this->lng->txt(
"lti_edit_consumer"));
245 $form->addCommandButton(
"updateLTIConsumer", $this->lng->txt(
"save"));
247 $form->setFormAction($this->ctrl->getFormAction($this,
'createLTIConsumer'));
248 $form->setTitle($this->lng->txt(
"lti_create_consumer"));
249 $form->addCommandButton(
"createLTIConsumer", $this->lng->txt(
"save"));
250 $form->addCommandButton(
'listConsumers', $this->lng->txt(
'cancel'));
265 $consumer_id = $_REQUEST[
"cid"];
266 $ilCtrl->setParameter($this,
"cid", $consumer_id);
269 $ilCtrl->redirect($this,
"listConsumers");
275 $a_form->getItemByPostVar(
"title")->setValue(
$consumer->getTitle());
276 $a_form->getItemByPostVar(
"description")->setValue(
$consumer->getDescription());
277 $a_form->getItemByPostVar(
"prefix")->setValue(
$consumer->getPrefix());
278 $a_form->getItemByPostVar(
"language")->setValue(
$consumer->getLanguage());
279 $a_form->getItemByPostVar(
"active")->setChecked(
$consumer->getActive());
280 $a_form->getItemByPostVar(
"role")->setValue(
$consumer->getRole());
281 $a_form->getItemByPostVar(
"types")->setValue($this->
object->getActiveObjectTypes($consumer_id));
283 $tpl->setContent($a_form->getHTML());
295 if (
$form->checkInput()) {
305 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
307 $this->
object->saveConsumerObjectTypes(
309 $form->getInput(
'types')
312 $GLOBALS[
'DIC']->ctrl()->redirect($this,
'listConsumers');
315 $form->setValuesByPost();
330 $consumer_id = $_REQUEST[
"cid"];
332 $ilCtrl->redirect($this,
"listConsumers");
335 $ilCtrl->setParameter($this,
"cid", $consumer_id);
339 if (
$form->checkInput()) {
346 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
347 $this->
object->saveConsumerObjectTypes($consumer_id,
$form->getInput(
'types'));
362 $consumer_id = $_REQUEST[
'cid'];
365 $ilCtrl->redirect($this,
"listConsumers");
368 $consumer->deleteGlobalToolConsumerSettings($this->dataConnector);
370 $GLOBALS[
'DIC']->ctrl()->redirect($this,
'listConsumers');
381 global $ilAccess, $ilToolbar;
384 $ilToolbar->addButton(
385 $this->lng->txt(
'lti_create_consumer'),
386 $this->ctrl->getLinkTarget($this,
'createconsumer')
390 $this->tabs_gui->activateTab(
"consumers");
392 include_once
"Services/LTI/classes/Consumer/class.ilLTIConsumerTableGUI.php";
398 $this->tpl->setContent(
$tbl->getHTML());
409 $consumer_id = $_REQUEST[
"cid"];
412 $ilCtrl->redirect($this,
"listConsumers");
418 $msg =
"lti_consumer_set_inactive";
421 $msg =
"lti_consumer_set_active";
423 $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
426 $GLOBALS[
'DIC']->ctrl()->redirect($this,
'listConsumers');
434 $GLOBALS[
'DIC']->tabs()->activateTab(
'releasedObjects');
440 $GLOBALS[
'DIC']->ui()->mainTemplate()->setContent(
$table->getHTML());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
editConsumer(ilPropertyFormGUI $a_form=null)
Edit consumer type $ilCtrl type $tpl.
changeStatusLTIConsumer()
Change activation status type $ilCtrl.
This class represents an option in a checkbox group.
Class ilObjLTIAdministrationGUI.
createLTIConsumer()
Create new lti consumer.
Class to represent an LTI Data Connector for ILIAS.
$dataConnector
Data connector object or string.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
deleteLTIConsumer()
Delete consumers type $ilCtrl.
updateLTIConsumer()
Update lti consumer settings ilCtrl $ilCtrl.
static _lookupEntry($a_lang_key, $a_mod, $a_id)
initSettingsForm(ilPropertyFormGUI $form=null)
initConsumerForm(ilPropertyFormGUI $form=null)
getConsumerForm($a_mode='')
prepareOutput($a_show_subobjects=true)
prepare output
if(isset($_POST['submit'])) $form
TableGUI class for LTI consumer listing.
Class ilObjectGUI Basic methods of all Output classes.
This class represents a text property in a property form.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Description of class class.
Create styles array
The data for the language used.
listConsumers()
List consumers type $ilAccess type $ilToolbar.
Create new PHPExcel object
obj_idprivate
releasedObjects()
Show relases objects.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if(empty($password)) $table
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options