ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilAdministrationGUI Class Reference

Class ilAdministrationGUI. More...

+ Inheritance diagram for ilAdministrationGUI:
+ Collaboration diagram for ilAdministrationGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Private Member Functions

 forward ()
 Redirect in special cases. More...
 
 showTree ()
 Show the repository tree in the slate This command is used by ilAdministrationExplorerGUI the for administration mode of the repository. More...
 
 jumpToPluginSlot ()
 Special jump to plugin slot after ilCtrl has been reloaded Ths command is used by ilObjComponentSettingsGUI for plugin updates. More...
 
 jump ()
 Jump to the GUI of an administration node This command is used by AdministrationMainBarProvider for the nodes in the admin menu. More...
 

Private Attributes

const array COMMANDS = ['forward', 'jump', 'jumpToPluginSlot', 'showTree']
 
readonly ilObjectDefinition $obj_definition
 
readonly ilHelpGUI $help
 
readonly ilLanguage $lng
 
readonly ilGlobalTemplateInterface $tpl
 
readonly ilTree $tree
 
readonly ilAccessHandler $access
 
readonly ilRbacReview $rbac_review
 
readonly ilObjUser $user
 
readonly ilCtrl $ctrl
 
readonly AdminGUIRequest $request
 
readonly GlobalScreen $global_screen
 
readonly ilLogger $logger
 
int $cur_ref_id
 
string $admin_mode = ""
 
int $requested_obj_id = 0
 
ilObjectGUI $gui_obj
 

Detailed Description

Class ilAdministrationGUI.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

@ilCtrl_Calls ilAdministrationGUI: ilObjGroupGUI, ilObjFolderGUI, ilObjFileGUI, ilObjCourseGUI, ilCourseObjectivesGUI @ilCtrl_Calls ilAdministrationGUI: ilObjSAHSLearningModuleGUI, ilObjChatroomGUI, ilObjForumGUI @ilCtrl_Calls ilAdministrationGUI: ilObjLearningModuleGUI, ilObjGlossaryGUI @ilCtrl_Calls ilAdministrationGUI: ilObjQuestionPoolGUI, ilObjSurveyQuestionPoolGUI, ilObjTestGUI @ilCtrl_Calls ilAdministrationGUI: ilObjSurveyGUI, ilObjExerciseGUI, ilObjMediaPoolGUI, ilObjFileBasedLMGUI @ilCtrl_Calls ilAdministrationGUI: ilObjCategoryGUI, ilObjUserGUI, ilObjRoleGUI, ilObjUserFolderGUI @ilCtrl_Calls ilAdministrationGUI: ilObjLinkResourceGUI @ilCtrl_Calls ilAdministrationGUI: ilObjRoleTemplateGUI @ilCtrl_Calls ilAdministrationGUI: ilObjRootFolderGUI, ilObjSessionGUI, ilObjPortfolioTemplateGUI @ilCtrl_Calls ilAdministrationGUI: ilObjSystemFolderGUI, ilObjRoleFolderGUI, ilObjAuthSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjLanguageFolderGUI, ilObjMailGUI @ilCtrl_Calls ilAdministrationGUI: ilObjObjectFolderGUI, ilObjRecoveryFolderGUI @ilCtrl_Calls ilAdministrationGUI: ilObjSearchSettingsGUI, ilObjStyleSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjTestFolderGUI, ilObjExternalToolsSettingsGUI, ilObjUserTrackingGUI @ilCtrl_Calls ilAdministrationGUI: ilObjAdvancedEditingGUI, ilObjPrivacySecurityGUI, ilObjNewsSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjMediaCastGUI @ilCtrl_Calls ilAdministrationGUI: ilObjLanguageExtGUI, ilObjMDSettingsGUI, ilObjComponentSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjCalendarSettingsGUI, ilObjSurveyAdministrationGUI @ilCtrl_Calls ilAdministrationGUI: ilObjCategoryReferenceGUI, ilObjCourseReferenceGUI, ilObjRemoteCourseGUI, ilObjGroupReferenceGUI @ilCtrl_Calls ilAdministrationGUI: ilObjForumAdministrationGUI, ilObjBlogGUI, ilObjPollGUI, ilObjDataCollectionGUI @ilCtrl_Calls ilAdministrationGUI: ilObjRemoteCategoryGUI, ilObjRemoteWikiGUI, ilObjRemoteLearningModuleGUI @ilCtrl_Calls ilAdministrationGUI: ilObjRemoteGlossaryGUI, ilObjRemoteFileGUI, ilObjRemoteGroupGUI, ilObjECSSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjCloudGUI, ilObjRepositorySettingsGUI, ilObjWebResourceAdministrationGUI @ilCtrl_Calls ilAdministrationGUI: ilObjCourseAdministrationGUI, ilObjGroupAdministrationGUI, ilObjExerciseAdministrationGUI @ilCtrl_Calls ilAdministrationGUI: ilObjTaxonomyAdministrationGUI, ilObjLoggingSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjBibliographicAdminGUI, ilObjBibliographicGUI @ilCtrl_Calls ilAdministrationGUI: ilObjStudyProgrammeAdminGUI, ilObjStudyProgrammeGUI @ilCtrl_Calls ilAdministrationGUI: ilObjBadgeAdministrationGUI, ilMemberExportSettingsGUI @ilCtrl_Calls ilAdministrationGUI: ilObjFileAccessSettingsGUI, ilPermissionGUI, ilObjRemoteTestGUI, ilPropertyFormGUI @ilCtrl_Calls ilAdministrationGUI: ilObjCmiXapiAdministrationGUI, ilObjCmiXapiGUI, ilObjLTIConsumerGUI @ilCtrl_Calls ilAdministrationGUI: ilObjLearningSequenceAdminGUI, ilObjContentPageAdministrationGUI @ilCtrl_Calls ilAdministrationGUI: ilObjIndividualAssessmentGUI @ilCtrl_Calls ilAdministrationGUI: ilLPProgressTableGUI

