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

Class ilShopInfoGUI. More...

+ Inheritance diagram for ilShopInfoGUI:
+ Collaboration diagram for ilShopInfoGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 getPageHTML ()
 
 forwardToPageObject ()
 
 showInfo ()
 
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()
 

Data Fields

const SHOP_PAGE_EDITOR_PAGE_ID = 99999998
 

Protected Member Functions

 prepareOutput ()
 
- Protected Member Functions inherited from ilShopBaseGUI
 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='')
 

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $oGeneralSettings = null
 
 $section = 0
 
 $sub_section = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilShopInfoGUI::__construct ( )

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

21  {
22  parent::__construct();
23  }

Member Function Documentation

◆ executeCommand()

ilShopInfoGUI::executeCommand ( )

Definition at line 25 of file class.ilShopInfoGUI.php.

References $cmd, $ret, forwardToPageObject(), and prepareOutput().

26  {
27  $next_class = $this->ctrl->getNextClass($this);
28  $cmd = $this->ctrl->getCmd();
29 
30  switch($next_class)
31  {
32  case 'ilshoppagegui':
33  $this->prepareOutput();
34  $ret = $this->forwardToPageObject();
35  if($ret != '')
36  {
37  $this->tpl->setContent($ret);
38  }
39  break;
40  default:
41  if(!$cmd)
42  {
43  $cmd = 'showInfo';
44  }
45  $this->prepareOutput();
46  $this->$cmd();
47 
48  break;
49  }
50 
51  return true;
52  }
$cmd
Definition: sahs_server.php:35
+ Here is the call graph for this function:

◆ forwardToPageObject()

ilShopInfoGUI::forwardToPageObject ( )

Definition at line 75 of file class.ilShopInfoGUI.php.

References ilShopBaseGUI\$lng, ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by executeCommand().

76  {
77  global $lng, $ilTabs;
78 
79  $ilTabs->clearTargets();
80  $ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top');
81 
82  // page object
83  include_once 'Services/Payment/classes/class.ilShopPage.php';
84  include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
85 
86  $lng->loadLanguageModule('content');
87 
88  include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
89  $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
90 
91  if(!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID))
92  {
93  // doesn't exist -> create new one
94  $new_page_object = new ilShopPage();
95  $new_page_object->setParentId(0);
96  $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
97  $new_page_object->createFromXML();
98  }
99 
100  $this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
101 
102  $page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
103 
104  return $this->ctrl->forwardCommand($page_gui);
105  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
Shop page object.
getContentStylePath($a_style_id)
get content style path
Shop page GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageHTML()

ilShopInfoGUI::getPageHTML ( )

Definition at line 54 of file class.ilShopInfoGUI.php.

References ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by showInfo().

55  {
56  // page object
57  include_once 'Services/Payment/classes/class.ilShopPage.php';
58  include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
59 
60  // if page does not exist, return nothing
61  if(!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID))
62  {
63  return '';
64  }
65 
66  include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
67  $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
68 
69  // get page object
70  $page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
71 
72  return $page_gui->showPage();
73  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getContentStylePath($a_style_id)
get content style path
Shop page GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilShopInfoGUI::prepareOutput ( )
protected

Definition at line 119 of file class.ilShopInfoGUI.php.

Referenced by executeCommand().

120  {
121  global $ilTabs;
122 
123  parent::prepareOutput();
124 
125  $ilTabs->setTabActive('shop_info');
126  }
+ Here is the caller graph for this function:

◆ showInfo()

ilShopInfoGUI::showInfo ( )

Definition at line 107 of file class.ilShopInfoGUI.php.

References $ilUser, and getPageHTML().

108  {
109  global $ilUser, $rbacreview, $ilToolbar;
110 
111  if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
112  {
113  $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
114  }
115 
116  $this->tpl->setVariable('ADM_CONTENT', $this->getPageHTML());
117  }
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

Field Documentation

◆ SHOP_PAGE_EDITOR_PAGE_ID

const ilShopInfoGUI::SHOP_PAGE_EDITOR_PAGE_ID = 99999998

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


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