ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
14 include_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 ?>