ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilShopPersonalSettingsGUI Class Reference

Class ilShopPersonalSettingsGUI. More...

+ Inheritance diagram for ilShopPersonalSettingsGUI:
+ Collaboration diagram for ilShopPersonalSettingsGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 saveSorting ()
 
 showTopicsSortingTable ()
 
 __construct ()
 

Protected Member Functions

 prepareOutput ()
 
- Protected Member Functions inherited from ilShopBaseGUI
 prepareOutput ()
 
 addPager ($result)
 

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $settings = null
 

Detailed Description

Class ilShopPersonalSettingsGUI.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilShopPersonalSettingsGUI::__construct ( )

Reimplemented from ilShopBaseGUI.

Definition at line 16 of file class.ilShopPersonalSettingsGUI.php.

17 {
18 parent::__construct();
19 }

Member Function Documentation

◆ executeCommand()

ilShopPersonalSettingsGUI::executeCommand ( )

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

22 {
23 global $ilUser, $ilCtrl, $ilErr;
24
25 // check access
26 if(!(bool)$this->settings->get('topics_allow_custom_sorting'))
27 {
28 $ilCtrl->redirectByClass('ilshopgui','','',false, false);
29 }
30
31 if(ANONYMOUS_USER_ID == $ilUser->getId())
32 {
33 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
34 }
35
36 $next_class = $this->ctrl->getNextClass($this);
37 $cmd = $this->ctrl->getCmd();
38
39 switch($next_class)
40 {
41 default:
42 if (!$cmd)
43 {
44 $cmd = 'showTopicsSortingTable';
45 }
46 $this->prepareOutput();
47 $this->$cmd();
48
49 break;
50 }
51 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15

References $cmd, $ilCtrl, $ilErr, $ilUser, and prepareOutput().

+ Here is the call graph for this function:

◆ prepareOutput()

ilShopPersonalSettingsGUI::prepareOutput ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 53 of file class.ilShopPersonalSettingsGUI.php.

54 {
55 global $ilTabs;
56
57 parent::prepareOutput();
58
59 $ilTabs->setTabActive('pay_personal_settings');
60 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ saveSorting()

ilShopPersonalSettingsGUI::saveSorting ( )

Definition at line 62 of file class.ilShopPersonalSettingsGUI.php.

63 {
64 if(count($_POST['sorting']))
65 {
66 foreach($_POST['sorting'] as $topic_id => $sorting_value)
67 {
68 $oTopic = new ilShopTopic($topic_id);
69 $oTopic->setCustomSorting((int)$sorting_value);
70 $oTopic->saveCustomSorting();
71 }
72 }
73
74 ilUtil::sendInfo($this->lng->txt('saved_successfully'));
75
76 return $this->showTopicsSortingTable();
77 }
Class ilShopTopic.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_POST, ilUtil\sendInfo(), and showTopicsSortingTable().

+ Here is the call graph for this function:

◆ showTopicsSortingTable()

ilShopPersonalSettingsGUI::showTopicsSortingTable ( )

Definition at line 79 of file class.ilShopPersonalSettingsGUI.php.

80 {
81 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
82
83 include_once 'Services/Payment/classes/class.ilShopPersonalSettingsTopicsTableGUI.php';
84 $table_gui = new ilShopPersonalSettingsTopicsTableGUI($this, 'showTopicsSortingTable');
85 $table_gui->setTitle($this->lng->txt('pay_manual_sorting_of_topics'));
86 ilShopTopics::_getInstance()->enableCustomSorting(true);
88 ilShopTopics::_getInstance()->setSortingDirection('ASC');
90 $table_gui->parseRecords(ilShopTopics::_getInstance()->getTopics());
91 $table_gui->addCommandButton('saveSorting', $this->lng->txt('pay_save_sorting'));
92
93 $this->tpl->setVariable('TABLE', $table_gui->getHTML());
94 }

References ilShopTopics\_getInstance(), and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by saveSorting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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