ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilRepositoryGUI Class Reference

Class ilRepositoryGUI. More...

+ Inheritance diagram for ilRepositoryGUI:
+ Collaboration diagram for ilRepositoryGUI:

Public Member Functions

 executeCommand ()
 
 show ()
 
 showRepTree ()
 

Data Fields

ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilRbacSystem $rbacsystem
 
int $cur_ref_id
 
string $cmd
 
string $mode = ""
 
ilCtrl $ctrl
 

Protected Member Functions

 redirectToRoot ()
 

Protected Attributes

ilObjectDefinition $objDefinition
 
ilLogger $log
 
ilObjUser $user
 
ilSetting $settings
 
ilHelpGUI $help
 
ilErrorHandling $error
 
ilAccessHandler $access
 
ContextServices $tool_context
 
StandardGUIRequest $request
 
bool $creation_mode
 
ilObjectGUI $gui_obj
 

Private Attributes

ILIAS HTTP Services $http
 

Detailed Description

Class ilRepositoryGUI.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

@ilCtrl_Calls ilRepositoryGUI: ilObjGroupGUI, ilObjFolderGUI, ilObjFileGUI, ilObjCourseGUI, ilCourseObjectivesGUI @ilCtrl_Calls ilRepositoryGUI: ilObjSAHSLearningModuleGUI, ilObjChatroomGUI, ilObjForumGUI @ilCtrl_Calls ilRepositoryGUI: ilObjLearningModuleGUI, ilObjGlossaryGUI @ilCtrl_Calls ilRepositoryGUI: ilObjQuestionPoolGUI, ilObjSurveyQuestionPoolGUI, ilObjTestGUI @ilCtrl_Calls ilRepositoryGUI: ilObjSurveyGUI, ilObjExerciseGUI, ilObjMediaPoolGUI, ilObjFileBasedLMGUI @ilCtrl_Calls ilRepositoryGUI: ilObjCategoryGUI, ilObjRoleGUI, ilObjBlogGUI @ilCtrl_Calls ilRepositoryGUI: ilObjLinkResourceGUI @ilCtrl_Calls ilRepositoryGUI: ilObjRootFolderGUI, ilObjMediaCastGUI, ilObjRemoteCourseGUI, ilObjSessionGUI @ilCtrl_Calls ilRepositoryGUI: ilObjCourseReferenceGUI, ilObjCategoryReferenceGUI, ilObjDataCollectionGUI, ilObjGroupReferenceGUI, ilObjStudyProgrammeReferenceGUI @ilCtrl_Calls ilRepositoryGUI: ilObjPollGUI, ilObjRemoteCategoryGUI, ilObjRemoteWikiGUI, ilObjRemoteLearningModuleGUI @ilCtrl_Calls ilRepositoryGUI: ilObjRemoteGlossaryGUI, ilObjRemoteFileGUI, ilObjRemoteGroupGUI @ilCtrl_Calls ilRepositoryGUI: ilObjRemoteTestGUI, ilObjCloudGUI, ilObjPortfolioTemplateGUI @ilCtrl_Calls ilRepositoryGUI: ilObjStudyProgrammeGUI @ilCtrl_Calls ilRepositoryGUI: ilObjIndividualAssessmentGUI @ilCtrl_Calls ilRepositoryGUI: ilObjLTIConsumerGUI @ilCtrl_Calls ilRepositoryGUI: ilObjCmiXapiGUI @ilCtrl_Calls ilRepositoryGUI: ilPermissionGUI

Definition at line 46 of file class.ilRepositoryGUI.php.

Member Function Documentation

◆ executeCommand()

ilRepositoryGUI::executeCommand ( )

Definition at line 123 of file class.ilRepositoryGUI.php.

