ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
16 
20  function __construct($a_parent_obj, $a_parent_cmd)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25  $data = array("page_id" => 0) +
26  ilObjWiki::_lookupImportantPagesList($a_parent_obj->object->getId());
27  $this->setData($data);
28  $this->setTitle($lng->txt(""));
29  $this->setLimit(9999);
30 
31  $this->addColumn("", "", "1", true);
32  $this->addColumn($this->lng->txt("wiki_ordering"), "order");
33  $this->addColumn($this->lng->txt("wiki_indentation"));
34  $this->addColumn($this->lng->txt("wiki_page"));
35  $this->addColumn($this->lng->txt("wiki_purpose"));
36 
37  $this->setEnableHeader(true);
38  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
39  $this->setRowTemplate("tpl.imp_pages_row.html", "Modules/Wiki");
40  //$this->disable("footer");
41  $this->setEnableTitle(true);
42 
43  $this->addMultiCommand("confirmRemoveImportantPages", $lng->txt("remove"));
44  $this->addMultiCommand("setAsStartPage", $lng->txt("wiki_set_as_start_page"));
45  $this->addCommandButton("saveOrderingAndIndent", $lng->txt("wiki_save_ordering_and_indent"));
46  }
47 
51  protected function fillRow($a_set)
52  {
53  global $lng;
54 
55  if ($a_set["page_id"] > 0)
56  {
57  $this->tpl->setCurrentBlock("cb");
58  $this->tpl->setVariable("PAGE_ID", $a_set["page_id"]);
59  $this->tpl->parseCurrentBlock();
60 
61  $this->tpl->setCurrentBlock("ord");
62  $this->tpl->setVariable("PAGE_ID_ORD", $a_set["page_id"]);
63  $this->tpl->setVariable("VAL_ORD", $a_set["ord"]);
64  $this->tpl->parseCurrentBlock();
65 
66  $this->tpl->setVariable("PAGE_TITLE",
67  ilWikiPage::lookupTitle($a_set["page_id"]));
68  $this->tpl->setVariable("SEL_INDENT",
69  ilUtil::formSelect($a_set["indent"], "indent[".$a_set["page_id"]."]",
70  array(0 => "0", 1 => "1", 2 => "2"), false, true));
71  }
72  else
73  {
74  $this->tpl->setVariable("PAGE_TITLE",
75  ($this->getParentObject()->object->getStartPage()));
76 
77  $this->tpl->setVariable("PURPOSE",
78  $lng->txt("wiki_start_page"));
79  }
80  }
81 
82 }
83 ?>
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
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.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
Create new PHPExcel object
obj_idprivate
global $lng
Definition: privfeed.php:17
setEnableHeader($a_enableheader)
Set Enable Header.
setEnableTitle($a_enabletitle)
Set Enable Title.
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.
setLimit($a_limit=0, $a_default_limit=0)