ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilWikiExportOrderTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
17  protected $order; // [int]
18 
28  public function __construct($a_parent_obj, $a_parent_cmd = "", $a_pdf_export, array &$a_all_pages, array $a_page_ids)
29  {
30  global $DIC;
31 
32  $this->ctrl = $DIC->ctrl();
33  $this->lng = $DIC->language();
34  $ilCtrl = $DIC->ctrl();
35  $lng = $DIC->language();
36 
37  parent::__construct($a_parent_obj, $a_parent_cmd);
38 
39  if (!(bool) $a_pdf_export) {
40  $title = "wiki_show_print_view";
41  $cmd = "printView";
42  } else {
43  $title = "wiki_show_pdf_export";
44  $cmd = "pdfExport";
45  }
46 
47  $this->setTitle($lng->txt($title));
48 
49  $this->addColumn($lng->txt("wiki_ordering"), "", "1");
50  $this->addColumn($lng->txt("wiki_page"));
51 
52  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
53  $this->addCommandButton($this->getParentCmd(), $lng->txt("refresh"));
54 
55  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
56  $button = ilSubmitButton::getInstance();
57  $button->setOmitPreventDoubleSubmission((bool) $a_pdf_export);
58  $button->setCaption("continue");
59  $button->setCommand($cmd);
60  $this->addCommandButtonInstance($button);
61 
62  $this->setRowTemplate("tpl.table_row_export_order.html", "Modules/Wiki");
63  $this->setLimit(9999);
64 
65  $this->getItems($a_all_pages, $a_page_ids);
66  }
67 
71  protected function getItems(array &$a_all_pages, array $a_page_ids)
72  {
73  $data = array();
74 
75  foreach ($a_page_ids as $page_id) {
76  $data[] = array(
77  "id" => $page_id,
78  "title" => $a_all_pages[$page_id]["title"]
79  );
80  }
81 
82  $this->setData($data);
83  }
84 
89  protected function fillRow($a_set)
90  {
91  $this->order += 10;
92 
93  $this->tpl->setVariable("PAGE_ID", $a_set["id"]);
94  $this->tpl->setVariable("TITLE", $a_set["title"]);
95  $this->tpl->setVariable("ORDER", $this->order);
96  }
97 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
addCommandButtonInstance(ilButtonBase $a_button)
Add Command button instance.
global $DIC
Definition: saml.php:7
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="", $a_pdf_export, array &$a_all_pages, array $a_page_ids)
Constructor.
getParentCmd()
Get parent command.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
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.
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.
getItems(array &$a_all_pages, array $a_page_ids)
Get contributors of wiki.
TableGUI class for ordering pages to be printed/exported.
setLimit($a_limit=0, $a_default_limit=0)