123 : void
124 {
127 $ilHelp = $this->help;
129 if (
130 ($this->user->isAnonymous() || !($this->user->getId() >= 1)) &&
131 !ilPublicSectionSettings::getInstance()->isEnabledForDomain(
132 $this->http->request()->getServerParams()['SERVER_NAME']
133 )
134 ) {
135 $this->ctrl->redirectToURL('./login.php?cmd=force_login');
136 }
137 $this->tool_context->claim()->repository();
138
139 // check creation mode
140 // determined by "new_type" parameter
141 $new_type = $this->request->getNewType();
142
143 if ($new_type !== "" && $new_type !== "sty" && $new_type !== "tax") {
144 $this->creation_mode = true;
145 $ilHelp->setScreenIdComponent($new_type);
146 $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
147 $this->ctrl->saveParameter($this, ["crtcb"]);
148 }
149
150 $cmd = $this->ctrl->getCmd();
151
152 // determine next class
153 if ($this->creation_mode) {
154 $obj_type = $new_type;
155 $class_name = $this->objDefinition->getClassName($obj_type);
156 if (strtolower($class_name) !== "user") {
157 $next_class = strtolower("ilObj" . $class_name . "GUI");
158 } else {
159 $next_class = $this->ctrl->getNextClass();
160 }
161 // Only set the fixed cmdClass if the next class is different to
162 // the GUI class of the new object.
163 // An example:
164 // Copy Category uses this call structure:
165 // RespositoryGUI -> CategoryGUI -> ilObjectCopyGUI
166 // Without this fix, the cmdClass ilObjectCopyGUI would never be reached
167
168 ilLoggerFactory::getLogger('obj')->debug($this->ctrl->getNextClass() . ' <-> ' . $class_name);
169
170 if ($this->ctrl->getNextClass() !== strtolower('ilObj' . $class_name . 'GUI')) {
171 $this->ctrl->setParameterByClass($next_class, "new_type", $new_type);
172 $this->ctrl->redirectByClass($next_class, $this->ctrl->getCmd());
173 }
174 } elseif ((($next_class = $this->ctrl->getNextClass($this)) == "")
175 || (strcasecmp($next_class, ilRepositoryGUI::class) === 0 && $this->ctrl->getCmd() === "return")) {
176 // get GUI of current object
177 $obj_type = ilObject::_lookupType($this->cur_ref_id, true);
178 $class_name = $this->objDefinition->getClassName($obj_type);
179 $next_class = strtolower("ilObj" . $class_name . "GUI");
180
181 if ($this->ctrl->getCmd() === "return") {
182 $this->ctrl->redirectByClass($next_class, "");
183 }
184
185 if ($this->ctrl->getCmd() !== "showRepTree") {
186 $this->ctrl->setParameterByClass($next_class, "item_ref_id", $this->request->getItemRefId());
187 $this->ctrl->redirectByClass($next_class, $this->ctrl->getCmd());
188 }
189 }
190
191 // commands that are always handled by repository gui
192 // to do: move to container
193 if ($cmd === "showRepTree") {
194 $next_class = "";
195 }
196 switch ($next_class) {
197 // forward asynchronous file uploads to the upload handler.
198 // possible via dropzones in list guis or global template
199 // sections like title.
200 case strtolower(ilObjFileUploadHandlerGUI::class):
201 $this->ctrl->forwardCommand(new ilObjFileUploadHandlerGUI());
202 break;
203
204 default:
205 // forward all other classes to gui commands
206 if ($next_class !== null && $next_class !== "" && strcasecmp($next_class, ilRepositoryGUI::class) !== 0) {
207 $class_path = $this->ctrl->lookupClassPath($next_class);
208 // get gui class instance
209 //require_once($class_path);
210 $class_name = $this->ctrl->getClassForClasspath($class_path);
211 if (!$this->creation_mode) {
212 if (is_subclass_of($class_name, "ilObject2GUI")) {
213 $this->gui_obj = new $class_name($this->cur_ref_id, ilObject2GUI::REPOSITORY_NODE_ID);
214 } else {
215 $this->gui_obj = new $class_name("", $this->cur_ref_id, true, false);
216 }
217 } elseif (is_subclass_of($class_name, "ilObject2GUI")) {
218 $this->gui_obj = new $class_name(0, ilObject2GUI::REPOSITORY_NODE_ID, $this->cur_ref_id);
219 } else {
220 $this->gui_obj = new $class_name("", 0, true, false);
221 }
222 $this->gui_obj->setCreationMode($this->creation_mode);
223 $this->ctrl->setReturn($this, "return");
224 $this->show();
225 } else { //
226 $cmd = (string) $this->ctrl->getCmd("");
227
228 // check read access for category
229 if ($cmd !== "showRepTree" && $this->cur_ref_id > 0 && !$rbacsystem->checkAccess("read", $this->cur_ref_id)) {
230 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
231 $this->tpl->printToStdout();
232 } else {
233 $this->cmd = $cmd;
234 $this->$cmd();
235 }
236 }
237 break;
238 }
239 }
const ID_PART_SCREEN
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 getLogger(string $a_component_id)
Get component logger.
static _lookupType(int $id, bool $reference=false)
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
ilErrorHandling $error
$ilErr
Definition: raiseError.php:33

