19 declare(strict_types=1);
32 $this->has_write = $a_has_write;
36 if ($this->has_write) {
41 $this->
addColumn($this->
lng->txt(
'title'),
'title',
"30%");
42 $this->
addColumn($this->
lng->txt(
'md_used'),
'used',
"5%");
43 $this->
addColumn($this->
lng->txt(
'md_copyright_preview'),
'preview',
"50%");
44 $this->
addColumn($this->
lng->txt(
'meta_copyright_status'),
'status',
"10%");
46 if ($this->has_write) {
51 $this->
setRowTemplate(
"tpl.show_copyright_row.html",
"Services/MetaData");
56 protected function fillRow(array $a_set): void
58 if ($this->has_write) {
59 if ($a_set[
'default']) {
60 $this->tpl->setVariable(
'DISABLED',
"disabled");
62 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
65 $this->tpl->setCurrentBlock(
'order_by_position');
66 if ($a_set[
'default']) {
67 $this->tpl->setVariable(
'ORDER_DISABLED',
'disabled="disabled"');
69 $this->tpl->setVariable(
'ORDER_ID', $a_set[
'id']);
70 $this->tpl->setVariable(
'ORDER_VALUE', $a_set[
'position']);
71 $this->tpl->parseCurrentBlock();
73 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
74 if ($a_set[
'description'] !==
'') {
75 $this->tpl->setVariable(
'VAL_DESCRIPTION', $a_set[
'description']);
77 $this->tpl->setVariable(
'VAL_USAGE', $a_set[
'used']);
78 $this->tpl->setVariable(
'VAL_PREVIEW', $a_set[
'preview']);
81 if ($a_set[
'status']) {
82 $status[] = $this->
lng->txt(
'meta_copyright_outdated');
84 $status[] = $this->
lng->txt(
'meta_copyright_in_use');
86 if ($a_set[
'default']) {
87 $status[] = $this->
lng->txt(
'md_copyright_default');
90 $this->tpl->setVariable(
'VAL_STATUS', implode(
', ', $status));
92 if ($this->has_write) {
94 $this->tpl->setVariable(
'EDIT_LINK', $this->
ctrl->getLinkTarget($this->getParentObject(),
'editEntry'));
97 $this->tpl->setVariable(
'TXT_EDIT', $this->
lng->txt(
'edit'));
99 if ((
int) $a_set[
'used'] > 0) {
100 $this->tpl->setCurrentBlock(
"link_usage");
103 $this->
ctrl->setParameterByClass(
104 'ilMDCopyrightUsageGUI',
108 $this->tpl->setVariable(
110 $this->
ctrl->getLinkTargetByClass(
111 'ilMDCopyrightUsageGUI',
115 $this->tpl->setVariable(
'TXT_USAGE', $this->
lng->txt(
'meta_copyright_show_usages'));
116 $this->tpl->parseCurrentBlock();
128 foreach ($entries as $entry) {
129 $tmp_arr[
'id'] = $entry->getEntryId();
130 $tmp_arr[
'title'] = $entry->getTitle();
131 $tmp_arr[
'description'] = $entry->getDescription();
132 $tmp_arr[
'used'] = $entry->getUsage();
133 $tmp_arr[
'preview'] = $entry->getCopyright();
134 $tmp_arr[
'default'] = $entry->getIsDefault();
135 $tmp_arr[
'status'] = $entry->getOutdated();
136 $tmp_arr[
'position'] = ($position += 10);
138 $entry_arr[] = $tmp_arr;
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
__construct(ilObjMDSettingsGUI $a_parent_obj, string $a_parent_cmd='', bool $a_has_write=false)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
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)