ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilShopPersonalSettingsTopicsTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14include_once('Services/Table/classes/class.ilTable2GUI.php');
15
16
18{
19 protected $lng = null;
20 protected $ctrl;
21
29 public function __construct($a_parent_obj, $a_parent_cmd = '')
30 {
31 global $lng, $ilCtrl;
32
33 $this->lng = $lng;
34 $this->ctrl = $ilCtrl;
35
36 parent::__construct($a_parent_obj, $a_parent_cmd);
37 $this->setId('shop_topics_settings_tbl');
38 $this->addColumn($this->lng->txt('title'), 'title' , '70%');
39 $this->addColumn($this->lng->txt('pay_sorting_value'), 'sorting' , '30%');
40
41 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
42 $this->setRowTemplate('tpl.shop_personal_settings_topics_list_row.html', 'Services/Payment');
43 $this->setDefaultOrderField('pt_topic_sort');
44 $this->setDefaultOrderDirection('asc');
45 }
46
54 public function fillRow($a_set)
55 {
56 $this->tpl->setVariable('VAL_ID', $a_set['id']);
57 $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
58 $this->tpl->setVariable('VAL_SORTING_TEXTINPUT', ilUtil::formInput('sorting['.$a_set['id'].']', $a_set['sorting'])); }
59
67 public function parseRecords($a_topics)
68 {
69 foreach($a_topics as $topic)
70 {
71 $tmp_arr['id'] = $topic->getId();
72 $tmp_arr['title'] = $topic->getTitle();
73 $tmp_arr['sorting'] = $topic->getCustomSorting();
74
75 $records_arr[] = $tmp_arr;
76 }
77
78 if (!count($a_topics))
79 {
80 $this->disable('header');
81 $this->disable('footer');
82
83 $this->setNoEntriesText($this->lng->txt('no_topics_yet'));
84 }
85
86 $this->setData($records_arr ? $records_arr : array());
87 }
88}
89?>
__construct($a_parent_obj, $a_parent_cmd='')
Constructor.
Class ilTable2GUI.
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.
setNoEntriesText($a_text)
Set text for an empty table.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
disable($a_module_name)
diesables particular modules of table
static formInput($varname, $value, $disabled=false)
create html input area
global $ilCtrl
Definition: ilias.php:18