ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilImportantPagesTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected \ILIAS\Wiki\Navigation\ImportantPageManager $imp_page_manager;
27 protected \ILIAS\Wiki\InternalGUIService $gui;
28 protected \ILIAS\Wiki\InternalDomainService $domain;
31
32 public function __construct(
33 object $a_parent_obj,
34 string $a_parent_cmd
35 ) {
36 global $DIC;
37
38 $service = $DIC->wiki()->internal();
39 $this->domain = $service->domain();
40 $this->gui = $service->gui();
41
42 $this->ctrl = $this->gui->ctrl();
43 $this->lng = $this->domain->lng();
44 $this->access = $this->domain->access();
45 $this->imp_page_manager = $this->domain->importantPage($a_parent_obj->getRefId());
46
47 $this->templates = new ilWikiPageTemplate($a_parent_obj->getObject()->getId());
48 parent::__construct($a_parent_obj, $a_parent_cmd);
49 $data = array_merge(
50 [array("page_id" => 0)],
51 $this->imp_page_manager->getListAsArray()
52 );
53 $this->setData($data);
54 $this->setTitle($this->lng->txt(""));
55 $this->setLimit(9999);
56
57 $this->addColumn("", "", "1", true);
58 $this->addColumn($this->lng->txt("wiki_ordering"), "order");
59 $this->addColumn($this->lng->txt("wiki_indentation"));
60 $this->addColumn($this->lng->txt("wiki_page"));
61 $this->addColumn($this->lng->txt("wiki_purpose"));
62
63 $this->setEnableHeader(true);
64 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
65 $this->setRowTemplate("tpl.imp_pages_row.html", "components/ILIAS/Wiki");
66 //$this->disable("footer");
67 $this->setEnableTitle(true);
68
69 $this->addMultiCommand("confirmRemoveImportantPages", $this->lng->txt("remove"));
70 $this->addMultiCommand("setAsStartPage", $this->lng->txt("wiki_set_as_start_page"));
71 $this->addCommandButton("saveOrderingAndIndent", $this->lng->txt("wiki_save_ordering_and_indent"));
72 }
73
74 protected function fillRow(array $a_set): void
75 {
77
78 if ($a_set["page_id"] > 0) {
79 $this->tpl->setCurrentBlock("cb");
80 $this->tpl->setVariable("PAGE_ID", $a_set["page_id"]);
81 $this->tpl->parseCurrentBlock();
82
83 $this->tpl->setCurrentBlock("ord");
84 $this->tpl->setVariable("PAGE_ID_ORD", $a_set["page_id"]);
85 $this->tpl->setVariable("VAL_ORD", $a_set["ord"]);
86 $this->tpl->parseCurrentBlock();
87
88 $this->tpl->setVariable(
89 "PAGE_TITLE",
90 ilWikiPage::lookupTitle($a_set["page_id"])
91 );
92 $this->tpl->setVariable(
93 "SEL_INDENT",
95 $a_set["indent"],
96 "indent[" . $a_set["page_id"] . "]",
97 [0 => "0", 1 => "1", 2 => "2"],
98 false,
99 true
100 )
101 );
102
103 if ($this->templates->isPageTemplate((int) $a_set["page_id"])) {
104 $this->tpl->setVariable(
105 "PURPOSE",
106 $lng->txt("wiki_page_template")
107 );
108 }
109 } else {
110 $this->tpl->setVariable(
111 "PAGE_TITLE",
112 ($this->getParentObject()->getObject()->getStartPage())
113 );
114
115 $this->tpl->setVariable(
116 "PURPOSE",
117 $lng->txt("wiki_start_page")
118 );
119 }
120 }
121}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Wiki InternalDomainService $domain
__construct(object $a_parent_obj, string $a_parent_cmd)
ILIAS Wiki InternalGUIService $gui
fillRow(array $a_set)
Standard Version of Fill Row.
ILIAS Wiki Navigation ImportantPageManager $imp_page_manager
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.
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, string $lang="-")
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
$service
Definition: ltiresult.php:36
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26