ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups 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
 $ilias = 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

ilShopBaseGUI::__construct ( )

Reimplemented in ilShopAdvancedSearchGUI, ilShopNewsGUI, ilShopInfoGUI, ilTermsConditionsGUI, and ilShopPersonalSettingsGUI.

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

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

Referenced by ilShopBoughtObjectsGUI\__construct(), ilShopGUI\__construct(), ilShopShoppingCartGUI\__construct(), ilPaymentCouponGUI\ilPaymentCouponGUI(), ilPaymentObjectGUI\ilPaymentObjectGUI(), ilPaymentStatisticGUI\ilPaymentStatisticGUI(), and ilPaymentTrusteeGUI\ilPaymentTrusteeGUI().

{
global $ilCtrl, $ilias, $lng, $tpl, $ilMainMenu;
$this->ilias = $ilias;
$this->ctrl = $ilCtrl;
$this->tpl = $tpl;
$this->lng = $lng;
$this->lng->loadLanguageModule('search');
$this->lng->loadLanguageModule('payment');
$this->oGeneralSettings = ilPaymentSettings::_getInstance();
$ilMainMenu->setActive('shop');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Function Documentation

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

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

References $result, and $tpl.

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

{
global $tpl;
if(count($result->getResults()) < $result->getMaxHits())
{
return true;
}
if($result->getResultPageNumber() > 1)
{
$this->ctrl->setParameter($this,'page_number', $result->getResultPageNumber() - 1);
$this->tpl->setCurrentBlock('prev');
$this->tpl->setVariable('PREV_LINK',$this->ctrl->getLinkTarget($this, 'performSearch'));
$this->tpl->setVariable('TXT_PREV',$this->lng->txt('search_page_prev'));
$this->tpl->parseCurrentBlock();
}
for($i = 0; $i < ceil(count($result->getResults()) / $result->getMaxHits()); $i++)
{
if($i + 1 == $result->getResultPageNumber())
{
$this->tpl->setCurrentBlock('pages_link');
$this->tpl->setVariable('NUMBER', $i + 1);
$this->tpl->parseCurrentBlock();
continue;
}
$this->ctrl->setParameter($this,'page_number', $i + 1);
$link = '<a href="'.$this->ctrl->getLinkTarget($this, 'performSearch').'">'.($i + 1).'</a> ';
$this->tpl->setCurrentBlock('pages_link');
$this->tpl->setVariable('NUMBER',$link);
$this->tpl->parseCurrentBlock();
}
if($result->getResultPageNumber() < ceil(count($result->getResults()) / $result->getMaxHits()))
{
$this->tpl->setCurrentBlock('next');
$this->ctrl->setParameter($this,'page_number', $result->getResultPageNumber() + 1);
$this->tpl->setVariable('NEXT_LINK',$this->ctrl->getLinkTarget($this, 'performSearch'));
$this->tpl->setVariable('TXT_NEXT',$this->lng->txt('search_page_next'));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('prev_next');
$this->tpl->setVariable('SEARCH_PAGE',$this->lng->txt('search_page'));
$this->tpl->parseCurrentBlock();
$this->ctrl->clearParameters($this);
}

+ Here is the caller graph for this function:

ilShopBaseGUI::buildSubTabs ( )
protected

Reimplemented in ilShopBoughtObjectsGUI, and ilShopNewsGUI.

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

References ilPaymentTrustees\_hasCouponsPermission(), ilPaymentTrustees\_hasObjectPermission(), ilPaymentTrustees\_hasStatisticPermission(), ilPaymentVendors\_isVendor(), and getSection().

Referenced by prepareOutput().

{
global $ilUser, $ilTabs;
switch($this->getSection())
{
case 6:
if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
{
$ilTabs->addSubTabTarget('bookings', $this->ctrl->getLinkTargetByClass('ilpaymentstatisticgui'), '', '', '');
}
if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
{
$ilTabs->addSubTabTarget('paya_object', $this->ctrl->getLinkTargetByClass('ilpaymentobjectgui'), '', '', '');
}
if(ilPaymentVendors::_isVendor($ilUser->getId()))
{
$ilTabs->addSubTabTarget('paya_trustees', $this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'), '', '', '');
}
if(!(bool) $this->oGeneralSettings->get('hide_coupons'))
{
if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
{
$ilTabs->addSubTabTarget('paya_coupons_coupons', $this->ctrl->getLinkTargetByClass('ilpaymentcoupongui'), '', '', '');
}
}
break;
default:
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopBaseGUI::getSection ( )
protected

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

References $section.

Referenced by buildSubTabs().

{
}

+ Here is the caller graph for this function:

ilShopBaseGUI::getSubSection ( )
protected

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

References $sub_section.

{
}
ilShopBaseGUI::initTableGUI ( )
protected

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

{
include_once './Services/Table/classes/class.ilTableGUI.php';
return new ilTableGUI(0, false);
}
ilShopBaseGUI::prepareOutput ( )
protected

Reimplemented in ilShopGUI, ilShopNewsGUI, ilShopAdvancedSearchGUI, ilShopBoughtObjectsGUI, ilShopInfoGUI, ilTermsConditionsGUI, ilShopShoppingCartGUI, ilShopPersonalSettingsGUI, ilPaymentObjectGUI, ilPaymentStatisticGUI, ilPaymentTrusteeGUI, and ilPaymentCouponGUI.

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

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

{
$this->tpl->getStandardTemplate();
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pays_cart_b.gif"), $this->lng->txt("search"));
$this->tpl->setTitle($this->lng->txt("shop"));
$this->buildSubTabs();
}

+ Here is the call graph for this function:

ilShopBaseGUI::setSection (   $a_section)
protected

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

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

{
$this->section = $a_section;
}

+ Here is the caller graph for this function:

ilShopBaseGUI::setSubSection (   $a_sub_section)
protected

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

{
$this->sub_section = $a_sub_section;
}
ilShopBaseGUI::setTableGUIBasicData (   $tbl,
  $result_set,
  $a_default_order_column = '' 
)
protected

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

References $_GET.

{
$offset = (int)$_GET['offset'];
$order = $_GET['sort_by'];
$direction = $_GET['sort_order'];
$tbl->setOrderColumn($order,$a_default_order_column);
$tbl->setOrderDirection($direction);
$tbl->setOffset($offset);
$tbl->setLimit((int)$_GET['limit']);
$tbl->setMaxCount(count($result_set));
$tbl->setFooter('tblfooter', $this->lng->txt('previous'), $this->lng->txt('next'));
$tbl->setData($result_set);
}
ilShopBaseGUI::showButton (   $a_cmd,
  $a_text,
  $a_target = '' 
)
protected

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

{
global $ilToolbar;
$ilToolbar->addButton($a_text, $this->ctrl->getLinkTarget($this, $a_cmd), $a_target);
}

Field Documentation

ilShopBaseGUI::$ctrl = null
protected

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

ilShopBaseGUI::$oGeneralSettings = null
protected

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

ilShopBaseGUI::$section = 0
protected

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

Referenced by getSection().

ilShopBaseGUI::$sub_section = 0
protected

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

Referenced by getSubSection().


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