ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilADNAbstractGUI.php
Go to the documentation of this file.
1 <?php
2 
7 abstract class ilADNAbstractGUI
8 {
9  const IDENTIFIER = 'identifier';
10 
14  protected $ui;
18  protected $http;
22  protected $toolbar;
26  protected $tab_handling;
30  protected $tabs;
34  public $lng;
38  protected $ctrl;
42  public $tpl;
46  public $tree;
50  protected $access;
51 
57  {
58  global $DIC;
59 
60  $this->tab_handling = $tab_handling;
61  $this->tabs = $DIC['ilTabs'];
62  $this->lng = $DIC->language();
63  $this->ctrl = $DIC['ilCtrl'];
64  $this->tpl = $DIC['tpl'];
65  $this->tree = $DIC['tree'];
66  $this->toolbar = $DIC['ilToolbar'];
67  $this->http = $DIC->http();
68  $this->ui = $DIC->ui();
69  $this->access = new ilObjAdministrativeNotificationAccess();
70 
71  $this->lng->loadLanguageModule('form');
72  }
73 
79  protected function determineCommand(string $standard = null) : ?string
80  {
81  $this->access->checkAccessAndThrowException('visible,read');
82  $cmd = $this->ctrl->getCmd();
83  if ($cmd !== '') {
84  return $cmd;
85  }
86 
87  return $standard;
88  }
89 
90  abstract protected function dispatchCommand(string $cmd) : string;
91 
92  public function executeCommand() : void
93  {
94  $next_class = $this->ctrl->getNextClass();
95 
96  if ($next_class === '') {
97  $cmd = $this->determineCommand();
98  $this->tpl->setContent($this->dispatchCommand($cmd));
99 
100  return;
101  }
102 
103  switch ($next_class) {
104  case strtolower(ilADNNotificationGUI::class):
106  $g = new ilADNNotificationGUI($this->tab_handling);
107  $this->ctrl->forwardCommand($g);
108  break;
109  default:
110  break;
111  }
112  }
113 
114 }
Class ilADNNotificationGUI ilADNNotificationGUI: ilObjAdministrativeNotificationGUI ilADNNotificati...
Class ilADNAbstractGUI.
dispatchCommand(string $cmd)
Class ilADNTabHandling.
__construct(ilADNTabHandling $tab_handling)
ilADNAbstractGUI constructor.
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: goto.php:24
ui()
Definition: ui.php:5
determineCommand(string $standard=null)