ILIAS  release_8 Revision v8.24
class.ilObjOrgUnitListGUI.php
Go to the documentation of this file.
1<?php
18/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
19
26{
27 protected ilLanguage $lng;
29
30
31 public function __construct()
32 {
33 global $DIC;
35 $this->lng = $DIC->language();
36 $this->settings = $DIC->settings();
37 }
38
42 public function init(): void
43 {
44 $this->static_link_enabled = true;
45 $this->delete_enabled = true;
46 $this->cut_enabled = true;
47 $this->info_screen_enabled = true;
48 $this->copy_enabled = false;
49 $this->subscribe_enabled = false;
50 $this->link_enabled = false;
51
52 $this->type = "orgu";
53 $this->gui_class_name = "ilobjorgunitgui";
54
55 // general commands array
56 $this->commands = ilObjOrgUnitAccess::_getCommands();
57 }
58
62 public function insertTimingsCommand(): void
63 {
64 }
65
69 public function insertCommonSocialCommands(bool $a_header_actions = false): void
70 {
71 }
72
76 public function insertInfoScreenCommand(): void
77 {
78 if ($this->std_cmd_only) {
79 return;
80 }
81 $cmd_link = $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary");
82 $cmd_frame = $this->getCommandFrame("infoScreen");
83
84 $this->insertCommand(
85 $cmd_link,
86 $this->lng->txt("info_short"),
87 $cmd_frame,
88 ilUtil::getImagePath("icon_info.svg")
89 );
90 }
91
92 public function getCommandLink(string $a_cmd): string
93 {
94 $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $this->ref_id);
95
96 return $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", $a_cmd);
97 }
98
102 public function getTypeIcon(): string
103 {
104 $icons_cache = ilObjOrgUnit::getIconsCache();
105 if (isset($icons_cache[$this->obj_id])) {
106 $icon_file = $icons_cache[$this->obj_id];
107 return $icon_file;
108 }
109
110 return ilObject::getIconForReference(
111 $this->ref_id,
112 $this->obj_id,
113 'small',
114 $this->getIconImageType()
115 );
116 }
117}
language handling
static _getCommands()
get commands this method returns an array of all possible commands/permission combinations example: $...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertCommonSocialCommands(bool $a_header_actions=false)
no social commands needed in orgunits.
insertInfoScreenCommand()
insert info screen command
insertTimingsCommand()
no timing commands needed in orgunits.
getTypeIcon()
Get object type specific type icon.
getCommandLink(string $a_cmd)
Get command link url.
static getIconsCache()
Returns an array that maps from OrgUnit object IDs to its icon defined by the assigned OrgUnit type.
getIconImageType()
Returns the icon image type.
getCommandFrame(string $cmd)
Get command target frame.
insertCommand(string $href, string $text, string $frame="", string $img="", string $cmd="", string $onclick="")
insert command button
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc