ILIAS  trunk Revision v12.0_alpha-413-g215742c0453
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('administration');
102 $this->lng->loadLanguageModule('benchmark');
103
104 $context = $this->global_screen->tool()->context();
105 $context->claim()->administration();
106
107 $this->request = new AdminGUIRequest(
108 $DIC->http(),
109 $DIC->refinery()
110 );
111
112 $this->ctrl->saveParameter($this, array("ref_id", "admin_mode"));
113
114 $this->admin_mode = $this->request->getAdminMode();
115 if ($this->admin_mode !== ilObjectGUI::ADMIN_MODE_REPOSITORY) {
116 $this->admin_mode = ilObjectGUI::ADMIN_MODE_SETTINGS;
117 }
118
119 $this->ctrl->setReturn($this, "");
120
121 // determine current ref id and mode
122 $ref_id = $this->request->getRefId();
123 if ($this->tree->isInTree($ref_id)) {
124 $this->cur_ref_id = $ref_id;
125 } else {
126 throw new ilPermissionException("Invalid ref id.");
127 }
128
129 $this->requested_obj_id = $this->request->getObjId();
130 }
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 137 of file class.ilAdministrationGUI.php.

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

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

307 : void
308 {
309 $ref_id = $this->request->getRefId();
311 $obj_type = ilObject::_lookupType($obj_id);
312 $class_name = $this->obj_definition->getClassName($obj_type);
313 $class = strtolower("ilObj" . $class_name . "GUI");
314 $this->ctrl->setParameterByClass($class, "ref_id", $ref_id);
315 $this->ctrl->redirectByClass($class, "view");
316 }
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 298 of file class.ilAdministrationGUI.php.

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

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 282 of file class.ilAdministrationGUI.php.

282 : void
283 {
284 if ($this->admin_mode !== "repository") {
285 return;
286 }
287
288 $this->global_screen->tool()->context()->current()->addAdditionalData(ilAdminGSToolProvider::SHOW_ADMIN_TREE, true);
289
290 $exp = new ilAdministrationExplorerGUI(self::class, "showTree");
291 $exp->handleCommand();
292 }
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: