ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilPCGridCellTableGUI.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 
14 {
18  protected $ctrl;
19 
20 
21  public function __construct($a_parent_obj, $a_parent_cmd, ilPCGrid $a_grid)
22  {
23  global $DIC;
24 
25  $this->ctrl = $DIC->ctrl();
26  $this->lng = $DIC->language();
27  $ilCtrl = $DIC->ctrl();
28  $lng = $DIC->language();
29 
30  parent::__construct($a_parent_obj, $a_parent_cmd);
31 
32  $this->addColumn("", "", "1");
33  $this->addColumn($lng->txt("cont_position"), "", "1");
34  $this->addColumn($lng->txt("cont_grid_width_s"));
35  $this->addColumn($lng->txt("cont_grid_width_m"));
36  $this->addColumn($lng->txt("cont_grid_width_l"));
37  $this->addColumn($lng->txt("cont_grid_width_xl"));
38  $this->setEnableHeader(true);
39  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
40  $this->setRowTemplate(
41  "tpl.grid_cell_row.html",
42  "Services/COPage"
43  );
44 
45  $this->grid = $a_grid;
46  //$caps = $this->tabs->getCaptions();
47  $this->setData($this->grid->getCellData());
48  $this->setLimit(0);
49 
50  $this->addMultiCommand("confirmCellDeletion", $lng->txt("delete"));
51  $this->addCommandButton("saveCellData", $lng->txt("save"));
52 
53  $this->setTitle($lng->txt("cont_ed_grid_col_widths"));
54  }
55 
60  protected function fillRow($a_set)
61  {
62  $this->pos += 10;
63  $this->tpl->setVariable("POS", ilUtil::prepareFormOutput($this->pos));
64  $tid = $a_set["hier_id"] . ":" . $a_set["pc_id"];
65  $this->tpl->setVariable("TID", $tid);
66  foreach (ilPCGrid::getSizes() as $s) {
67  $this->tpl->setCurrentBlock("select_width");
68  $this->tpl->setVariable("SELECT_WIDTH", ilUtil::formSelect($a_set[$s], "width_" . $s . "[$tid]", array("" => "") + ilPCGrid::getWidths(), false, true));
69  $this->tpl->parseCurrentBlock();
70  }
71  }
72 }
static getWidths()
Get widths.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
fillRow($a_set)
Standard Version of Fill Row.
Grid element.
global $DIC
Definition: saml.php:7
$s
Definition: pwgen.php:45
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
__construct($a_parent_obj, $a_parent_cmd, ilPCGrid $a_grid)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
setLimit($a_limit=0, $a_default_limit=0)
static getSizes()
Get sizes.