ILIAS  release_8 Revision v8.24
ilPCIIMTriggerEditorGUI Class Reference

User interface class for page content map editor. More...

+ Inheritance diagram for ilPCIIMTriggerEditorGUI:
+ Collaboration diagram for ilPCIIMTriggerEditorGUI:

Public Member Functions

 __construct (ilPCInteractiveImage $a_content_obj, ilPageObject $a_page, EditGUIRequest $request)
 
 getParentNodeName ()
 
 getEditorTitle ()
 
 getImageMapTableHTML ()
 Get trigger table. More...
 
 getToolbar ()
 
 addNewArea ()
 
 initAreaEditingForm (string $a_edit_property)
 Init area editing form. More...
 
 saveArea ()
 Save new or updated map area. More...
 
 updateTrigger ()
 Update trigger. More...
 
 confirmDeleteTrigger ()
 Confirm trigger deletion. More...
 
 deleteTrigger ()
 Delete trigger. More...
 
 getAdditionalPageXML ()
 Get additional page xml (to be overwritten) More...
 
 outputPostProcessing (string $a_output)
 
- Public Member Functions inherited from ilPCImageMapEditorGUI
 __construct ( $a_content_obj, ilPageObject $a_page, EditGUIRequest $request)
 
 getParentNodeName ()
 
 getImageMapTableHTML ()
 
 saveArea ()
 Save new or updated map area. More...
 
 deleteAreas ()
 Delete map areas. More...
 
 getLinkTypeOfArea (int $a_nr)
 Get Link Type of Area. More...
 
 getTypeOfArea (int $a_nr)
 Get Type of Area (only internal link) More...
 
 getTargetOfArea (int $a_nr)
 Get Target of Area (only internal link) More...
 
 getTargetFrameOfArea (int $a_nr)
 Get TargetFrame of Area (only internal link) More...
 
 getHrefOfArea (int $a_nr)
 Get Href of Area (only external link) More...
 
 updateAreas ()
 Update map areas. More...
 
 makeMapWorkCopy (string $a_edit_property="", int $a_area_nr=0, bool $a_output_new_area=false, string $a_area_type="", string $a_coords="")
 Make work file for editing. More...
 
 getAliasXML ()
 
- Public Member Functions inherited from ilImageMapEditorGUI
 __construct (ilObjMediaObject $a_media_object)
 
 executeCommand ()
 
 editMapAreas ()
 
 getToolbar ()
 
 getEditorTitle ()
 
 getImageMapTableHTML ()
 
 handleMapParameters ()
 
 showImageMap ()
 
 updateAreas ()
 
 addNewArea ()
 
 linkWholePicture ()
 
 addRectangle ()
 
 addCircle ()
 
 addPolygon ()
 
 clearSessionVars ()
 
 addArea (bool $a_handle=true)
 
 editMapArea (bool $a_get_next_coordinate=false, bool $a_output_new_area=false, bool $a_save_form=false, string $a_edit_property="", int $a_area_nr=0)
 Edit a single map area. More...
 
 initAreaEditingForm (string $a_edit_property)
 
 makeMapWorkCopy (string $a_edit_property="", int $a_area_nr=0, bool $a_output_new_area=false, string $a_area_type="", string $a_coords="")
 Make work file for editing. More...
 
 getImageMapOutput (string $a_map_edit_mode="")
 Render the image map. More...
 
 getAdditionalPageXML ()
 Get additional page xml (to be overwritten) More...
 
 outputPostProcessing (string $a_output)
 
 getAliasXML ()
 
 getMapAreaLinkString (string $a_target, string $a_type, string $a_frame)
 Get text name of internal link. More...
 
 editImagemapForward ()
 Get image map coordinates. More...
 
 saveArea ()
 Save new or updated map area. More...
 
 setInternalLink ()
 
 setLink (bool $a_handle=true)
 
 getLinkTypeOfArea (int $a_nr)
 
 getTypeOfArea (int $a_nr)
 Get Type of Area (only internal link) More...
 
 getTargetOfArea (int $a_nr)
 Get Target of Area (only internal link) More...
 
 getTargetFrameOfArea (int $a_nr)
 Get TargetFrame of Area (only internal link) More...
 
 getHrefOfArea (int $a_nr)
 Get Href of Area (only external link) More...
 
 deleteAreas ()
 Delete map areas. More...
 
 editLink ()
 Edit existing link. More...
 
 editShapeWholePicture ()
 Edit an existing shape (make it a whole picture link) More...
 
 editShapeRectangle ()
 Edit an existing shape (make it a rectangle) More...
 
 editShapeCircle ()
 Edit an existing shape (make it a circle) More...
 
 editShapePolygon ()
 Edit an existing shape (make it a polygon) More...
 
 setShape (bool $a_handle=true)
 edit shape of existing map area More...
 
 setHighlight ()
 Set highlight settings. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilImageMapEditorGUI
