ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjBookingPoolListGUI.php
Go to the documentation of this file.
1 <?php
2 
23 {
24  protected \ILIAS\BookingManager\StandardGUIRequest $book_request;
25 
26  public function __construct()
27  {
28  global $DIC;
29 
30  $this->ctrl = $DIC->ctrl();
31  $this->lng = $DIC->language();
33  $this->book_request = $DIC->bookingManager()
34  ->internal()
35  ->gui()
36  ->standardRequest();
37  }
38 
39  public function init(): void
40  {
41  $this->static_link_enabled = true;
42  $this->delete_enabled = true;
43  $this->cut_enabled = true;
44  $this->copy_enabled = true;
45  $this->subscribe_enabled = true;
46  $this->link_enabled = true;
47  $this->info_screen_enabled = true;
48  $this->type = "book";
49  $this->gui_class_name = "ilobjbookingpoolgui";
50 
51  // general commands array
52  $this->commands = ilObjBookingPoolAccess::_getCommands();
53  $this->lng->loadLanguageModule('book');
54  }
55 
56  public function getCommandLink(string $cmd): string
57  {
58  $ilCtrl = $this->ctrl;
59 
60  switch ($cmd) {
61  default:
62  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
63  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $cmd);
64  $ilCtrl->setParameterByClass(
65  "ilrepositorygui",
66  "ref_id",
67  $this->book_request->getRefId()
68  );
69  break;
70  }
71 
72  return $cmd_link;
73  }
74 
75  public function getProperties(): array
76  {
77  $lng = $this->lng;
78 
79  // #11193
80 
81  $props = array();
82 
83  if (!ilObjBookingPool::_lookupOnline($this->obj_id)) {
84  $props[] = array("alert" => true, "property" => $lng->txt("status"),
85  "value" => $lng->txt("offline"));
86  }
87  return $props;
88  }
89 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
Sets a parameter for the given GUI class and appends the given value as well.
static _lookupOnline(int $a_obj_id)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
ilCtrlInterface $ctrl
ILIAS BookingManager StandardGUIRequest $book_request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...