Definition at line 63 of file class.ilAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAdministrationGUI::__construct ( )

Definition at line 85 of file class.ilAdministrationGUI.php.

86 {
87 global $DIC;
88
89 $this->help = $DIC["ilHelp"];
90 $this->logger = $DIC->logger()->root();
91 $this->lng = $DIC->language();
92 $this->tpl = $DIC->ui()->mainTemplate();
93 $this->tree = $DIC->repositoryTree();
94 $this->access = $DIC->access();
95 $this->user = $DIC->user();
96 $this->rbac_review = $DIC->rbac()->review();
97 $this->obj_definition = $DIC["objDefinition"];
98 $this->ctrl = $DIC->ctrl();
99 $this->global_screen = $DIC->globalScreen();
100
101 $this->lng->loadLanguageModule('benchmark');
102
103 $context = $this->global_screen->tool()->context();
104 $context->claim()->administration();
105
106 $this->request = new AdminGUIRequest(
107 $DIC->http(),
108 $DIC->refinery()
109 );
110
111 $this->ctrl->saveParameter($this, array("ref_id", "admin_mode"));
112
113 $this->admin_mode = $this->request->getAdminMode();
114 if ($this->admin_mode !== ilObjectGUI::ADMIN_MODE_REPOSITORY) {
115 $this->admin_mode = ilObjectGUI::ADMIN_MODE_SETTINGS;
116 }
117
118 $this->ctrl->setReturn($this, "");
119
120 // determine current ref id and mode
121 $ref_id = $this->request->getRefId();
122 if ($this->tree->isInTree($ref_id)) {
123 $this->cur_ref_id = $ref_id;
124 } else {
125 throw new ilPermissionException("Invalid ref id.");
126 }
127
128 $this->requested_obj_id = $this->request->getObjId();
129 }
const ADMIN_MODE_SETTINGS
const ADMIN_MODE_REPOSITORY
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26
$context
Definition: webdav.php:31

