ILIAS  trunk Revision v13.0_alpha-52-g21c366bbdd4
class.ilObjRecoveryFolderGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30{
33
34 public function __construct(
35 $a_data,
36 int $a_id,
37 bool $a_call_by_reference
38 ) {
40 global $DIC;
41
42 $this->rbacadmin = $DIC->rbac()->admin();
43 $this->rbacsystem = $DIC->rbac()->system();
44 $this->type = "recf";
45 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
46
47 $this->admin_request = new AdminGUIRequest(
48 $DIC->http(),
49 $DIC->refinery()
50 );
51 }
52
53 public function saveObject(): void
54 {
55 parent::saveObject();
56 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
57 exit();
58 }
59
60 public function removeFromSystemObject(?int $trash_id = null): void
61 {
62 $ru = new ilRepositoryTrashGUI($this);
63 $selected_ids = $trash_id === null
64 ? $this->admin_request->getSelectedIds()
65 : [$trash_id];
66 $ru->removeObjectsFromSystem($selected_ids, true);
67 $this->ctrl->redirect($this, "view");
68 }
69
70 public function executeCommand(): void
71 {
72 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd();
74 $this->prepareOutput();
75
76 switch ($next_class) {
77 case 'ilpermissiongui':
78 $perm_gui = new ilPermissionGUI($this);
79 $this->ctrl->forwardCommand($perm_gui);
80 break;
81
82 default:
83 if (!$cmd) {
84 $cmd = "view";
85 }
86 $cmd .= "Object";
87 $this->$cmd();
88 break;
89 }
90 }
91
92 protected function showPossibleSubObjects(): void
93 {
94 $this->sub_objects = "";
95 }
96
97 public function getActions(): array
98 {
99 // standard actions for container
100 return array(
101 "cut" => array("name" => "cut", "lng" => "cut"),
102 "clear" => array("name" => "clear", "lng" => "clear"),
103 "removeFromSystem" => array("name" => "removeFromSystem", "lng" => "btn_remove_system")
104 );
105 }
106
107 protected function checkPermissionBool(string $perm, string $cmd = "", string $type = "", ?int $ref_id = null): bool
108 {
109 /*
110 * Since nodes in the administration do not have visible permissions anymore,
111 * those object permission checks have to be overwritten.
112 */
113 $operations = explode(',', $perm);
114 $operations = array_diff($operations, ["visible"]);
115 $perm = implode(',', $operations);
116 if ($perm === '') {
117 return true;
118 }
119 return parent::checkPermissionBool($perm, $cmd, $type, $ref_id);
120 }
121}
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
Class ilObjRecoveryFolderGUI.
removeFromSystemObject(?int $trash_id=null)
showPossibleSubObjects()
show possible sub objects (pull down menu)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Repository GUI Utilities.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...