3declare(strict_types=1);
 
   36    public function __construct(?array $a_data, 
int $a_id, 
bool $a_call_by_reference = 
true, 
bool $a_prepare_output = 
true)
 
   39        $DIC->language()->loadLanguageModule(
'lti'); 
 
   44        if (
$DIC->http()->wrapper()->query()->has(
"cid")) {
 
   45            $this->consumer_id = (
int) 
$DIC->http()->wrapper()->query()->retrieve(
"cid", 
$DIC->refinery()->kindlyTo()->int());
 
   51        $next_class = $this->
ctrl->getNextClass($this);
 
   52        $cmd = $this->
ctrl->getCmd();
 
   56        switch ($next_class) {
 
   57            case 'ilpermissiongui':
 
   58                $GLOBALS[
'ilTabs']->activateTab(
'perm_settings');
 
   60                $this->
ctrl->forwardCommand($perm_gui);
 
   63            case 'illticonsumeradministrationgui':
 
   64                $this->tabs_gui->activateTab(
'lti_consuming');
 
   66                $this->
ctrl->forwardCommand($gui);
 
   70                $this->tabs_gui->activateTab(
'lti_providing');
 
   71                if (!$cmd || $cmd == 
'view') {
 
   72                    $cmd = 
'listConsumers';
 
   73                } elseif ($cmd == 
'createconsumer') {
 
   74                    $cmd = 
"initConsumerForm";
 
   88        if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
 
   89            $this->tabs_gui->addTab(
 
   91                $this->
lng->txt(
"lti_providing_tab"),
 
   92                $this->ctrl->getLinkTarget($this, 
"listConsumers")
 
   95            $this->tabs_gui->addTab(
 
   97                $this->
lng->txt(
"lti_consuming_tab"),
 
   98                $this->ctrl->getLinkTargetByClass(
'ilLTIConsumerAdministrationGUI')
 
  101            if ($this->
ctrl->getCmdClass() == 
'ilobjltiadministrationgui') {
 
  106        if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
 
  107            $this->tabs_gui->addTab(
 
  109                $this->
lng->txt(
"perm_settings"),
 
  110                $this->ctrl->getLinkTargetByClass(
'ilpermissiongui', 
"perm")
 
  117        if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
 
  123            $this->tabs_gui->addSubTab(
 
  125                $this->
lng->txt(
"consumers"),
 
  126                $this->ctrl->getLinkTarget($this, 
"listConsumers")
 
  129        if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
 
  130            $this->tabs_gui->addSubTab(
 
  132                $this->
lng->txt(
"lti_released_objects"),
 
  133                $this->ctrl->getLinkTarget($this, 
"releasedObjects")
 
  143        $this->tabs_gui->activateSubTab(
"settings");
 
  144        $this->tpl->setContent($form->getHTML());
 
  212        $role->setTitle(
"il_lti_global_role");
 
  213        $role->setDescription(
"This global role should only contain the permission 'read' for repository and categories. Do not rename this role.");
 
  215        $this->rbac_admin->assignRoleToFolder($role->getId(), 8, 
'y');
 
  216        $this->rbac_admin->setProtected(8, $role->getId(), 
'y');
 
  217        $this->rbac_admin->setRolePermission($role->getId(), 
'root', [3], 8);
 
  218        $this->rbac_admin->setRolePermission($role->getId(), 
'cat', [3], 8);
 
  219        $this->rbac_admin->grantPermission($role->getId(), [3], 
ROOT_FOLDER_ID);
 
  220        $role->changeExistingObjects(
 
  227        $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"lti_user_role_created"), 
true);
 
  239        $this->tpl->setContent($form->getHTML());
 
  244        $this->tabs_gui->activateSubTab(
"consumers");
 
  249        $ti_title->setRequired(
true);
 
  250        $form->addItem($ti_title);
 
  251        $ti_description = 
new ilTextInputGUI($this->
lng->txt(
"description"), 
'description');
 
  252        $form->addItem($ti_description);
 
  254        $ti_prefix->setInfo($this->
lng->txt(
"prefix_info"));
 
  255        $ti_prefix->setRequired(
true);
 
  256        $form->addItem($ti_prefix);
 
  257        #$ti_key = new ilTextInputGUI($this->lng->txt("lti_consumer_key"), 'key');
 
  258        #$ti_key->setRequired(true); 
  259        #$ti_secret = new ilTextInputGUI($this->lng->txt("lti_consumer_secret"), 'secret');
 
  260        #$ti_secret->setRequired(true); 
  262        $languages = $this->
lng->getInstalledLanguages();
 
  265        foreach ($languages as $lang_key) {
 
  270        $si_language->setOptions($array_lang);
 
  271        $form->addItem($si_language);
 
  276        $valid_obj_types = $this->
object->getLTIObjectTypes();
 
  277        foreach ($valid_obj_types as $obj_type) {
 
  278            $object_name = $this->
lng->txt(
'objs_' . $obj_type);
 
  281        $form->addItem($cb_obj_types);
 
  284        $roles = $this->
object->getLTIRoles();
 
  285        foreach ($roles as $role_id => $role_name) {
 
  286            $options[$role_id] = $role_name;
 
  289        $si_roles->setOptions($options);
 
  290        $form->addItem($si_roles);
 
  293        $form->addItem($cb_active);
 
  295        if ($a_mode == 
'edit') {
 
  296            $form->setFormAction($this->
ctrl->getFormAction($this, 
'editLTIConsumer'));
 
  297            $form->setTitle($this->
lng->txt(
"lti_edit_consumer"));
 
  298            $form->addCommandButton(
"updateLTIConsumer", $this->
lng->txt(
"save"));
 
  300            $form->setFormAction($this->
ctrl->getFormAction($this, 
'createLTIConsumer'));
 
  301            $form->setTitle($this->
lng->txt(
"lti_create_consumer"));
 
  302            $form->addCommandButton(
"createLTIConsumer", $this->
lng->txt(
"save"));
 
  303            $form->addCommandButton(
'listConsumers', $this->
lng->txt(
'cancel'));
 
  315        $this->
ctrl->setParameter($this, 
"cid", $this->consumer_id);
 
  317        if (!$this->consumer_id) {
 
  318            $this->
ctrl->redirect($this, 
"listConsumers");
 
  324            $a_form->getItemByPostVar(
"title")->setValue($consumer->getTitle());
 
  325            $a_form->getItemByPostVar(
"description")->setValue($consumer->getDescription());
 
  326            $a_form->getItemByPostVar(
"prefix")->setValue($consumer->getPrefix());
 
  327            $a_form->getItemByPostVar(
"language")->setValue($consumer->getLanguage());
 
  328            $a_form->getItemByPostVar(
"active")->setChecked($consumer->getActive());
 
  329            $a_form->getItemByPostVar(
"role")->setValue($consumer->getRole());
 
  330            $a_form->getItemByPostVar(
"types")->setValue($this->
object->getActiveObjectTypes($this->consumer_id));
 
  332        $this->tpl->setContent($a_form->getHTML());
 
  344        if ($form->checkInput()) {
 
  348            $consumer->setTitle($form->getInput(
'title'));
 
  349            $consumer->setDescription($form->getInput(
'description'));
 
  350            $consumer->setPrefix($form->getInput(
'prefix'));
 
  351            $consumer->setLanguage($form->getInput(
'language'));
 
  352            $consumer->setActive((
bool) $form->getInput(
'active'));
 
  353            $consumer->setRole((
int) $form->getInput(
'role'));
 
  354            $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
 
  356            $this->
object->saveConsumerObjectTypes(
 
  357                $consumer->getExtConsumerId(),
 
  358                $form->getInput(
'types')
 
  360            $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"lti_consumer_created"), 
true);
 
  361            $this->
ctrl->redirect($this, 
'listConsumers');
 
  364        $form->setValuesByPost();
 
  376        if (!$this->consumer_id) {
 
  377            $this->
ctrl->redirect($this, 
"listConsumers");
 
  380        $this->
ctrl->setParameter($this, 
"cid", $this->consumer_id);
 
  384        if ($form->checkInput()) {
 
  385            $consumer->setTitle($form->getInput(
'title'));
 
  386            $consumer->setDescription($form->getInput(
'description'));
 
  387            $consumer->setPrefix($form->getInput(
'prefix'));
 
  388            $consumer->setLanguage($form->getInput(
'language'));
 
  389            $consumer->setActive((
bool) $form->getInput(
'active'));
 
  390            $consumer->setRole((
int) $form->getInput(
'role'));
 
  391            $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
 
  392            $this->
object->saveConsumerObjectTypes($this->consumer_id, $form->getInput(
'types'));
 
  394            $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"lti_consumer_updated"), 
true);
 
  405        if ($this->request_wrapper->has(
'cid')) {
 
  406            $consumer_id = (
int) $this->request_wrapper->retrieve(
'cid', $this->refinery->kindlyTo()->int());
 
  410            $this->
ctrl->redirect($this, 
"listConsumers");
 
  413        $consumer->deleteGlobalToolConsumerSettings($this->dataConnector);
 
  414        $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"lti_consumer_deleted"), 
true);
 
  415        $this->
ctrl->redirect($this, 
'listConsumers');
 
  426                $this->
lng->txt(
'lti_create_consumer'),
 
  427                $this->ctrl->getLinkTarget($this, 
'createconsumer')
 
  431                    $this->
lng->txt(
'lti_create_lti_user_role'),
 
  432                    $this->ctrl->getLinkTarget($this, 
'createLtiUserRole')
 
  434                $this->
toolbar->addText($this->
lng->txt(
'lti_user_role_info'));
 
  438        $this->tabs_gui->activateSubTab(
"consumers");
 
  444        $this->tpl->setContent($tbl->getHTML());
 
  452        if (!$this->consumer_id) {
 
  453            $this->
ctrl->redirect($this, 
"listConsumers");
 
  457        if ($consumer->getActive()) {
 
  458            $consumer->setActive(
false);
 
  459            $msg = 
"lti_consumer_set_inactive";
 
  461            $consumer->setActive(
true);
 
  462            $msg = 
"lti_consumer_set_active";
 
  464        $consumer->saveGlobalToolConsumerSettings($this->dataConnector);
 
  465        $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt($msg), 
true);
 
  467        $this->
ctrl->redirect($this, 
'listConsumers');
 
  475        $this->tabs_gui->activateSubTab(
'releasedObjects');
 
  481        $this->tpl->setContent($table->getHTML());
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
 
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 _lookupEntry(string $a_lang_key, string $a_mod, string $a_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getConsumerForm(string $a_mode='')
 
editConsumer(ilPropertyFormGUI $a_form=null)
Edit consumer.
 
getAdminTabs()
administration tabs show only permissions and trash folder
 
deleteLTIConsumer()
Delete consumers.
 
initConsumerForm(ilPropertyFormGUI $form=null)
 
releasedObjects()
Show relases objects.
 
__construct(?array $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
updateLTIConsumer()
Update lti consumer settings.
 
createLTIConsumer()
Create new lti consumer.
 
ilLTIDataConnector $dataConnector
 
listConsumers()
List consumers.
 
changeStatusLTIConsumer()
Change activation status.
 
initSettingsForm(ilPropertyFormGUI $form=null)
 
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Class ilObjectGUI Basic methods of all Output classes.
 
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
prepareOutput(bool $show_sub_objects=true)
 
static _getIdsForTitle(string $title, string $type='', bool $partial_match=false)
 
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
 
This class represents a text property in a property form.
 
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc