ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilShopBaseGUI Class Reference

Class ilShopBaseGUI. More...

+ Inheritance diagram for ilShopBaseGUI:
+ Collaboration diagram for ilShopBaseGUI:

Public Member Functions

 __construct ()
 

Protected Member Functions

 prepareOutput ()
 
 addPager ($result, $a_session_key)
 
 buildSubTabs ()
 
 setSection ($a_section)
 
 getSection ()
 
 setSubSection ($a_sub_section)
 
 getSubSection ()
 
 showButton ($a_cmd, $a_text, $a_target='')
 
 initTableGUI ()
 
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column='')
 

Protected Attributes

 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $oGeneralSettings = null
 
 $section = 0
 
 $sub_section = 0
 

Detailed Description

Class ilShopBaseGUI.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 12 of file class.ilShopBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilShopBaseGUI::__construct ( )

Definition at line 21 of file class.ilShopBaseGUI.php.

References $ilCtrl, $lng, $tpl, and ilPaymentSettings\_getInstance().

22  {
23  global $ilCtrl, $lng, $tpl, $ilMainMenu;
24 
25  $this->ctrl = $ilCtrl;
26  $this->tpl = $tpl;
27  $this->lng = $lng;
28 
29  $this->lng->loadLanguageModule('search');
30  $this->lng->loadLanguageModule('payment');
31  $this->oGeneralSettings = ilPaymentSettings::_getInstance();
32  $ilMainMenu->setActive('shop');
33  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ addPager()

ilShopBaseGUI::addPager (   $result,
  $a_session_key 
)
protected

Definition at line 47 of file class.ilShopBaseGUI.php.

References $result.

Referenced by ilShopGUI\performSearch(), and ilShopAdvancedSearchGUI\showForm().

48  {
49  if(count($result->getResults()) < $result->getMaxHits())
50  {
51  return true;
52  }
53 
54  if($result->getResultPageNumber() > 1)
55  {
56  $this->ctrl->setParameter($this,'page_number', $result->getResultPageNumber() - 1);
57  $this->tpl->setCurrentBlock('prev');
58  $this->tpl->setVariable('PREV_LINK',$this->ctrl->getLinkTarget($this, 'performSearch'));
59  $this->tpl->setVariable('TXT_PREV',$this->lng->txt('search_page_prev'));
60  $this->tpl->parseCurrentBlock();
61  }
62  for($i = 0; $i < ceil(count($result->getResults()) / $result->getMaxHits()); $i++)
63  {
64  if($i + 1 == $result->getResultPageNumber())
65  {
66  $this->tpl->setCurrentBlock('pages_link');
67  $this->tpl->setVariable('NUMBER', $i + 1);
68  $this->tpl->parseCurrentBlock();
69  continue;
70  }
71 
72  $this->ctrl->setParameter($this,'page_number', $i + 1);
73  $link = '<a href="'.$this->ctrl->getLinkTarget($this, 'performSearch').'">'.($i + 1).'</a> ';
74  $this->tpl->setCurrentBlock('pages_link');
75  $this->tpl->setVariable('NUMBER',$link);
76  $this->tpl->parseCurrentBlock();
77  }
78 
79  if($result->getResultPageNumber() < ceil(count($result->getResults()) / $result->getMaxHits()))
80  {
81  $this->tpl->setCurrentBlock('next');
82  $this->ctrl->setParameter($this,'page_number', $result->getResultPageNumber() + 1);
83  $this->tpl->setVariable('NEXT_LINK',$this->ctrl->getLinkTarget($this, 'performSearch'));
84  $this->tpl->setVariable('TXT_NEXT',$this->lng->txt('search_page_next'));
85  $this->tpl->parseCurrentBlock();
86  }
87 
88  $this->tpl->setCurrentBlock('prev_next');
89  $this->tpl->setVariable('SEARCH_PAGE',$this->lng->txt('search_page'));
90  $this->tpl->parseCurrentBlock();
91 
92  $this->ctrl->clearParameters($this);
93  }
$result
+ Here is the caller graph for this function:

◆ buildSubTabs()

ilShopBaseGUI::buildSubTabs ( )
protected

Definition at line 95 of file class.ilShopBaseGUI.php.

References $ilUser, ilPaymentTrustees\_hasCouponsPermission(), ilPaymentTrustees\_hasObjectPermission(), ilPaymentTrustees\_hasStatisticPermission(), and getSection().

Referenced by prepareOutput().

96  {
97  global $ilUser, $ilTabs;
98 
99  switch($this->getSection())
100  {
101  case 6:
102  if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
104  {
105  $ilTabs->addSubTabTarget('bookings', $this->ctrl->getLinkTargetByClass('ilpaymentstatisticgui'), '', '', '');
106  }
107  if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
108  ilPaymentTrustees::_hasObjectPermission($ilUser->getId()))
109  {
110  $ilTabs->addSubTabTarget('paya_object', $this->ctrl->getLinkTargetByClass('ilpaymentobjectgui'), '', '', '');
111 
112  }
113  if(ilPaymentVendors::_isVendor($ilUser->getId()))
114  {
115  $ilTabs->addSubTabTarget('paya_trustees', $this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'), '', '', '');
116  }
117  if(!(bool) $this->oGeneralSettings->get('hide_coupons'))
118  {
119  if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
121  {
122  $ilTabs->addSubTabTarget('paya_coupons_coupons', $this->ctrl->getLinkTargetByClass('ilpaymentcoupongui'), '', '', '');
123  }
124  }
125  break;
126 
127  default:
128  break;
129  }
130  }
static _hasCouponsPermission($a_trustee)
static _hasStatisticPermission($a_trustee)
global $ilUser
Definition: imgupload.php:15
static _hasObjectPermission($a_trustee)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSection()

ilShopBaseGUI::getSection ( )
protected

Definition at line 136 of file class.ilShopBaseGUI.php.

References $section.

Referenced by buildSubTabs().

137  {
138  return $this->section;
139  }
+ Here is the caller graph for this function:

◆ getSubSection()

ilShopBaseGUI::getSubSection ( )
protected

Definition at line 144 of file class.ilShopBaseGUI.php.

References $sub_section.

145  {
146  return $this->sub_section;
147  }

◆ initTableGUI()

ilShopBaseGUI::initTableGUI ( )
protected

Definition at line 156 of file class.ilShopBaseGUI.php.

157  {
158  include_once './Services/Table/classes/class.ilTableGUI.php';
159 
160  return new ilTableGUI(0, false);
161  }
Class ilTableGUI.

◆ prepareOutput()

ilShopBaseGUI::prepareOutput ( )
protected

Definition at line 35 of file class.ilShopBaseGUI.php.

References buildSubTabs(), ilUtil\getImagePath(), and ilUtil\infoPanel().

Referenced by ilPaymentObjectGUI\__construct(), and ilPaymentObjectGUI\executeCommand().

36  {
37  $this->tpl->getStandardTemplate();
38 
39  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pays_cart_b.png"), $this->lng->txt("search"));
40  $this->tpl->setTitle($this->lng->txt("shop"));
41 
43 
44  $this->buildSubTabs();
45  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static infoPanel($a_keep=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSection()

ilShopBaseGUI::setSection (   $a_section)
protected

Definition at line 132 of file class.ilShopBaseGUI.php.

Referenced by ilPaymentObjectGUI\__construct(), ilPaymentCouponGUI\prepareOutput(), ilPaymentTrusteeGUI\prepareOutput(), and ilPaymentStatisticGUI\prepareOutput().

133  {
134  $this->section = $a_section;
135  }
+ Here is the caller graph for this function:

◆ setSubSection()

ilShopBaseGUI::setSubSection (   $a_sub_section)
protected

Definition at line 140 of file class.ilShopBaseGUI.php.

141  {
142  $this->sub_section = $a_sub_section;
143  }

◆ setTableGUIBasicData()

ilShopBaseGUI::setTableGUIBasicData (   $tbl,
  $result_set,
  $a_default_order_column = '' 
)
protected

Definition at line 163 of file class.ilShopBaseGUI.php.

References $_GET.

164  {
165  $offset = (int)$_GET['offset'];
166  $order = $_GET['sort_by'];
167  $direction = $_GET['sort_order'];
168 
169  $tbl->setOrderColumn($order,$a_default_order_column);
170  $tbl->setOrderDirection($direction);
171  $tbl->setOffset($offset);
172  $tbl->setLimit((int)$_GET['limit']);
173  $tbl->setMaxCount(count($result_set));
174  $tbl->setFooter('tblfooter', $this->lng->txt('previous'), $this->lng->txt('next'));
175  $tbl->setData($result_set);
176  }
$_GET["client_id"]

◆ showButton()

ilShopBaseGUI::showButton (   $a_cmd,
  $a_text,
  $a_target = '' 
)
protected

Definition at line 149 of file class.ilShopBaseGUI.php.

150  {
151  global $ilToolbar;
152 
153  $ilToolbar->addButton($a_text, $this->ctrl->getLinkTarget($this, $a_cmd), $a_target);
154  }

Field Documentation

◆ $ctrl

ilShopBaseGUI::$ctrl = null
protected

Definition at line 14 of file class.ilShopBaseGUI.php.

◆ $lng

◆ $oGeneralSettings

ilShopBaseGUI::$oGeneralSettings = null
protected

Definition at line 17 of file class.ilShopBaseGUI.php.

◆ $section

ilShopBaseGUI::$section = 0
protected

Definition at line 18 of file class.ilShopBaseGUI.php.

Referenced by getSection().

◆ $sub_section

ilShopBaseGUI::$sub_section = 0
protected

Definition at line 19 of file class.ilShopBaseGUI.php.

Referenced by getSubSection().

◆ $tpl


The documentation for this class was generated from the following file: