43 public function __construct($a_parent_obj, $a_parent_cmd =
'', $a_has_write =
false)
49 $this->has_write = (bool) $a_has_write;
51 parent::__construct($a_parent_obj, $a_parent_cmd);
53 if ($this->has_write) {
55 $this->
addColumn($this->lng->txt(
"position"),
"order");
56 $this->
addCommandButton(
"saveCopyrightPosition", $this->lng->txt(
"meta_save_order"));
58 $this->
addColumn($this->lng->txt(
'title'),
'title',
"30%");
59 $this->
addColumn($this->lng->txt(
'md_used'),
'used',
"5%");
60 $this->
addColumn($this->lng->txt(
'md_copyright_preview'),
'preview',
"50%");
61 $this->
addColumn($this->lng->txt(
'meta_copyright_status'),
'status',
"5%");
63 if ($this->has_write) {
67 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
68 $this->
setRowTemplate(
"tpl.show_copyright_row.html",
"Services/MetaData");
82 if ($this->has_write) {
83 if ($a_set[
'default']) {
84 $this->tpl->setVariable(
'DISABLED',
"disabled");
86 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
89 $this->tpl->setCurrentBlock(
'order_by_position');
90 if ($a_set[
'default']) {
91 $this->tpl->setVariable(
'ORDER_DISABLED',
'disabled="disabled"');
93 $this->tpl->setVariable(
'ORDER_ID', $a_set[
'id']);
94 $this->tpl->setVariable(
'ORDER_VALUE', $a_set[
'position']);
95 $this->tpl->parseCurrentBlock();
97 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
98 if (strlen($a_set[
'description'])) {
99 $this->tpl->setVariable(
'VAL_DESCRIPTION', $a_set[
'description']);
101 $this->tpl->setVariable(
'VAL_USAGE', $a_set[
'used']);
102 $this->tpl->setVariable(
'VAL_PREVIEW', $a_set[
'preview']);
103 if ($a_set[
'status']) {
104 $this->tpl->setVariable(
'VAL_STATUS', $this->lng->txt(
'meta_copyright_outdated'));
106 $this->tpl->setVariable(
'VAL_STATUS', $this->lng->txt(
'meta_copyright_in_use'));
109 if ($this->has_write) {
110 $this->ctrl->setParameter($this->
getParentObject(),
'entry_id', $a_set[
'id']);
111 $this->tpl->setVariable(
'EDIT_LINK', $this->ctrl->getLinkTarget($this->getParentObject(),
'editEntry'));
114 $this->tpl->setVariable(
'TXT_EDIT', $this->lng->txt(
'edit'));
116 if ((
int) $a_set[
'used'] > 0) {
117 $this->tpl->setCurrentBlock(
"link_usage");
120 $this->ctrl->setParameterByClass(
121 'ilMDCopyrightUsageGUI',
125 $this->tpl->setVariable(
127 $this->ctrl->getLinkTargetByClass(
128 'ilMDCopyrightUsageGUI',
132 $this->tpl->setVariable(
'TXT_USAGE', $this->lng->txt(
'meta_copyright_show_usages'));
133 $this->tpl->parseCurrentBlock();
151 foreach ($entries as $entry) {
152 $tmp_arr[
'id'] = $entry->getEntryId();
153 $tmp_arr[
'title'] = $entry->getTitle();
154 $tmp_arr[
'description'] = $entry->getDescription();
155 $tmp_arr[
'used'] = $entry->getUsage();
156 $tmp_arr[
'preview'] = $entry->getCopyright();
157 $tmp_arr[
'default'] = $entry->getIsDefault();
158 $tmp_arr[
'status'] = $entry->getOutdated();
159 $tmp_arr[
'position'] = ($position += 10);
161 $entry_arr[] = $tmp_arr;
164 $this->
setData($entry_arr ? $entry_arr : array());
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static _getEntries()
get entries
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getParentObject()
Get parent object.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
__construct($a_parent_obj, $a_parent_cmd='', $a_has_write=false)
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
parseSelections()
Parse records.