References $cmd, $error, $help, $ilErr, $lng, $rbacsystem, ilObject\_lookupType(), ilRbacSystem\checkAccess(), ILIAS\Repository\ctrl(), ilPublicSectionSettings\getInstance(), ilLoggerFactory\getLogger(), ilHelpGUI\ID_PART_SCREEN, ilObject2GUI\REPOSITORY_NODE_ID, show(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ redirectToRoot()

ilRepositoryGUI::redirectToRoot ( )
protected

Definition at line 111 of file class.ilRepositoryGUI.php.

111 : void
112 {
115 self::class,
116 "ref_id",
117 $this->tree->getRootId()
118 );
119
120 $ctrl->redirectByClass(self::class, "");
121 }
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References $ctrl, ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ show()

ilRepositoryGUI::show ( )

Definition at line 241 of file class.ilRepositoryGUI.php.

241 : void
242 {
243 // normal command processing
244 $this->ctrl->forwardCommand($this->gui_obj);
245 $this->tpl->setVariable("OBJECTS", $this->gui_obj->getHTML());
246 $this->tpl->printToStdout();
247 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRepTree()

ilRepositoryGUI::showRepTree ( )

Definition at line 249 of file class.ilRepositoryGUI.php.

249 : void
250 {
251 $exp = new ilRepositoryExplorerGUI($this, "showRepTree");
252 // root node should be skipped, see #26787
253 $exp->setSkipRootNode(true);
254 $exp->handleCommand();
255 }
Repository explorer GUI class.

Field Documentation

◆ $access

ilAccessHandler ilRepositoryGUI::$access
protected

Definition at line 54 of file class.ilRepositoryGUI.php.

◆ $cmd

string ilRepositoryGUI::$cmd

Definition at line 61 of file class.ilRepositoryGUI.php.

Referenced by executeCommand().

◆ $creation_mode

bool ilRepositoryGUI::$creation_mode
protected

Definition at line 66 of file class.ilRepositoryGUI.php.

◆ $ctrl

ilCtrl ilRepositoryGUI::$ctrl

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

Referenced by redirectToRoot().

◆ $cur_ref_id

int ilRepositoryGUI::$cur_ref_id

Definition at line 60 of file class.ilRepositoryGUI.php.

◆ $error

ilErrorHandling ilRepositoryGUI::$error
protected

Definition at line 53 of file class.ilRepositoryGUI.php.

Referenced by executeCommand().

◆ $gui_obj

ilObjectGUI ilRepositoryGUI::$gui_obj
protected

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

◆ $help

ilHelpGUI ilRepositoryGUI::$help
protected

Definition at line 52 of file class.ilRepositoryGUI.php.

Referenced by executeCommand().

◆ $http

ILIAS HTTP Services ilRepositoryGUI::$http
private

Definition at line 64 of file class.ilRepositoryGUI.php.

◆ $lng

ilLanguage ilRepositoryGUI::$lng

Definition at line 56 of file class.ilRepositoryGUI.php.

Referenced by executeCommand().

◆ $log

ilLogger ilRepositoryGUI::$log
protected

Definition at line 49 of file class.ilRepositoryGUI.php.

◆ $mode

string ilRepositoryGUI::$mode = ""

Definition at line 62 of file class.ilRepositoryGUI.php.

◆ $objDefinition

ilObjectDefinition ilRepositoryGUI::$objDefinition
protected

Definition at line 48 of file class.ilRepositoryGUI.php.

◆ $rbacsystem

ilRbacSystem ilRepositoryGUI::$rbacsystem

Definition at line 59 of file class.ilRepositoryGUI.php.

Referenced by executeCommand().

◆ $request

StandardGUIRequest ilRepositoryGUI::$request
protected

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

◆ $settings

ilSetting ilRepositoryGUI::$settings
protected

Definition at line 51 of file class.ilRepositoryGUI.php.

◆ $tool_context

ContextServices ilRepositoryGUI::$tool_context
protected

Definition at line 55 of file class.ilRepositoryGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilRepositoryGUI::$tpl

Definition at line 57 of file class.ilRepositoryGUI.php.

◆ $tree

ilTree ilRepositoryGUI::$tree

Definition at line 58 of file class.ilRepositoryGUI.php.

◆ $user

ilObjUser ilRepositoryGUI::$user
protected

Definition at line 50 of file class.ilRepositoryGUI.php.


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