19 declare(strict_types=1);
    32     protected \ILIAS\DI\Container 
$dic;
    34     public function __construct(?
object $a_parent_obj, 
string $a_parent_cmd)
    39         $this->
setId(
"ltioconsumer");
    45         $this->
setTitle($DIC->language()->txt(
"lti_object_consumer"));
    47         $this->
addColumn($DIC->language()->txt(
"active"), 
"active");
    48         $this->
addColumn($DIC->language()->txt(
"title"), 
"title");
    49         $this->
addColumn($DIC->language()->txt(
"description"), 
"description");
    50         $this->
addColumn($DIC->language()->txt(
"prefix"), 
"prefix");
    51         $this->
addColumn($DIC->language()->txt(
"in_use"), 
"language");
    52         $this->
addColumn($DIC->language()->txt(
"objects"), 
"objects");
    53         $this->
addColumn($DIC->language()->txt(
"role"), 
"role");
    54         $this->
addColumn($DIC->language()->txt(
"actions"), 
"");
    56         $this->
setFormAction($DIC->ctrl()->getFormAction($a_parent_obj));
    57         $this->
setRowTemplate(
"tpl.lti_consumer_list_row.html", 
"components/ILIAS/LTIProvider");
    69         $this->editable = $a_status;
    87         $consumer_data = $dataConnector->getGlobalToolConsumerSettings();
    89         foreach ($consumer_data as $cons) {
    91                 "id" => $cons->getExtConsumerId(),
    92                 "title" => $cons->getTitle(),
    93                 "description" => $cons->getDescription(),
    94                 "prefix" => $cons->getPrefix(),
    95                 "language" => $cons->getLanguage(),
    96                 "role" => $cons->getRole(),
    97                 "active" => $cons->getActive()
   107     protected function fillRow(array $a_set): void
   109         $this->dic->ctrl()->setParameter($this->
getParentObject(), 
"cid", $a_set[
"id"]);
   111         $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
   112         $this->tpl->setVariable(
"TXT_DESCRIPTION", $a_set[
"description"]);
   113         $this->tpl->setVariable(
"TXT_PREFIX", $a_set[
"prefix"]);
   116         $this->tpl->setVariable(
"TXT_LANGUAGE", $a_set[
"language"]);
   119             foreach ($obj_types as $obj_type) {
   120                 $this->tpl->setCurrentBlock(
"objects");
   121                 $this->tpl->setVariable(
"OBJECTS", 
$GLOBALS[
'DIC']->
language()->txt(
'objs_' . $obj_type));
   122                 $this->tpl->parseCurrentBlock();
   125             $this->tpl->setVariable(
"NO_OBJECTS", 
"-");
   130             $this->tpl->setVariable(
'TXT_ROLE', $role->getTitle());
   132             $this->tpl->setVariable(
'TXT_ROLE', 
'');
   135         if ($a_set[
"active"]) {
   136             $this->tpl->setVariable(
"TXT_ACTIVE", $this->dic->language()->txt(
'active'));
   137             $label_status = $this->dic->language()->txt(
"deactivate");
   139             $this->tpl->setVariable(
"TXT_ACTIVE", $this->dic->language()->txt(
'inactive'));
   140             $label_status = $this->dic->language()->txt(
"activate");
   144             $edit_url = $this->dic->ctrl()->getLinkTarget($this->
getParentObject(), 
"editConsumer");
   145             $delete_url = $this->dic->ctrl()->getLinkTarget($this->
getParentObject(), 
"deleteLTIConsumer");
   146             $status_url = $this->dic->ctrl()->getLinkTarget($this->
getParentObject(), 
"changeStatusLTIConsumer");
   148             $actions[] = $this->dic->ui()->factory()->link()->standard($this->
lng->txt(
'edit'), $edit_url);
   149             $actions[] = $this->dic->ui()->factory()->link()->standard($this->
lng->txt(
'delete'), $delete_url);
   150             $actions[] = $this->dic->ui()->factory()->link()->standard($label_status, $status_url);
   151             $dropdown = $this->dic->ui()->factory()->dropdown()->standard($actions)->withLabel($this->
lng->txt(
'actions'));
   152             $this->tpl->setVariable(
"ACTION", $this->dic->ui()->renderer()->render($dropdown));
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
setEditable(bool $a_status)
Set editable. 
 
setDefaultOrderField(string $a_defaultorderfield)
 
TableGUI class for LTI consumer listing. 
 
getItems()
Get consumer data. 
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
__construct(?object $a_parent_obj, string $a_parent_cmd)
 
__construct(Container $dic, ilPlugin $plugin)
 
setLimit(int $a_limit=0, int $a_default_limit=0)
 
isEditable()
Check if write permission given. 
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
fillRow(array $a_set)
Fill a single data row. 
 
language()
 description: > Example for rendring a language glyph. 
 
static getActiveObjectTypes(int $a_consumer_id)