ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilWikiPageTemplatesTableGUI.php
Go to the documentation of this file.
1 <?php
2 
20 
27 {
28  protected \ILIAS\Wiki\Page\PageManager $pm;
29  protected Translations $ot;
31 
32  public function __construct(
33  object $a_parent_obj,
34  string $a_parent_cmd,
35  int $a_wiki_id
36  ) {
37  global $DIC;
38 
39  $this->ctrl = $DIC->ctrl();
40  $this->lng = $DIC->language();
41  $this->access = $DIC->access();
42  $ilCtrl = $DIC->ctrl();
43  $lng = $DIC->language();
44  $service = $DIC->wiki()->internal();
45  $this->ot = $service->domain()->wiki()->translation($service->gui()->request()->getRefId());
46 
47  parent::__construct($a_parent_obj, $a_parent_cmd);
48  $templates = new ilWikiPageTemplate($a_wiki_id);
49  $this->setData($templates->getAllInfo());
50  $this->setTitle($lng->txt(""));
51 
52  $this->addColumn($this->lng->txt(""), "", "1");
53  $this->addColumn($this->lng->txt("title"), "title");
54  if ($this->ot->getContentTranslationActivated()) {
55  $this->addColumn($this->lng->txt("wiki_translations"));
56  }
57  $this->addColumn($this->lng->txt("wiki_templ_new_pages"), "");
58  $this->addColumn($this->lng->txt("wiki_templ_add_to_page"), "");
59 
60  $this->setDefaultOrderDirection("asc");
61  $this->setDefaultOrderField("title");
62 
63  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
64  $this->setRowTemplate("tpl.wiki_page_templates_row.html", "components/ILIAS/Wiki");
65 
66  $this->addMultiCommand("remove", $lng->txt("wiki_remove_template_status"));
67  $this->addCommandButton("saveTemplateSettings", $lng->txt("save"));
68  $this->pm = $service->domain()->page()->page(
69  $service->gui()->request()->getRefId()
70  );
71  }
72 
73  protected function fillRow(array $a_set): void
74  {
75  if ($this->ot->getContentTranslationActivated()) {
76  $this->tpl->setCurrentBlock("trans");
77  $this->tpl->setVariable("TRANSLATIONS", implode(", ", $this->pm->getLanguages($a_set["wpage_id"])));
78  $this->tpl->parseCurrentBlock();
79  }
80  $this->tpl->setVariable("ID", $a_set["wpage_id"]);
81  $this->tpl->setVariable("TITLE", $a_set["title"]);
82  if ($a_set["new_pages"]) {
83  $this->tpl->setVariable("NEW_PAGES_CHECKED", 'checked="checked"');
84  }
85  if ($a_set["add_to_page"]) {
86  $this->tpl->setVariable("ADD_TO_PAGE_CHECKED", 'checked="checked"');
87  }
88  }
89 }
setData(array $a_data)
TableGUI class for wiki page templates.
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...
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="")
Class handles translation mode for an object.
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:26
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_wiki_id)
__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)
addMultiCommand(string $a_cmd, string $a_text)
$service
Definition: ltiservices.php:40
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...