ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilObjOrgUnitListGUI.php
Go to the documentation of this file.
1 <?php
2 
20 declare(strict_types=1);
21 
28 {
29  protected ilLanguage $lng;
30  protected ilSetting $settings;
31 
32 
33  public function __construct()
34  {
35  global $DIC;
37  $this->lng = $DIC->language();
38  $this->settings = $DIC->settings();
39  }
40 
44  public function init(): void
45  {
46  $this->static_link_enabled = true;
47  $this->delete_enabled = true;
48  $this->cut_enabled = true;
49  $this->info_screen_enabled = true;
50  $this->copy_enabled = false;
51  $this->subscribe_enabled = false;
52  $this->link_enabled = false;
53 
54  $this->type = "orgu";
55  $this->gui_class_name = "ilobjorgunitgui";
56 
57  // general commands array
58  $this->commands = ilObjOrgUnitAccess::_getCommands();
59  }
60 
64  public function insertTimingsCommand(): void
65  {
66  }
67 
71  public function insertCommonSocialCommands(bool $a_header_actions = false): void
72  {
73  }
74 
78  public function insertInfoScreenCommand(): void
79  {
80  if ($this->std_cmd_only) {
81  return;
82  }
83  $cmd_link = $this->ctrl->getLinkTargetByClass([ilObjOrgUnitGUI::class, ilInfoScreenGUI::class], "showSummary");
84  $cmd_frame = $this->getCommandFrame("infoScreen");
85 
86  $this->insertCommand(
87  $cmd_link,
88  $this->lng->txt("info_short"),
89  $cmd_frame,
90  ilUtil::getImagePath("standard/icon_info.svg")
91  );
92  }
93 
94  public function getCommandLink(string $a_cmd): string
95  {
96  $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $this->ref_id);
97 
98  return $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", $a_cmd);
99  }
100 
104  public function getTypeIcon(): string
105  {
106  $icons_cache = ilObjOrgUnit::getIconsCache();
107  if (isset($icons_cache[$this->obj_id])) {
108  $icon_file = $icons_cache[$this->obj_id];
109  return $icon_file;
110  }
111 
112  return ilObject::getIconForReference(
113  $this->ref_id,
114  $this->obj_id,
115  'small',
116  $this->getIconImageType()
117  );
118  }
119 }
static getIconsCache()
Returns an array that maps from OrgUnit object IDs to its icon defined by the assigned OrgUnit type...
getTypeIcon()
Get object type specific type icon.
insertTimingsCommand()
no timing commands needed in orgunits.
getCommandFrame(string $cmd)
Get command target frame.
static _getCommands()
get commands this method returns an array of all possible commands/permission combinations example: $...
global $DIC
Definition: shib_login.php:25
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
insertInfoScreenCommand()
insert info screen command
getIconImageType()
Returns the icon image type.
Class ilObjOrgUnitListGUI.
__construct(Container $dic, ilPlugin $plugin)
insertCommand(string $href, string $text, string $frame='', string $img='', string $cmd='', string $onclick='')
insert command button
insertCommonSocialCommands(bool $a_header_actions=false)
no social commands needed in orgunits.