static _recoverParameters ()
 Recover parameters from session variables (static) More...
 
- Protected Attributes inherited from ilPCImageMapEditorGUI
MapEditorSessionRepository $map_repo
 
ilMediaAliasItem $std_alias_item
 
ilPageObject $page
 
 $content_obj
 
EditGUIRequest $edit_request
 
- Protected Attributes inherited from ilImageMapEditorGUI
ilObjMediaObject $media_object
 
ImageMapGUIRequest $request
 
ImageMapManager $map
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilToolbarGUI $toolbar
 

Detailed Description

User interface class for page content map editor.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilPCIIMTriggerEditorGUI: ilInternalLinkGUI

Definition at line 27 of file class.ilPCIIMTriggerEditorGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCIIMTriggerEditorGUI::__construct ( ilPCInteractiveImage  $a_content_obj,
ilPageObject  $a_page,
EditGUIRequest  $request 
)

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

33 {
35 parent::__construct($a_content_obj, $a_page, $request);
36
37 $this->main_tpl->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
38 $this->main_tpl->addJavaScript("./Services/COPage/js/ilCOPagePCInteractiveImage.js");
39
42 }
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilImageMapEditorGUI\$request, ILIAS\GlobalScreen\Provider\__construct(), ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), and iljQueryUtil\initjQueryUI().

+ Here is the call graph for this function:

Member Function Documentation

◆ addNewArea()

ilPCIIMTriggerEditorGUI::addNewArea ( )

Reimplemented from ilImageMapEditorGUI.

Definition at line 107 of file class.ilPCIIMTriggerEditorGUI.php.

107 : string
108 {
109 $ilCtrl = $this->ctrl;
111
112 if ($this->edit_request->getString("shape") == "Marker") {
113 $this->content_obj->addTriggerMarker();
114 $this->page->update();
115 $this->main_tpl->setOnScreenMessage('success', $lng->txt("cont_saved_map_data"), true);
116 $ilCtrl->redirect($this, "editMapAreas");
117 } else {
118 return parent::addNewArea();
119 }
120 return "";
121 }
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...

References ilImageMapEditorGUI\$ctrl, ilImageMapEditorGUI\$lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ confirmDeleteTrigger()

ilPCIIMTriggerEditorGUI::confirmDeleteTrigger ( )

Confirm trigger deletion.

Definition at line 230 of file class.ilPCIIMTriggerEditorGUI.php.

