ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilImportantPagesTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
15{
19 protected $templates;
23 protected $access;
24
25
29 public function __construct($a_parent_obj, $a_parent_cmd)
30 {
31 global $DIC;
32
33 $this->ctrl = $DIC->ctrl();
34 $this->lng = $DIC->language();
35 $this->access = $DIC->access();
36 $ilCtrl = $DIC->ctrl();
37 $lng = $DIC->language();
38 $ilAccess = $DIC->access();
39 $lng = $DIC->language();
40
41 $this->templates = new ilWikiPageTemplate($a_parent_obj->object->getId());
42
43 parent::__construct($a_parent_obj, $a_parent_cmd);
44 $data = array("page_id" => 0) +
45 ilObjWiki::_lookupImportantPagesList($a_parent_obj->object->getId());
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
70 protected function fillRow($a_set)
71 {
73
74 if ($a_set["page_id"] > 0) {
75 $this->tpl->setCurrentBlock("cb");
76 $this->tpl->setVariable("PAGE_ID", $a_set["page_id"]);
77 $this->tpl->parseCurrentBlock();
78
79 $this->tpl->setCurrentBlock("ord");
80 $this->tpl->setVariable("PAGE_ID_ORD", $a_set["page_id"]);
81 $this->tpl->setVariable("VAL_ORD", $a_set["ord"]);
82 $this->tpl->parseCurrentBlock();
83
84 $this->tpl->setVariable(
85 "PAGE_TITLE",
86 ilWikiPage::lookupTitle($a_set["page_id"])
87 );
88 $this->tpl->setVariable(
89 "SEL_INDENT",
91 $a_set["indent"],
92 "indent[" . $a_set["page_id"] . "]",
93 array(0 => "0", 1 => "1", 2 => "2"),
94 false,
95 true
96 )
97 );
98
99 if ($this->templates->isPageTemplate((int) $a_set["page_id"])) {
100 $this->tpl->setVariable(
101 "PURPOSE",
102 $lng->txt("wiki_page_template")
103 );
104 }
105 } else {
106 $this->tpl->setVariable(
107 "PAGE_TITLE",
108 ($this->getParentObject()->object->getStartPage())
109 );
110
111 $this->tpl->setVariable(
112 "PURPOSE",
113 $lng->txt("wiki_start_page")
114 );
115 }
116 }
117}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc