Skip to content

Commit

Permalink
add display_name and extras columns to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Oct 11, 2023
1 parent 2684abd commit f00b724
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function fillRow($a_set)
$PublicationSubUsage = PublicationSubUsage::find($a_set['id']);
$this->tpl->setVariable('PARENT_USAGE_ID', $PublicationSubUsage->getParentUsageId());
$this->tpl->setVariable('TITLE', $PublicationSubUsage->getTitle());
$this->tpl->setVariable('DISPLAY_NAME', $PublicationSubUsage->getDisplayName());
$this->tpl->setVariable('DESCRIPTION', $PublicationSubUsage->getDescription());
$this->tpl->setVariable('CHANNEL', $PublicationSubUsage->getChannel());
$this->tpl->setVariable('MD_TYPE', $this->parent_obj->txt('md_type_' . $PublicationSubUsage->getMdType()));
Expand All @@ -86,6 +87,15 @@ public function fillRow($a_set)
}
$this->tpl->setVariable('GROUP_NAME', $group_name);

$extras = [];
if ($PublicationSubUsage->getParentUsageId() == PublicationUsage::USAGE_DOWNLOAD ||
$PublicationSubUsage->getParentUsageId() == PublicationUsage::USAGE_DOWNLOAD_FALLBACK) {
if ($PublicationSubUsage->isExternalDownloadSource()) {
$extras[] = $this->parent_obj->txt('ext_dl_source');
}
}
$this->tpl->setVariable('EXTRA_CONFIG', implode('<br>', $extras));

$this->addActionMenu($PublicationSubUsage);
}

Expand All @@ -94,12 +104,14 @@ protected function initColumns()
{
$this->addColumn($this->parent_obj->txt('parent_usage_id'));
$this->addColumn($this->parent_obj->txt('title'));
$this->addColumn($this->parent_obj->txt('display_name'));
$this->addColumn($this->parent_obj->txt('description'));
$this->addColumn($this->parent_obj->txt('channel'));
$this->addColumn($this->parent_obj->txt('md_type'));
$this->addColumn($this->parent_obj->txt('flavor'));
$this->addColumn($this->parent_obj->txt('tag'));
$this->addColumn($this->parent_obj->txt('group_th'));
$this->addColumn($this->parent_obj->txt('extra_config'));

$this->addColumn($this->plugin->txt('common_actions'), '', '150px');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ protected function fillRow($a_set)
$PublicationUsage = $this->repository->getUsage($a_set['usage_id']);
$this->tpl->setVariable('USAGE_ID', $PublicationUsage->getUsageId());
$this->tpl->setVariable('TITLE', $PublicationUsage->getTitle());
$this->tpl->setVariable('DISPLAY_NAME', $PublicationUsage->getDisplayName());
$this->tpl->setVariable('DESCRIPTION', $PublicationUsage->getDescription());
$this->tpl->setVariable('CHANNEL', $PublicationUsage->getChannel());
$this->tpl->setVariable('MD_TYPE', $this->parent_obj->txt('md_type_' . $PublicationUsage->getMdType()));
Expand All @@ -93,20 +94,30 @@ protected function fillRow($a_set)
}
$this->tpl->setVariable('GROUP_NAME', $group_name);

$extras = [];
if ($PublicationUsage->getUsageId() == PublicationUsage::USAGE_DOWNLOAD ||
$PublicationUsage->getUsageId() == PublicationUsage::USAGE_DOWNLOAD_FALLBACK) {
if ($PublicationUsage->isExternalDownloadSource()) {
$extras[] = $this->parent_obj->txt('ext_dl_source');
}
}
$this->tpl->setVariable('EXTRA_CONFIG', implode('<br>', $extras));

$this->addActionMenu($PublicationUsage);
}

protected function initColumns()
{
$this->addColumn($this->parent_obj->txt('usage_id'));
$this->addColumn($this->parent_obj->txt('title'));
$this->addColumn($this->parent_obj->txt('display_name'));
$this->addColumn($this->parent_obj->txt('description'));
$this->addColumn($this->parent_obj->txt('channel'));
$this->addColumn($this->parent_obj->txt('md_type'));
$this->addColumn($this->parent_obj->txt('flavor'));
$this->addColumn($this->parent_obj->txt('tag'));
$this->addColumn($this->parent_obj->txt('group_th'));
// $this->addColumn($this->txt('status'));
$this->addColumn($this->parent_obj->txt('extra_config'));

$this->addColumn($this->plugin->txt('common_actions'), '', '150px');
}
Expand Down
2 changes: 2 additions & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,6 @@ publication_usage_table_title_usage_group#:#Publikation Gruppe
publication_usage_create_group#:#Gruppe erstellen
publication_usage_edit_group#:#Gruppe bearbeiten
publication_usage_confirm_delete_text_group#:#Sind Sie sicher, dass Sie diese Publikationsgruppe löschen möchten?
publication_usage_extra_config#:#Zusätzliche
pug_display_name_default#:#Mehr

1 change: 1 addition & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,4 @@ publication_usage_table_title_usage_group#:#Publication Groups
publication_usage_create_group#:#Create Group
publication_usage_edit_group#:#Edit Group
publication_usage_confirm_delete_text_group#:#Are you sure you want to delete this publication group?
publication_usage_extra_config#:#Extras
6 changes: 6 additions & 0 deletions templates/default/tpl.publication_sub_usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<td class="std small">
{TITLE}
</td>
<td class="std small">
{DISPLAY_NAME}
</td>
<td class="std small">
{DESCRIPTION}
</td>
Expand All @@ -23,6 +26,9 @@
<td class="std small">
{GROUP_NAME}
</td>
<td class="std small">
{EXTRA_CONFIG}
</td>
<td class="std small">
{ACTIONS}
</td>
Expand Down
9 changes: 6 additions & 3 deletions templates/default/tpl.publication_usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<td class="std small">
{TITLE}
</td>
<td class="std small">
{DISPLAY_NAME}
</td>
<td class="std small">
{DESCRIPTION}
</td>
Expand All @@ -20,12 +23,12 @@
<td class="std small">
{TAG}
</td>
<!--<td class="std small">-->
<!--{STATUS}-->
<!--</td>-->
<td class="std small">
{GROUP_NAME}
</td>
<td class="std small">
{EXTRA_CONFIG}
</td>
<td class="std small">
{ACTIONS}
</td>
Expand Down

0 comments on commit f00b724

Please sign in to comment.