230 : void
231 {
232 $ilCtrl = $this->ctrl;
235
236 $trigger = $this->edit_request->getStringArray("tr");
237 $titles = $this->edit_request->getStringArray("title");
238
239 if (count($trigger) == 0) {
240 $this->main_tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
241 $ilCtrl->redirect($this, "editMapAreas");
242 } else {
243 $cgui = new ilConfirmationGUI();
244 $cgui->setFormAction($ilCtrl->getFormAction($this));
245 $cgui->setHeaderText($lng->txt("cont_really_delete_triggers"));
246 $cgui->setCancel($lng->txt("cancel"), "editMapAreas");
247 $cgui->setConfirm($lng->txt("delete"), "deleteTrigger");
248
249 foreach ($trigger as $i) {
250 $cgui->addItem("tr[]", $i, $titles[$i]);
251 }
252 $main_tpl->setContent($cgui->getHTML());
253 }
254 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $main_tpl
setContent(string $a_html)
Sets content for standard template.
$i
Definition: metadata.php:41

References $i, and $lng.

◆ deleteTrigger()

ilPCIIMTriggerEditorGUI::deleteTrigger ( )

Delete trigger.

Exceptions
ilDateTimeException

Definition at line 260 of file class.ilPCIIMTriggerEditorGUI.php.

260 : void
261 {
262 $ilCtrl = $this->ctrl;
264
265 $trigger = $this->edit_request->getStringArray("tr");
266
267 if (count($trigger) > 0) {
268 foreach ($trigger as $tr_nr) {
269 $this->content_obj->deleteTrigger($this->std_alias_item, $tr_nr);
270 }
271 $this->page->update();
272 $this->main_tpl->setOnScreenMessage('success', $lng->txt("cont_areas_deleted"), true);
273 }
274
275 $ilCtrl->redirect($this, "editMapAreas");
276 }

References $lng.

◆ getAdditionalPageXML()

ilPCIIMTriggerEditorGUI::getAdditionalPageXML ( )

Get additional page xml (to be overwritten)

Reimplemented from ilImageMapEditorGUI.

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

281 : string
282 {
283 return $this->page->getMultimediaXML();
284 }

◆ getEditorTitle()

ilPCIIMTriggerEditorGUI::getEditorTitle ( )

Reimplemented from ilImageMapEditorGUI.

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

49 : string
50 {
52
53 return $lng->txt("cont_pc_iim");
54 }

References ilImageMapEditorGUI\$lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getImageMapTableHTML()

ilPCIIMTriggerEditorGUI::getImageMapTableHTML ( )

Get trigger table.

Reimplemented from ilPCImageMapEditorGUI.

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

59 : string
60 {
61 $ilToolbar = $this->toolbar;
63 $ilCtrl = $this->ctrl;
64
65
66 $ilToolbar->addText($lng->txt("cont_drag_element_click_save"));
67 $ilToolbar->setId("drag_toolbar");
68 $ilToolbar->setHidden(true);
69 $ilToolbar->addButton($lng->txt("save"), "#", "", null, "", "save_pos_button");
70
71 $ilToolbar->addButton(
72 $lng->txt("cancel"),
73 $ilCtrl->getLinkTarget($this, "editMapAreas")
74 );
75
76 $image_map_table = new ilPCIIMTriggerTableGUI(
77 $this,
78 "editMapAreas",
79 $this->content_obj,
80 $this->getParentNodeName()
81 );
82 return $image_map_table->getHTML();
83 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilImageMapEditorGUI\$ctrl, ilImageMapEditorGUI\$lng, ilImageMapEditorGUI\$toolbar, getParentNodeName(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getParentNodeName()

ilPCIIMTriggerEditorGUI::getParentNodeName ( )

Reimplemented from ilPCImageMapEditorGUI.

Definition at line 44 of file class.ilPCIIMTriggerEditorGUI.php.

44 : string
45 {
46 return "InteractiveImage";
47 }

Referenced by getImageMapTableHTML().

+ Here is the caller graph for this function:

◆ getToolbar()

ilPCIIMTriggerEditorGUI::getToolbar ( )

Reimplemented from ilImageMapEditorGUI.

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

86 {
87 $ilCtrl = $this->ctrl;
89
90 // toolbar
91 $tb = new ilToolbarGUI();
92 $tb->setFormAction($ilCtrl->getFormAction($this));
93 $options = array(
94 "Rect" => $lng->txt("cont_Rect"),
95 "Circle" => $lng->txt("cont_Circle"),
96 "Poly" => $lng->txt("cont_Poly"),
97 "Marker" => $lng->txt("cont_marker")
98 );
99 $si = new ilSelectInputGUI($lng->txt("cont_trigger_area"), "shape");
100 $si->setOptions($options);
101 $tb->addInputItem($si, true);
102 $tb->addFormButton($lng->txt("add"), "addNewArea");
103
104 return $tb;
105 }
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilImageMapEditorGUI\$ctrl, ilImageMapEditorGUI\$lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ initAreaEditingForm()

ilPCIIMTriggerEditorGUI::initAreaEditingForm ( string  $a_edit_property)

Init area editing form.

Reimplemented from ilImageMapEditorGUI.

Definition at line 126 of file class.ilPCIIMTriggerEditorGUI.php.

130 $form = new ilPropertyFormGUI();
131 $form->setOpenTag(false);
132 $form->setCloseTag(false);
133
134 // name
135 if ($a_edit_property != "link" && $a_edit_property != "shape") {
136 $ti = new ilTextInputGUI($lng->txt("cont_name"), "area_name");
137 $ti->setMaxLength(200);
138 $ti->setSize(20);
139 //$ti->setRequired(true);
140 $form->addItem($ti);
141 }
142
143 // save and cancel commands
144 if ($a_edit_property == "") {
145 $form->setTitle($lng->txt("cont_new_trigger_area"));
146 } else {
147 $form->setTitle($lng->txt("cont_new_area"));
148 }
149 $form->addCommandButton("saveArea", $lng->txt("save"));
150
151 return $form;
152 }
This class represents a property form user interface.
This class represents a text property in a property form.

◆ outputPostProcessing()

ilPCIIMTriggerEditorGUI::outputPostProcessing ( string  $a_output)

Reimplemented from ilImageMapEditorGUI.

Definition at line 286 of file class.ilPCIIMTriggerEditorGUI.php.

286 : string
287 {
288
289 // for question html get the page gui object
290 $pg_gui = new ilPageObjectGUI($this->page->getParentType(), $this->page->getId());
291 $pg_gui->setOutputMode(ilPageObjectGUI::PREVIEW);
292 $pg_gui->getPageConfig()->setEnableSelfAssessment(true);
293 // $pg_gui->initSelfAssessmentRendering(true); // todo: solve in other way
294 $qhtml = $pg_gui->getQuestionHTML();
295 if (is_array($qhtml)) {
296 foreach ($qhtml as $k => $h) {
297 $a_output = str_replace($pg_gui->pl_start . "Question;il__qst_$k" . $pg_gui->pl_end, " " . $h, $a_output);
298 }
299 }
300
301 return $a_output;
302 }
Class ilPageObjectGUI.

References ilPageObjectGUI\PREVIEW.

◆ saveArea()

ilPCIIMTriggerEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilPCImageMapEditorGUI.

Definition at line 157 of file class.ilPCIIMTriggerEditorGUI.php.

157 : string
158 {
160 $ilCtrl = $this->ctrl;
161
162 switch ($this->map_repo->getMode()) {
163 // save edited shape
164 case "edit_shape":
165 $this->std_alias_item->setShape(
166 $this->map->getAreaNr(),
167 $this->map->getAreaType(),
168 $this->map->getCoords()
169 );
170 $this->page->update();
171 break;
172
173 // save new area
174 default:
175 $area_type = $this->map->getAreaType();
176 $coords = $this->map->getCoords();
177 $this->content_obj->addTriggerArea(
178 $this->std_alias_item,
179 $area_type,
180 $coords,
181 $this->edit_request->getString("area_name")
182 );
183 $this->page->update();
184 break;
185 }
186
187 //$this->initMapParameters();
188 $this->main_tpl->setOnScreenMessage('success', $lng->txt("cont_saved_map_area"), true);
189 $ilCtrl->redirect($this, "editMapAreas");
190 return "";
191 }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc

References $lng.

◆ updateTrigger()

ilPCIIMTriggerEditorGUI::updateTrigger ( )

Update trigger.

Definition at line 196 of file class.ilPCIIMTriggerEditorGUI.php.

196 : void
197 {
199 $ilCtrl = $this->ctrl;
200
201 $this->content_obj->setTriggerOverlays(
202 $this->edit_request->getStringArray("ov")
203 );
204 $this->content_obj->setTriggerPopups(
205 $this->edit_request->getStringArray("pop")
206 );
207 $this->content_obj->setTriggerOverlayPositions(
208 $this->edit_request->getStringArray("ovpos")
209 );
210 $this->content_obj->setTriggerMarkerPositions(
211 $this->edit_request->getStringArray("markpos")
212 );
213 $this->content_obj->setTriggerPopupPositions(
214 $this->edit_request->getStringArray("poppos")
215 );
216 $this->content_obj->setTriggerPopupSize(
217 $this->edit_request->getStringArray("popsize")
218 );
219 $this->content_obj->setTriggerTitles(
220 $this->edit_request->getStringArray("title")
221 );
222 $this->page->update();
223 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
224 $ilCtrl->redirect($this, "editMapAreas");
225 }

References $lng.


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