References $context, $DIC, $ref_id, ILIAS\Repository\access(), ilObjectGUI\ADMIN_MODE_REPOSITORY, ilObjectGUI\ADMIN_MODE_SETTINGS, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilAdministrationGUI::executeCommand ( )
Exceptions
ilCtrlException
ilPermissionException

Definition at line 136 of file class.ilAdministrationGUI.php.

136 : void
137 {
138 // check the basic permission
139 // - admin nodes and their childs (e.g. org units) must have read permission to be called
140 // - admin mode for repository and trash is only available to the global admin role
141 $has_access = false;
142 if ($this->cur_ref_id === SYSTEM_FOLDER_ID || $this->tree->isGrandChild(SYSTEM_FOLDER_ID, $this->cur_ref_id)) {
143 $has_access = $this->access->checkAccess('read', '', $this->cur_ref_id);
144 } else {
145 $has_access = $this->rbac_review->isAssigned($this->user->getId(), SYSTEM_ROLE_ID);
146 }
147 if (!$has_access) {
148 $this->logger->log($this->lng->txt('permission_denied'), ilLogLevel::INFO);
149 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
150 $this->ctrl->redirectToURL(
152 );
153 }
154
155 // check creation mode
156 // determined by "new_type" parameter
157 // e.g. creation of a new role, user org unit, talk template
158 $new_type = $this->request->getNewType();
159 if ($new_type) {
160 $creation_mode = true;
161 $obj_type = $new_type;
162 $class_name = $this->obj_definition->getClassName($obj_type);
163 $next_class = strtolower("ilObj" . $class_name . "GUI");
164 } else {
165 $creation_mode = false;
166 }
167
168 // set next_class directly for page translations
169 // (no cmdNode is given in translation link)
170 if ($this->ctrl->getCmdClass() === "ilobjlanguageextgui") {
171 $next_class = "ilobjlanguageextgui";
172 } else {
173 $next_class = $this->ctrl->getNextClass($this);
174 }
175
176 if ((
177 $next_class === "iladministrationgui" || $next_class == ""
178 ) && ($this->ctrl->getCmd() === "return")) {
179 // get GUI of current object
180 $obj_type = ilObject::_lookupType($this->cur_ref_id, true);
181 $class_name = $this->obj_definition->getClassName($obj_type);
182 $next_class = strtolower("ilObj" . $class_name . "GUI");
183 }
184
185 // forward all other classes to gui commands
186 if ($next_class != "" && $next_class !== "iladministrationgui") {
187 $class_path = $this->ctrl->lookupClassPath($next_class);
188 if (is_file($class_path)) {
189 require_once $class_path; // note: org unit plugins still need the require
190 }
191 // get gui class instance
192 $class_name = $this->ctrl->getClassForClasspath($class_path);
193 if (($next_class === "ilobjrolegui" || $next_class === "ilobjusergui"
194 || $next_class === "ilobjroletemplategui")) {
195 if ($this->requested_obj_id > 0) {
196 $this->gui_obj = new $class_name(null, $this->requested_obj_id, false, false);
197 $this->gui_obj->setCreationMode(false);
198 } else {
199 $this->gui_obj = new $class_name(null, $this->cur_ref_id, true, false);
200 $this->gui_obj->setCreationMode(true);
201 }
202 } else {
203 if ($this->obj_definition->isPlugin(ilObject::_lookupType($this->cur_ref_id, true))) {
204 $this->gui_obj = new $class_name($this->cur_ref_id);
205 } elseif (!$creation_mode) {
206 if (is_subclass_of($class_name, "ilObject2GUI")) {
207 $this->gui_obj = new $class_name($this->cur_ref_id, ilObject2GUI::REPOSITORY_NODE_ID);
208 } else {
209 $this->gui_obj = new $class_name(null, $this->cur_ref_id, true, false);
210 }
211 } else {
212 if (is_subclass_of($class_name, "ilObject2GUI")) {
213 $this->gui_obj = new $class_name(null, ilObject2GUI::REPOSITORY_NODE_ID, $this->cur_ref_id);
214 } else {
215 $this->gui_obj = new $class_name("", 0, true, false);
216 }
217 }
218 $this->gui_obj->setCreationMode($creation_mode);
219 }
220 $this->gui_obj->setAdminMode($this->admin_mode);
221 $this->help->setScreenIdComponent(ilObject::_lookupType($this->cur_ref_id, true));
222 $this->showTree();
223
224 $this->ctrl->setReturn($this, "return");
225 $ret = $this->ctrl->forwardCommand($this->gui_obj);
226 $html = $this->gui_obj->getHTML();
227
228 if ($html != "") {
229 $this->tpl->setVariable("OBJECTS", $html);
230 }
231 $this->tpl->printToStdout();
232
233 } else {
234 // local command
235 $cmd = $this->ctrl->getCmd("forward");
236 if (in_array($cmd, self::COMMANDS)) {
237 $this->$cmd();
238 }
239 }
240 }
showTree()
Show the repository tree in the slate This command is used by ilAdministrationExplorerGUI the for adm...
static _lookupType(int $id, bool $reference=false)
static getStartingPointAsUrl()
const SYSTEM_ROLE_ID
Definition: constants.php:29
const SYSTEM_FOLDER_ID
Definition: constants.php:35

