85 $this->
setId(
'providers');
88 $this->
setFormAction($DIC->ctrl()->getFormAction($a_parent_obj, $a_parent_cmd));
89 $this->
setRowTemplate(
'tpl.lti_consume_provider_table_row.html',
'Modules/LTIConsumer');
91 $this->
setTitle($DIC->language()->txt(
'tbl_provider_header'));
323 parent::determineSelectedColumns();
337 $DIC->language()->txt(
'lti_action_accept_providers_as_global')
344 $DIC->language()->txt(
'lti_action_reset_providers_to_user_scope')
351 $DIC->language()->txt(
'lti_action_delete_providers')
364 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_icon'),
'icon');
365 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_title'),
'title');
368 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_description'),
'description');
371 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_category'),
'category');
374 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_keywords'),
'keywords');
377 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_outcome'),
'outcome');
380 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_internal'),
'external');
383 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_with_key'),
'provider_key_customizable');
387 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_availability'),
'availability');
391 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_own_provider'),
'own_provider');
395 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_provider_creator'),
'provider_creator');
400 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_usages_untrashed'),
'usages_untrashed');
404 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_usages_trashed'),
'usages_trashed');
407 $this->
addColumn($DIC->language()->txt(
'tbl_lti_prov_usages'),
'usages_untrashed');
430 'default' =>
true,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_description')
434 'default' =>
false,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_category')
438 'default' =>
true,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_keywords')
442 'default' =>
false,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_outcome')
446 'default' =>
false,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_internal')
450 'default' =>
true,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_with_key')
455 'default' =>
true,
'txt' => $DIC->language()->txt(
'tbl_lti_prov_availability')
461 'default' =>
false,
'txt' => $DIC->language()->txt(
'tbl_lti_prov_own_provider')
467 'default' =>
false,
'txt' => $DIC->language()->txt(
'tbl_lti_prov_provider_creator')
472 'default' =>
true,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_usages_untrashed')
477 'default' =>
false,
'txt' =>
$DIC->language()->txt(
'tbl_lti_prov_usages_trashed')
492 $title->readFromSession();
495 $keyword =
new ilTextInputGUI(
$DIC->language()->txt(
'tbl_lti_prov_keyword'),
'keyword');
496 $keyword->setMaxLength(64);
497 $keyword->setSize(20);
499 $keyword->readFromSession();
500 $this->
filter[
'keyword'] = $keyword->getValue();
504 $hasOutcome->readFromSession();
505 $this->
filter[
'outcome'] = $hasOutcome->getValue();
509 $isInternal->readFromSession();
510 $this->
filter[
'internal'] = $isInternal->getValue();
514 $isWithKey->readFromSession();
515 $this->
filter[
'with_key'] = $isWithKey->getValue();
518 $category->setOptions(array_merge(
519 [
'' =>
$DIC->language()->txt(
'tbl_lti_prov_all_categories')],
523 $category->readFromSession();
524 $this->
filter[
'category'] = $category->getValue();
530 $this->tpl->setCurrentBlock(
'checkbox_col');
531 $this->tpl->setVariable(
'PROVIDER_ID',
$data[
'id']);
532 $this->tpl->parseCurrentBlock();
536 $this->tpl->setCurrentBlock(
'title_linked');
537 $this->tpl->setVariable(
'TITLE',
$data[
'title']);
542 $this->tpl->parseCurrentBlock();
544 $this->tpl->setCurrentBlock(
'title_linked');
545 $this->tpl->setVariable(
'TITLE',
$data[
'title']);
550 $this->tpl->parseCurrentBlock();
552 $this->tpl->setCurrentBlock(
'title');
553 $this->tpl->setVariable(
'TITLE',
$data[
'title']);
554 $this->tpl->parseCurrentBlock();
558 $this->tpl->setVariable(
'ICON_SRC',
$data[
'icon']);
559 $this->tpl->setVariable(
'ICON_ALT', basename(
$data[
'icon']));
562 $this->tpl->setVariable(
'ICON_SRC',
$icon);
563 $this->tpl->setVariable(
'ICON_ALT',
'lti');
567 $this->tpl->setVariable(
'DESCRIPTION',
$data[
'description']);
603 $usagesUntrashed =
$data[
'usages_untrashed'] ?
$data[
'usages_untrashed'] :
'';
604 $this->tpl->setVariable(
'USAGES_UNTRASHED', $usagesUntrashed);
608 $usagesTrashed =
$data[
'usages_trashed'] ?
$data[
'usages_trashed'] :
'';
609 $this->tpl->setVariable(
'USAGES_TRASHED', $usagesTrashed);
621 return $hasOutcome ?
$DIC->language()->txt(
'yes') :
'';
628 return $isInternal ?
$DIC->language()->txt(
'yes') :
'';
635 return $isWithKey ?
$DIC->language()->txt(
'yes') :
'';
641 return $categories[$category];
646 return implode(
'<br />', $keywords);
653 switch (
$data[
'availability']) {
656 return $DIC->language()->txt(
'lti_con_prov_availability_create');
660 return $DIC->language()->txt(
'lti_con_prov_availability_existing');
664 return $DIC->language()->txt(
'lti_con_prov_availability_non');
672 if (
$data[
'creator'] ==
$DIC->user()->getId()) {
673 return $DIC->language()->txt(
'yes');
683 if (
$data[
'creator']) {
688 return $user->getFullname();
691 return $DIC->language()->txt(
'deleted_user');
704 return $DIC->ui()->renderer()->render(
705 $DIC->ui()->factory()->dropdown()->standard($items)->withLabel(
706 $DIC->language()->txt(
'actions')
721 $items[] =
$DIC->ui()->factory()->button()->shy(
722 $DIC->language()->txt(
'lti_action_edit_provider'),
723 $this->buildProviderLink(
$data[
'id'], $this->getEditProviderCmd())
728 $items[] =
$DIC->ui()->factory()->button()->shy(
729 $DIC->language()->txt(
'lti_action_accept_provider_as_global'),
730 $this->buildProviderLink(
$data[
'id'], $this->getAcceptProviderAsGlobalCmd())
735 $items[] =
$DIC->ui()->factory()->button()->shy(
736 $DIC->language()->txt(
'lti_action_reset_provider_to_user_scope'),
737 $this->buildProviderLink(
$data[
'id'], $this->getResetProviderToUserScopeCmd())
742 $items[] =
$DIC->ui()->factory()->button()->shy(
743 $DIC->language()->txt(
'lti_select_provider'),
744 $this->buildProviderLink(
$data[
'id'], $this->getSelectProviderCmd())
749 $items[] =
$DIC->ui()->factory()->button()->shy(
750 $DIC->language()->txt(
'lti_delete_provider'),
751 $this->buildProviderLink(
$data[
'id'], $this->getDeleteProviderCmd())
762 $DIC->ctrl()->setParameter($this->parent_obj,
'provider_id', $providerId);
763 $link =
$DIC->ctrl()->getLinkTarget($this->parent_obj, $command);
764 $DIC->ctrl()->setParameter($this->parent_obj,
'provider_id', 0);
771 return (
bool)
$data[
'creator'] && (bool)
$data[
'accepted_by'];
778 return (
bool)
$DIC->settings()->get(
'enable_trash', 0);
An exception for terminatinating execution or to throw for unit testing.
static getCategoriesSelectOptions()
const AVAILABILITY_CREATE
const AVAILABILITY_EXISTING
setDetailedUsagesEnabled(bool $detailedUsagesEnabled)
setSelectProviderCmd(string $selectProviderCmd)
setDeleteProviderCmd(string $deleteProviderCmd)
getIsWithKeyFormatted($isWithKey)
$availabilityColumnEnabled
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
setDeleteProviderMultiCmd(string $deleteProviderMultiCmd)
getAcceptProviderAsGlobalMultiCmd()
getIsInternalFormatted($isInternal)
getAcceptProviderAsGlobalCmd()
setProviderCreatorColumnEnabled(bool $providerCreatorColumnEnabled)
setResetProviderToUserScopeMultiCmd(string $resetProviderToUserScopeMultiCmd)
setActionsColumnEnabled(bool $actionsColumnEnabled)
setEditProviderCmd(string $editProviderCmd)
isOwnProviderColumnEnabled()
isAvailabilityColumnEnabled()
getOwnProviderLabel($data)
isProviderCreatorColumnEnabled()
determineSelectedColumns()
Determine selected columns.
setOwnProviderColumnEnabled(bool $ownProviderColumnEnabled)
getResetProviderToUserScopeCmd()
getHasOutcomeFormatted($hasOutcome)
getKeywordsFormatted(array $keywords)
fillRow($data)
Standard Version of Fill Row.
setAcceptProviderAsGlobalMultiCmd(string $acceptProviderAsGlobalMultiCmd)
$ownProviderColumnEnabled
getCategoryTranslation($category)
getAvailabilityLabel($data)
$providerCreatorColumnEnabled
setResetProviderToUserScopeCmd(string $resetProviderToUserScopeCmd)
setAcceptProviderAsGlobalCmd(string $acceptProviderAsGlobalCmd)
setAvailabilityColumnEnabled(bool $availabilityColumnEnabled)
getResetProviderToUserScopeMultiCmd()
$acceptProviderAsGlobalMultiCmd
buildProviderLink(int $providerId, string $command)
isDetailedUsagesEnabled()
isUserCreatedProviderResettableToUserScope($data)
getProviderCreatorLabel($data)
getSelectableColumns()
Get selectable columns.
$resetProviderToUserScopeMultiCmd
getDeleteProviderMultiCmd()
buildActionsListHtml($data)
$resetProviderToUserScopeCmd
$acceptProviderAsGlobalCmd
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
isColumnSelected($a_col)
Is given column selected?
This class represents a text property in a property form.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc