ILIAS  release_8 Revision v8.24
class.ilImportantPagesTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
28
29 public function __construct(
30 object $a_parent_obj,
31 string $a_parent_cmd
32 ) {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $this->access = $DIC->access();
38 $ilCtrl = $DIC->ctrl();
39 $lng = $DIC->language();
40 $this->templates = new ilWikiPageTemplate($a_parent_obj->getObject()->getId());
41 parent::__construct($a_parent_obj, $a_parent_cmd);
42 $data = array_merge(
43 [array("page_id" => 0)],
44 ilObjWiki::_lookupImportantPagesList($a_parent_obj->getObject()->getId())
45 );
46 $this->setData($data);
47 $this->setTitle($lng->txt(""));
48 $this->setLimit(9999);
49
50 $this->addColumn("", "", "1", true);
51 $this->addColumn($this->lng->txt("wiki_ordering"), "order");
52 $this->addColumn($this->lng->txt("wiki_indentation"));
53 $this->addColumn($this->lng->txt("wiki_page"));
54 $this->addColumn($this->lng->txt("wiki_purpose"));
55
56 $this->setEnableHeader(true);
57 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
58 $this->setRowTemplate("tpl.imp_pages_row.html", "Modules/Wiki");
59 //$this->disable("footer");
60 $this->setEnableTitle(true);
61
62 $this->addMultiCommand("confirmRemoveImportantPages", $lng->txt("remove"));
63 $this->addMultiCommand("setAsStartPage", $lng->txt("wiki_set_as_start_page"));
64 $this->addCommandButton("saveOrderingAndIndent", $lng->txt("wiki_save_ordering_and_indent"));
65 }
66
67 protected function fillRow(array $a_set): void
68 {
70
71 if ($a_set["page_id"] > 0) {
72 $this->tpl->setCurrentBlock("cb");
73 $this->tpl->setVariable("PAGE_ID", $a_set["page_id"]);
74 $this->tpl->parseCurrentBlock();
75
76 $this->tpl->setCurrentBlock("ord");
77 $this->tpl->setVariable("PAGE_ID_ORD", $a_set["page_id"]);
78 $this->tpl->setVariable("VAL_ORD", $a_set["ord"]);
79 $this->tpl->parseCurrentBlock();
80
81 $this->tpl->setVariable(
82 "PAGE_TITLE",
83 ilWikiPage::lookupTitle($a_set["page_id"])
84 );
85 $this->tpl->setVariable(
86 "SEL_INDENT",
88 $a_set["indent"],
89 "indent[" . $a_set["page_id"] . "]",
90 [0 => "0", 1 => "1", 2 => "2"],
91 false,
92 true
93 )
94 );
95
96 if ($this->templates->isPageTemplate((int) $a_set["page_id"])) {
97 $this->tpl->setVariable(
98 "PURPOSE",
99 $lng->txt("wiki_page_template")
100 );
101 }
102 } else {
103 $this->tpl->setVariable(
104 "PAGE_TITLE",
105 ($this->getParentObject()->getObject()->getStartPage())
106 );
107
108 $this->tpl->setVariable(
109 "PURPOSE",
110 $lng->txt("wiki_start_page")
111 );
112 }
113 }
114}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd)
fillRow(array $a_set)
Standard Version of Fill Row.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
static _lookupImportantPagesList(int $a_wiki_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setEnableHeader(bool $a_enableheader)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupTitle(int $a_page_id)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc