ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopController Class Reference
+ Collaboration diagram for ilShopController:

Public Member Functions

 __construct ()
 executeCommand ()
 redirect ()

Protected Attributes

 $ctrl = null
 $ilias = null
 $lng = null
 $tpl = null

Private Member Functions

 buildTabs ()

Detailed Description

Definition at line 38 of file class.ilShopController.php.

Constructor & Destructor Documentation

ilShopController::__construct ( )

Definition at line 45 of file class.ilShopController.php.

References $ilCtrl, $ilias, $lng, and $tpl.

{
global $ilCtrl, $ilias, $lng, $tpl;
$this->ilias = $ilias;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->tpl = $tpl;
}

Member Function Documentation

ilShopController::buildTabs ( )
private

Definition at line 151 of file class.ilShopController.php.

References ilGeneralSettings\_getInstance(), ilPaymentTrustees\_hasAccess(), and ilPaymentVendors\_isVendor().

Referenced by executeCommand().

{
global $ilTabs, $ilUser;
$shop_obj = new ilPaymentShoppingCart($ilUser);
$obj = new ilGeneralSettings();
$allSet = $obj->getAll();
$ilTabs->addTarget('content', $this->ctrl->getLinkTargetByClass('ilshopgui'), '', '', '');
if (!(bool)$allSet['hide_advanced_search']) {
$ilTabs->addTarget('advanced_search', $this->ctrl->getLinkTargetByClass('ilshopadvancedsearchgui'), '', '', '');
}
$ilTabs->addTarget('shop_info',$this->ctrl->getLinkTargetByClass('ilshopinfogui') ,'' , '', '');
if (!(bool)$allSet['hide_news'])
{
$ilTabs->addTarget('payment_news',$this->ctrl->getLinkTargetByClass('ilshopnewsgui'),'' , '', '');
}
if(ANONYMOUS_USER_ID != $ilUser->getId())
{
if((bool)ilGeneralSettings::_getInstance()->get('topics_allow_custom_sorting'))
{
$ilTabs->addTarget('pay_personal_settings', $this->ctrl->getLinkTargetByClass('ilshoppersonalsettingsgui'), '', '', '');
}
// Only show if not empty
$ilTabs->addTarget('paya_buyed_objects', $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui'), '', '', '');
// Only show if user is vendor
if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
ilPaymentTrustees::_hasAccess($ilUser->getId()))
{
$ilTabs->addTarget('paya_header', $this->ctrl->getLinkTargetByClass('ilpaymentadmingui'), '', '', '');
}
}
// Only show cart if not empty
$ilTabs->addTarget('paya_shopping_cart', $this->ctrl->getLinkTargetByClass('ilshopshoppingcartgui'), '', '', '');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopController::executeCommand ( )

Definition at line 55 of file class.ilShopController.php.

References $cmd, ilGeneralSettings\_getInstance(), buildTabs(), and redirect().

{
global $ilUser;
if(!(bool)ilGeneralSettings::_getInstance()->get('shop_enabled'))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$this->buildTabs();
$next_class = $this->ctrl->getNextClass();
$cmd = $this->ctrl->getCmd();
$obj = new ilGeneralSettings();
$allSet = $obj->getAll();
if(($ilUser->getId() == ANONYMOUS_USER_ID) && $next_class == 'ilshopboughtobjectsgui')
{
$next_class = 'ilshopshoppingcartgui';
}
switch($next_class)
{
case 'ilpurchasebillgui':
include_once './Services/Payment/classes/class.ilPurchaseBillGUI.php';
$pt = new ilPurchaseBillGUI($ilUser);
$this->ctrl->forwardCommand($pt);
break;
case 'ilpurchasebmfgui':
include_once './Services/Payment/classes/class.ilPurchaseBMFGUI.php';
$pt = new ilPurchaseBMFGUI($ilUser);
$this->ctrl->forwardCommand($pt);
break;
case 'ilshopboughtobjectsgui':
include_once './Services/Payment/classes/class.ilShopBoughtObjectsGUI.php';
$this->ctrl->forwardCommand(new ilShopBoughtObjectsGUI($ilUser));
break;
case 'ilshopshoppingcartgui':
include_once './Services/Payment/classes/class.ilShopShoppingCartGUI.php';
$this->ctrl->forwardCommand(new ilShopShoppingCartGUI($ilUser));
break;
case 'ilshopadvancedsearchgui':
if ((bool) $allSet['hide_advanced_search'])
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
include_once './Services/Payment/classes/class.ilShopAdvancedSearchGUI.php';
$this->ctrl->forwardCommand(new ilShopAdvancedSearchGUI());
break;
case 'ilshoppersonalsettingsgui':
include_once './Services/Payment/classes/class.ilShopPersonalSettingsGUI.php';
$this->ctrl->forwardCommand(new ilShopPersonalSettingsGUI());
break;
case 'ilpaymentadmingui':
include_once './Services/Payment/classes/class.ilPaymentAdminGUI.php';
$this->ctrl->forwardCommand(new ilPaymentAdminGUI($ilUser));
break;
case 'ilshopinfogui':
include_once './Services/Payment/classes/class.ilShopInfoGUI.php';
$this->ctrl->forwardCommand(new ilShopInfoGUI());
break;
case 'ilshopnewsgui':
if ((bool) $allSet['hide_news'])
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
include_once './Services/Payment/classes/class.ilShopNewsGUI.php';
$this->ctrl->forwardCommand(new ilShopNewsGUI());
break;
case 'ilshopgui':
default:
if($cmd == 'redirect')
{
$this->redirect();
}
include_once './Services/Payment/classes/class.ilShopGUI.php';
$this->ctrl->forwardCommand(new ilShopGUI());
break;
}
$this->tpl->show();
return true;
}

+ Here is the call graph for this function:

ilShopController::redirect ( )

Definition at line 194 of file class.ilShopController.php.

References $_GET, $ilCtrl, and ilUtil\stripSlashes().

Referenced by executeCommand().

{
global $ilUser, $ilCtrl;
switch(strtolower(ilUtil::stripSlashes($_GET['redirect_class'])))
{
case 'ilshopshoppingcartgui':
$ilCtrl->redirectByClass('ilshopshoppingcartgui','','',false, false);
break;
default:
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilShopController::$ctrl = null
protected

Definition at line 40 of file class.ilShopController.php.

ilShopController::$ilias = null
protected

Definition at line 41 of file class.ilShopController.php.

Referenced by __construct().

ilShopController::$lng = null
protected

Definition at line 42 of file class.ilShopController.php.

Referenced by __construct().

ilShopController::$tpl = null
protected

Definition at line 43 of file class.ilShopController.php.

Referenced by __construct().


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