References ilObject\_lookupType(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilUserUtil\getStartingPointAsUrl(), ILIAS\Repository\help(), ilLogLevel\INFO, ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilObject2GUI\REPOSITORY_NODE_ID, showTree(), SYSTEM_FOLDER_ID, SYSTEM_ROLE_ID, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ forward()

ilAdministrationGUI::forward ( )
private

Redirect in special cases.

  • Administration mode of the repository
  • Direct jump to user editing
Exceptions
ilCtrlException
ilPermissionException

Definition at line 250 of file class.ilAdministrationGUI.php.

250 : void
251 {
252 if ($this->admin_mode !== "repository") { // settings
253 if ($this->request->getRefId() == USER_FOLDER_ID) {
254 $this->ctrl->setParameter($this, "ref_id", USER_FOLDER_ID);
255 $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "settings");
256 if (ilObject::_lookupType($this->request->getJumpToUserId()) === "usr") {
257 $this->ctrl->setParameterByClass(
258 "ilobjuserfoldergui",
259 "jmpToUser",
260 $this->request->getJumpToUserId()
261 );
262 $this->ctrl->redirectByClass("ilobjuserfoldergui", "jumpToUser");
263 } else {
264 $this->ctrl->redirectByClass("ilobjuserfoldergui", "view");
265 }
266 } else {
267 // this code should not be necessary anymore...
268 throw new ilPermissionException("Missing AdmiGUI parameter.");
269 }
270 } else {
271 $this->ctrl->setParameter($this, "ref_id", ROOT_FOLDER_ID);
272 $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "repository");
273 $this->ctrl->redirectByClass("ilobjrootfoldergui", "view");
274 }
275 }
const USER_FOLDER_ID
Definition: constants.php:33
const ROOT_FOLDER_ID
Definition: constants.php:32

References ilObject\_lookupType(), ILIAS\Repository\ctrl(), ROOT_FOLDER_ID, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ jump()

ilAdministrationGUI::jump ( )
private

Jump to the GUI of an administration node This command is used by AdministrationMainBarProvider for the nodes in the admin menu.

Definition at line 306 of file class.ilAdministrationGUI.php.

306 : void
307 {
308 $ref_id = $this->request->getRefId();
310 $obj_type = ilObject::_lookupType($obj_id);
311 $class_name = $this->obj_definition->getClassName($obj_type);
312 $class = strtolower("ilObj" . $class_name . "GUI");
313 $this->ctrl->setParameterByClass($class, "ref_id", $ref_id);
314 $this->ctrl->redirectByClass($class, "view");
315 }
static _lookupObjId(int $ref_id)

