ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMMTabHandling Class Reference

Class ilMMTabHandling. More...

+ Collaboration diagram for ilMMTabHandling:

Public Member Functions

 __construct (int $ref_id)
 ilMMTabHandling constructor. More...
 
 initTabs (string $tab, string $subtab=null, bool $backtab=false, $calling_class="")
 

Protected Attributes

 $ctrl
 

Private Attributes

 $ref_id
 
 $rbacsystem
 
 $tabs
 
 $lng
 
 $help
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMTabHandling::__construct ( int  $ref_id)

ilMMTabHandling constructor.

Parameters
int$ref_id

Definition at line 39 of file class.ilMMTabHandling.php.

References $DIC, and $ref_id.

40  {
41  global $DIC;
42 
43  $this->ref_id = $ref_id;
44  $this->tabs = $DIC['ilTabs'];
45  $this->lng = $DIC->language();
46  $this->lng->loadLanguageModule('mme');
47  $this->ctrl = $DIC['ilCtrl'];
48  $this->rbacsystem = $DIC['rbacsystem'];
49  $this->help = $DIC->help();
50  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ initTabs()

ilMMTabHandling::initTabs ( string  $tab,
string  $subtab = null,
bool  $backtab = false,
  $calling_class = "" 
)
Parameters
string$tab
string | null$subtab
bool$backtab
string | null$calling_class

Definition at line 58 of file class.ilMMTabHandling.php.

References ilMMSubItemGUI\CMD_VIEW_SUB_ITEMS, ilMMTopItemGUI\CMD_VIEW_TOP_ITEMS, and ilObjMainMenuGUI\TAB_MAIN.

59  {
60  $this->tabs->clearTargets(); // clears Help-ID
61 
62  // Help Screen-ID
63  $this->help->setScreenIdComponent('mme');
64  $this->help->setScreenId($tab);
65  $this->help->setSubScreenId($subtab);
66 
67  if ($this->rbacsystem->checkAccess('visible,read', $this->ref_id)) {
68  $this->tabs->addTab(
70  $this->lng->txt(ilObjMainMenuGUI::TAB_MAIN),
71  $this->ctrl->getLinkTargetByClass(ilObjMainMenuGUI::class, ilObjMainMenuGUI::TAB_MAIN)
72  );
73  switch ($tab) {
75  $this->tabs->addSubTab(
77  $this->lng->txt(ilMMTopItemGUI::CMD_VIEW_TOP_ITEMS),
78  $this->ctrl->getLinkTargetByClass(ilMMTopItemGUI::class, ilMMTopItemGUI::CMD_VIEW_TOP_ITEMS)
79  );
80  $this->tabs->addSubTab(
82  $this->lng->txt(ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS),
83  $this->ctrl->getLinkTargetByClass(ilMMSubItemGUI::class, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS)
84  );
85  $this->tabs->activateSubTab($subtab);
86  break;
87  }
88  if ($subtab === null) {
90  }
91  $this->tabs->activateSubTab($subtab);
92  }
93  if ($this->rbacsystem->checkAccess('edit_permission', $this->ref_id)) {
94  $this->tabs->addTab(
95  'perm_settings',
96  $this->lng->txt('perm_settings'),
97  $this->ctrl->getLinkTargetByClass(array(ilObjMainMenuGUI::class, ilPermissionGUI::class), 'perm')
98  );
99  }
100  if ($backtab) {
101  $this->tabs->clearTargets();
102  if ($calling_class == ilMMSubItemGUI::class) {
103  $this->tabs->setBackTarget($this->lng->txt('tab_back'), $this->ctrl->getLinkTargetByClass(ilMMSubItemGUI::class, $subtab));
104  } else {
105  $this->tabs->setBackTarget($this->lng->txt('tab_back'), $this->ctrl->getLinkTargetByClass(ilObjMainMenuGUI::class, $subtab));
106  }
107  }
108  $this->tabs->activateTab($tab);
109  }

Field Documentation

◆ $ctrl

ilMMTabHandling::$ctrl
protected

Definition at line 29 of file class.ilMMTabHandling.php.

◆ $help

ilMMTabHandling::$help
private

Definition at line 33 of file class.ilMMTabHandling.php.

◆ $lng

ilMMTabHandling::$lng
private

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

◆ $rbacsystem

ilMMTabHandling::$rbacsystem
private

Definition at line 17 of file class.ilMMTabHandling.php.

◆ $ref_id

ilMMTabHandling::$ref_id
private

Definition at line 13 of file class.ilMMTabHandling.php.

Referenced by __construct().

◆ $tabs

ilMMTabHandling::$tabs
private

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


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