71 public function init(): void
73 $this->copy_enabled =
true;
74 $this->static_link_enabled =
false;
75 $this->delete_enabled =
true;
76 $this->cut_enabled =
true;
77 $this->subscribe_enabled =
true;
78 $this->link_enabled =
false;
79 $this->info_screen_enabled =
true;
81 $this->gui_class_name =
"ilobjgroupgui";
84 if ($this->substitutions->isActive()) {
85 $this->substitutions_enabled =
true;
103 $ilAccess = $DIC[
'ilAccess'];
104 $tree = $DIC[
'tree'];
106 $this->reference_ref_id =
$ref_id;
107 $this->reference_obj_id =
$obj_id;
113 $target_ref_id = current($target_ref_ids);
117 $this->deleted = !$target_ref_id ||
$tree->
isDeleted($target_ref_id);
119 parent::initItem((
int) $target_ref_id, $target_obj_id, $type, $target_title, $target_description);
124 if ($ilAccess->checkAccess(
'write',
'', $this->reference_ref_id) or
$this->deleted) {
125 $this->info_screen_enabled =
false;
127 $this->info_screen_enabled =
true;
136 $ilUser = $DIC[
'ilUser'];
137 $tree = $DIC[
'tree'];
139 $props = parent::getProperties();
142 if ($this->deleted) {
143 $props[] = array(
"alert" =>
true,
"property" =>
$lng->
txt(
"status"),
144 "value" =>
$lng->
txt(
"reference_deleted"));
147 return $props ? $props : array();
164 case 'editReference':
165 return parent::checkCommandAccess($permission, $cmd, $this->
getCommandId(), $type,
$obj_id);
168 switch ($permission) {
172 return parent::checkCommandAccess($permission, $cmd, $this->
getCommandId(), $type,
$obj_id);
176 return parent::checkCommandAccess($permission, $cmd, $ref_id, $type,
$obj_id);
189 $ilCtrl = $DIC[
'ilCtrl'];
192 case 'editReference':
193 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
getCommandId());
194 $cmd_link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", $cmd);
195 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"] ?? 0);
199 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->ref_id);
200 $cmd_link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", $cmd);
201 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"] ?? 0);
__construct()
Constructor.
static _lookupTitle(int $obj_id)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
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...
static _getAllReferences(int $id)
get all reference ids for object ID
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
getCommandLink(string $cmd)
get command link
static _lookupObjId(int $ref_id)
static _getCommands()
get commands
checkCommandAccess(string $permission, string $cmd, int $ref_id, string $type, ?int $obj_id=null)
initItem(int $ref_id, int $obj_id, string $type, string $title="", string $description="")
static _lookupDescription(int $obj_id)
getCommandId()
get command id
insertTimingsCommand()
no activation for links
__construct(Container $dic, ilPlugin $plugin)
static _lookupTargetId(int $a_obj_id)
static _getInstanceByObjectType(string $a_type)