References $ref_id, ilObject\_lookupObjId(), ilObject\_lookupType(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ jumpToPluginSlot()

ilAdministrationGUI::jumpToPluginSlot ( )
private

Special jump to plugin slot after ilCtrl has been reloaded Ths command is used by ilObjComponentSettingsGUI for plugin updates.

Definition at line 297 of file class.ilAdministrationGUI.php.

297 : void
298 {
299 $this->ctrl->redirectByClass("ilobjcomponentsettingsgui", "listPlugins");
300 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ showTree()

ilAdministrationGUI::showTree ( )
private

Show the repository tree in the slate This command is used by ilAdministrationExplorerGUI the for administration mode of the repository.

Definition at line 281 of file class.ilAdministrationGUI.php.

281 : void
282 {
283 if ($this->admin_mode !== "repository") {
284 return;
285 }
286
287 $this->global_screen->tool()->context()->current()->addAdditionalData(ilAdminGSToolProvider::SHOW_ADMIN_TREE, true);
288
289 $exp = new ilAdministrationExplorerGUI(self::class, "showTree");
290 $exp->handleCommand();
291 }
Administration explorer GUI class.

References ilAdminGSToolProvider\SHOW_ADMIN_TREE.

Referenced by executeCommand().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

readonly ilAccessHandler ilAdministrationGUI::$access
private

Definition at line 72 of file class.ilAdministrationGUI.php.

◆ $admin_mode

string ilAdministrationGUI::$admin_mode = ""
private

Definition at line 81 of file class.ilAdministrationGUI.php.

◆ $ctrl

readonly ilCtrl ilAdministrationGUI::$ctrl
private

Definition at line 75 of file class.ilAdministrationGUI.php.

◆ $cur_ref_id

int ilAdministrationGUI::$cur_ref_id
private

Definition at line 80 of file class.ilAdministrationGUI.php.

◆ $global_screen

readonly GlobalScreen ilAdministrationGUI::$global_screen
private

Definition at line 77 of file class.ilAdministrationGUI.php.

◆ $gui_obj

ilObjectGUI ilAdministrationGUI::$gui_obj
private

Definition at line 83 of file class.ilAdministrationGUI.php.

◆ $help

readonly ilHelpGUI ilAdministrationGUI::$help
private

Definition at line 68 of file class.ilAdministrationGUI.php.

◆ $lng

readonly ilLanguage ilAdministrationGUI::$lng
private

Definition at line 69 of file class.ilAdministrationGUI.php.

◆ $logger

readonly ilLogger ilAdministrationGUI::$logger
private

Definition at line 78 of file class.ilAdministrationGUI.php.

◆ $obj_definition

readonly ilObjectDefinition ilAdministrationGUI::$obj_definition
private

Definition at line 67 of file class.ilAdministrationGUI.php.

◆ $rbac_review

readonly ilRbacReview ilAdministrationGUI::$rbac_review
private

Definition at line 73 of file class.ilAdministrationGUI.php.

◆ $request

readonly AdminGUIRequest ilAdministrationGUI::$request
private

Definition at line 76 of file class.ilAdministrationGUI.php.

◆ $requested_obj_id

int ilAdministrationGUI::$requested_obj_id = 0
private

Definition at line 82 of file class.ilAdministrationGUI.php.

◆ $tpl

readonly ilGlobalTemplateInterface ilAdministrationGUI::$tpl
private

Definition at line 70 of file class.ilAdministrationGUI.php.

◆ $tree

readonly ilTree ilAdministrationGUI::$tree
private

Definition at line 71 of file class.ilAdministrationGUI.php.

◆ $user

readonly ilObjUser ilAdministrationGUI::$user
private

Definition at line 74 of file class.ilAdministrationGUI.php.

◆ COMMANDS

const array ilAdministrationGUI::COMMANDS = ['forward', 'jump', 'jumpToPluginSlot', 'showTree']
private

Definition at line 65 of file class.ilAdministrationGUI.php.


The documentation for this class was generated from the following file: