ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilShopBaseGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14{
15 protected $ctrl = null;
16 protected $lng = null;
17 protected $tpl = null;
18 protected $settings = null;
19
20 public function __construct()
21 {
22 global $ilCtrl, $lng, $tpl, $ilMainMenu;
23
24 $this->ctrl = $ilCtrl;
25 $this->tpl = $tpl;
26 $this->lng = $lng;
27
28 $this->settings = ilPaymentSettings::_getInstance();
29
30 $this->lng->loadLanguageModule('search');
31 $this->lng->loadLanguageModule('payment');
32 $ilMainMenu->setActive('shop');
33 }
34
35 protected function prepareOutput()
36 {
37 $this->tpl->getStandardTemplate();
38 $this->tpl->setTitleIcon(ilObject::_getIcon('', '', 'pays') , $this->lng->txt("shop"));
39 $this->tpl->setTitle($this->lng->txt("shop"));
40
42 }
43
47 protected function addPager($result)
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 }
94}
$result
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
Class ilShopBaseGUI.
static infoPanel($a_keep=true)
global $ilCtrl
Definition: ilias.php:18