ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilStructureObjectGUI Class Reference

@ilCtrl_Calls ilStructureObjectGUI: ilConditionHandlerGUI, ilObjectMetaDataGUI @ilCtrl_Calls ilStructureObjectGUI: ILIAS\LearningModule\Editing\EditSubObjectsGUI More...

+ Inheritance diagram for ilStructureObjectGUI:
+ Collaboration diagram for ilStructureObjectGUI:

Public Member Functions

 __construct (ilObjLearningModule $a_content_obj, ilLMTree $a_tree)
 
 setStructureObject (ilStructureObject $a_st_object)
 
 getType ()
 
 executeCommand ()
 
 create ()
 structure / page object creation form More...
 
 edit ()
 
 view ()
 
 initConditionHandlerInterface ()
 
 cancel ()
 cancel creation of new page or chapter More...
 
 setTabs ()
 
 setPageLayout ()
 Set layout for multipl pages. More...
 
 initSetPageLayoutForm ()
 Init set page layout form. More...
 
 savePageLayout ()
 Save page layout. More...
 
 editMasterLanguage ()
 
 switchToLanguage ()
 
- Public Member Functions inherited from ilLMObjectGUI
 __construct (ilObjLearningModule $a_content_obj)
 constructor More...
 
 setActions (?array $a_actions=null)
 
 getTargetFrame (string $a_cmd, string $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 getCreateForm ()
 
 putInTree (?int $target=0)
 put this object into content object tree More...
 
 delete (array $ids)
 Confirm deletion screen (delete page or structure objects) More...
 
 setTabs ()
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 showActions (array $a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Static Public Member Functions

static _goto (string $a_target, int $a_target_ref_id=0)
 

Data Fields

ilLMTree $tree
 
- Data Fields inherited from ilLMObjectGUI
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilLMObject $obj
 
ilCtrl $ctrl
 
ilObjLearningModule $content_object
 
array $actions
 

Protected Member Functions

 addSubTabs ($active="")
 

Protected Attributes

ILIAS LearningModule InternalDomainService $domain
 
ILIAS LearningModule InternalGUIService $gui
 
ilPropertyFormGUI $form
 
ilConditionHandlerGUI $condHI
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilLogger $log
 
- Protected Attributes inherited from ilLMObjectGUI
int $requested_ref_id
 
ILIAS DI UIServices $ui
 
int $requested_obj_id
 
string $requested_totransl = ""
 
string $requested_transl = ""
 
string $requested_target
 
string $requested_new_type
 
array $target_frame
 
EditingGUIRequest $request
 

Detailed Description

@ilCtrl_Calls ilStructureObjectGUI: ilConditionHandlerGUI, ilObjectMetaDataGUI @ilCtrl_Calls ilStructureObjectGUI: ILIAS\LearningModule\Editing\EditSubObjectsGUI

Definition at line 26 of file class.ilStructureObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilStructureObjectGUI::__construct ( ilObjLearningModule  $a_content_obj,
ilLMTree  $a_tree 
)

Definition at line 37 of file class.ilStructureObjectGUI.php.

40 {
41 global $DIC;
42
43 $this->user = $DIC->user();
44 $this->ctrl = $DIC->ctrl();
45 $this->lng = $DIC->language();
46 $this->tabs = $DIC->tabs();
47 $this->log = $DIC["ilLog"];
48 $this->tpl = $DIC->ui()->mainTemplate();
49 parent::__construct($a_content_obj);
50 $this->tree = $a_tree;
51 $this->gui = $DIC->learningModule()->internal()->gui();
52 $this->domain = $DIC->learningModule()->internal()->domain();
53 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilStructureObjectGUI::_goto ( string  $a_target,
int  $a_target_ref_id = 0 
)
static
Exceptions
ilPermissionException

Definition at line 240 of file class.ilStructureObjectGUI.php.

243 : void {
244 global $DIC;
245 $main_tpl = $DIC->ui()->mainTemplate();
246
247 $lng = $DIC->language();
248 $ilAccess = $DIC->access();
249 $ctrl = $DIC->ctrl();
250
251 // determine learning object
252 $lm_id = ilLMObject::_lookupContObjID($a_target);
253
254 // get all references
255 $ref_ids = ilObject::_getAllReferences($lm_id);
256
257 // always try passed ref id first
258 if (in_array($a_target_ref_id, $ref_ids)) {
259 $ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
260 }
261
262 // check read permissions
263 foreach ($ref_ids as $ref_id) {
264 // Permission check
265 if ($ilAccess->checkAccess("read", "", $ref_id)) {
266 $ctrl->setParameterByClass("ilLMPresentationGUI", "obj_id", $a_target);
267 $ctrl->setParameterByClass("ilLMPresentationGUI", "ref_id", $ref_id);
268 $ctrl->redirectByClass("ilLMPresentationGUI", "");
269 }
270 }
271
272 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
273 $main_tpl->setOnScreenMessage('failure', sprintf(
274 $lng->txt("msg_no_perm_read_item"),
276 ), true);
278 }
279
280 throw new ilPermissionException($lng->txt("msg_no_perm_read_lm"));
281 }
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
static _lookupContObjID(int $a_id)
get learning module id for lm object
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 _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
$ref_id
Definition: ltiauth.php:66

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

+ Here is the caller graph for this function:

◆ addSubTabs()

ilStructureObjectGUI::addSubTabs (   $active = "")
protected

Definition at line 214 of file class.ilStructureObjectGUI.php.

215 {
216 $ilTabs = $this->tabs;
218
219 // content -> pages
220 $this->ctrl->setParameterByClass(static::class, "sub_type", "pg");
221 $ilTabs->addSubTab(
222 "sub_pages",
223 $lng->txt("cont_pages"),
224 $this->ctrl->getLinkTargetByClass(EditSubObjectsGUI::class)
225 );
226
227 // chapters
228 $this->ctrl->setParameterByClass(static::class, "sub_type", "st");
229 $ilTabs->addSubTab(
230 "sub_chapters",
231 $lng->txt("cont_subchapters"),
232 $this->ctrl->getLinkTargetByClass(EditSubObjectsGUI::class)
233 );
234 $ilTabs->activateSubTab($active);
235 }

References $lng, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancel()

ilStructureObjectGUI::cancel ( )

cancel creation of new page or chapter

Definition at line 159 of file class.ilStructureObjectGUI.php.

159 : void
160 {
161 if ($this->requested_obj_id != 0) {
162 if ($this->requested_new_type == "pg") {
163 $this->ctrl->redirect($this, "view");
164 } else {
165 $this->ctrl->redirect($this, "subchap");
166 }
167 }
168 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ create()

ilStructureObjectGUI::create ( )

structure / page object creation form

Reimplemented from ilLMObjectGUI.

Definition at line 125 of file class.ilStructureObjectGUI.php.

125 : void
126 {
127 if ($this->requested_obj_id != 0) {
128 $this->setTabs();
129 }
130 parent::create();
131 }

◆ edit()

ilStructureObjectGUI::edit ( )

Definition at line 133 of file class.ilStructureObjectGUI.php.

133 : void
134 {
135 $this->view();
136 }

◆ editMasterLanguage()

ilStructureObjectGUI::editMasterLanguage ( )

Definition at line 360 of file class.ilStructureObjectGUI.php.

360 : void
361 {
362 $ilCtrl = $this->ctrl;
363
364 $ilCtrl->setParameter($this, "transl", "-");
365 $ilCtrl->redirect($this, "showHierarchy");
366 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

◆ executeCommand()

ilStructureObjectGUI::executeCommand ( )

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

66 : void
67 {
68 $next_class = $this->ctrl->getNextClass($this);
69 $cmd = $this->ctrl->getCmd();
70
71 switch ($next_class) {
72 case 'ilobjectmetadatagui':
73
74 $this->setTabs();
75
76 $md_gui = new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
77 $md_gui->addMDObserver($this->obj, 'MDUpdateListener', 'General');
78 $md_gui->addMDObserver($this->obj, 'MDUpdateListener', 'Educational'); // #9510
79 $this->ctrl->forwardCommand($md_gui);
80 break;
81
82 case "ilconditionhandlergui":
83 $ilTabs = $this->tabs;
84
85 $this->setTabs();
87 $this->ctrl->forwardCommand($this->condHI);
88 $ilTabs->setTabActive('preconditions');
89 break;
90
91 case strtolower(EditSubObjectsGUI::class):
92 $this->setTabs();
93 $this->tabs->activateTab("sub_pages");
94 if ($this->request->getSubType() === "pg") {
95 $this->addSubTabs("sub_pages");
96 $table_title = $this->lng->txt("cont_pages");
97 } else {
98 $this->addSubTabs("sub_chapters");
99 $table_title = $this->lng->txt("cont_subchapters");
100 }
101 $gui = $this->gui->editing()->editSubObjectsGUI(
102 $this->request->getSubType(),
103 $this->content_object,
104 $table_title
105 );
106 $this->ctrl->forwardCommand($gui);
107 break;
108
109 default:
110 if ($cmd == 'listConditions') {
111 $this->setTabs();
113 $this->condHI->executeCommand();
114 } elseif (($cmd == "create") && ($this->requested_new_type == "pg")) {
115 $this->setTabs();
116 $pg_gui = new ilLMPageObjectGUI($this->content_object);
117 $pg_gui->executeCommand();
118 } else {
119 $this->$cmd();
120 }
121 break;
122 }
123 }
User Interface for Learning Module Page Objects Editing.
Class ilObjectMetaDataGUI.
ILIAS LearningModule InternalGUIService $gui

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ getType()

ilStructureObjectGUI::getType ( )

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

61 : string
62 {
63 return "st";
64 }

◆ initConditionHandlerInterface()

ilStructureObjectGUI::initConditionHandlerInterface ( )

Definition at line 144 of file class.ilStructureObjectGUI.php.

144 : void
145 {
146 $this->condHI = new ilConditionHandlerGUI();
147 $this->condHI->setBackButtons(array());
148 $this->condHI->setAutomaticValidation(false);
149 $this->condHI->setTargetType("st");
150 $this->condHI->setTargetRefId($this->content_object->getRefId());
151 $this->condHI->setTargetId($this->obj->getId());
152 $this->condHI->setTargetTitle($this->obj->getTitle());
153 }
class ilConditionHandlerGUI

◆ initSetPageLayoutForm()

ilStructureObjectGUI::initSetPageLayoutForm ( )

Init set page layout form.

Definition at line 311 of file class.ilStructureObjectGUI.php.

311 : void
312 {
314 $ilCtrl = $this->ctrl;
315
316 $this->form = new ilPropertyFormGUI();
317
318 $ids = $this->request->getIds();
319 foreach ($ids as $id) {
320 $hi = new ilHiddenInputGUI("id[]");
321 $hi->setValue($id);
322 $this->form->addItem($hi);
323 }
325 $lng->txt("cont_layout"),
326 "layout",
327 $this->content_object->getLayout()
328 );
329
330 $this->form->addItem($layout);
331
332 $this->form->addCommandButton("savePageLayout", $lng->txt("save"));
333 $this->form->addCommandButton("showHierarchy", $lng->txt("cancel"));
334
335 $this->form->setTitle($lng->txt("cont_set_layout"));
336 $this->form->setFormAction($ilCtrl->getFormAction($this));
337 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This class represents a hidden form property in a property form.
static getLayoutOption(string $a_txt, string $a_var, string $a_def_option="")
This class represents a property form user interface.
form( $class_path, string $cmd, string $submit_caption="")

References $id, $lng, ILIAS\Repository\form(), and ilObjContentObjectGUI\getLayoutOption().

+ Here is the call graph for this function:

◆ savePageLayout()

ilStructureObjectGUI::savePageLayout ( )

Save page layout.

Definition at line 342 of file class.ilStructureObjectGUI.php.

342 : void
343 {
345 $ilCtrl = $this->ctrl;
346
347 $ids = $this->request->getIds();
348 $layout = $this->request->getLayout();
349 foreach ($ids as $id) {
351 $id,
352 $layout,
353 $this->content_object
354 );
355 }
356 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
357 $ilCtrl->redirect($this, "showHierarchy");
358 }
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.

References $id, $lng, and ilLMObject\writeLayout().

+ Here is the call graph for this function:

◆ setPageLayout()

ilStructureObjectGUI::setPageLayout ( )

Set layout for multipl pages.

Definition at line 291 of file class.ilStructureObjectGUI.php.

291 : void
292 {
294 $ilCtrl = $this->ctrl;
296
297 $ids = $this->request->getIds();
298 if (count($ids) == 0) {
299 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
300 $ilCtrl->redirect($this, "showHierarchy");
301 }
302
303 $this->initSetPageLayoutForm();
304
305 $tpl->setContent($this->form->getHTML());
306 }
ilGlobalTemplateInterface $tpl
initSetPageLayoutForm()
Init set page layout form.
setContent(string $a_html)
Sets content for standard template.

References $lng, and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ setStructureObject()

ilStructureObjectGUI::setStructureObject ( ilStructureObject  $a_st_object)

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

57 : void {
58 $this->obj = $a_st_object;
59 }

◆ setTabs()

ilStructureObjectGUI::setTabs ( )

Reimplemented from ilLMObjectGUI.

Definition at line 170 of file class.ilStructureObjectGUI.php.

170 : void
171 {
172 $ilTabs = $this->tabs;
174
175 // subelements
176 $this->ctrl->setParameterByClass(static::class, "sub_type", "pg");
177 $ilTabs->addTab(
178 "sub_pages",
179 $lng->txt("cont_content"),
180 $this->ctrl->getLinkTargetByClass(EditSubObjectsGUI::class)
181 );
182
183 // preconditions
184 $ilTabs->addTab(
185 "preconditions",
186 $lng->txt("preconditions"),
187 $this->ctrl->getLinkTarget($this, 'listConditions')
188 );
189
190 // metadata
191 $mdgui = new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
192 $mdtab = $mdgui->getTab();
193 if ($mdtab) {
194 $ilTabs->addTab(
195 "meta_data",
196 $lng->txt("meta_data"),
197 $mdtab
198 );
199 }
200
201 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_st.svg"));
202 $this->tpl->setTitle(
203 $this->lng->txt($this->obj->getType()) . ": " . $this->obj->getTitle()
204 );
205
206 // presentation view
207 $ilTabs->addNonTabbedLink(
208 "pres_mode",
209 $lng->txt("cont_presentation_view"),
210 ILIAS_HTTP_PATH . "/goto.php?target=st_" . $this->obj->getId()
211 );
212 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $lng, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ switchToLanguage()

ilStructureObjectGUI::switchToLanguage ( )

Definition at line 368 of file class.ilStructureObjectGUI.php.

368 : void
369 {
370 $ilCtrl = $this->ctrl;
371
372 $ilCtrl->setParameter($this, "transl", $this->requested_totransl);
373 $ilCtrl->redirect($this, "showHierarchy");
374 }

◆ view()

ilStructureObjectGUI::view ( )

Definition at line 138 of file class.ilStructureObjectGUI.php.

138 : void
139 {
140 $this->ctrl->redirectByClass(EditSubObjectsGUI::class, "editPages");
141 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

Field Documentation

◆ $condHI

ilConditionHandlerGUI ilStructureObjectGUI::$condHI
protected

Definition at line 31 of file class.ilStructureObjectGUI.php.

◆ $domain

ILIAS LearningModule InternalDomainService ilStructureObjectGUI::$domain
protected

Definition at line 28 of file class.ilStructureObjectGUI.php.

◆ $form

ilPropertyFormGUI ilStructureObjectGUI::$form
protected

Definition at line 30 of file class.ilStructureObjectGUI.php.

◆ $gui

ILIAS LearningModule InternalGUIService ilStructureObjectGUI::$gui
protected

Definition at line 29 of file class.ilStructureObjectGUI.php.

◆ $log

ilLogger ilStructureObjectGUI::$log
protected

Definition at line 34 of file class.ilStructureObjectGUI.php.

◆ $tabs

ilTabsGUI ilStructureObjectGUI::$tabs
protected

Definition at line 33 of file class.ilStructureObjectGUI.php.

◆ $tree

ilLMTree ilStructureObjectGUI::$tree

Definition at line 35 of file class.ilStructureObjectGUI.php.

◆ $user

ilObjUser ilStructureObjectGUI::$user
protected

Definition at line 32 of file class.ilStructureObjectGUI.php.


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