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

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

+ Inheritance diagram for ilPCImageMapEditorGUI:
+ Collaboration diagram for ilPCImageMapEditorGUI:

Public Member Functions

 __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...
 

Protected Attributes

MapEditorSessionRepository $map_repo
 
ilMediaAliasItem $std_alias_item
 
ilPageObject $page
 
ilPCInteractiveImage ilPCMediaObject $content_obj
 
EditGUIRequest $edit_request
 
- Protected Attributes inherited from ilImageMapEditorGUI
ILIAS COPage Xsl XslManager $xsl
 
ilObjMediaObject $media_object
 
ImageMapGUIRequest $request
 
ImageMapManager $map
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilToolbarGUI $toolbar
 

Additional Inherited Members

- Static Public Member Functions inherited from ilImageMapEditorGUI
static _recoverParameters ()
 Recover parameters from session variables (static) More...
 

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 ilPCImageMapEditorGUI: ilInternalLinkGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCImageMapEditorGUI::__construct (   $a_content_obj,
ilPageObject  $a_page,
EditGUIRequest  $request 
)
Parameters
ilPCMediaObject | ilPCInteractiveImage$a_content_obj

Definition at line 39 of file class.ilPCImageMapEditorGUI.php.

43 {
44 global $DIC;
45
46 $this->content_obj = $a_content_obj;
47 $this->page = $a_page;
48 $this->edit_request = $request;
49 parent::__construct($a_content_obj->getMediaObject());
50
51 $this->std_alias_item = new ilMediaAliasItem(
52 $this->content_obj->getDomDoc(),
53 $this->content_obj->hier_id,
54 "Standard",
55 $this->content_obj->getPCId(),
56 $this->getParentNodeName()
57 );
58 $this->map_repo = $DIC
59 ->copage()
60 ->internal()
61 ->repo()
62 ->pc()
63 ->mediaMap();
64 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilImageMapEditorGUI\$request, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteAreas()

ilPCImageMapEditorGUI::deleteAreas ( )

Delete map areas.

Reimplemented from ilImageMapEditorGUI.

Definition at line 179 of file class.ilPCImageMapEditorGUI.php.

179 : void
180 {
181 $ilCtrl = $this->ctrl;
183
184 $areas = $this->edit_request->getStringArray("area");
185 if (count($areas) == 0) {
186 $this->main_tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
187 $ilCtrl->redirect($this, "editMapAreas");
188 }
189
190 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
191 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
192
193 $i = 0;
194 arsort($areas);
195 foreach ($areas as $area_nr) {
196 $this->std_alias_item->deleteMapArea($area_nr);
197 }
198 $this->page->update();
199 $this->main_tpl->setOnScreenMessage('success', $lng->txt("cont_areas_deleted"), true);
200
201 $ilCtrl->redirect($this, "editMapAreas");
202 }
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:

◆ getAliasXML()

ilPCImageMapEditorGUI::getAliasXML ( )

Reimplemented from ilImageMapEditorGUI.

Definition at line 329 of file class.ilPCImageMapEditorGUI.php.

329 : string
330 {
331 return $this->content_obj->dumpXML();
332 }

◆ getHrefOfArea()

ilPCImageMapEditorGUI::getHrefOfArea ( int  $a_nr)

Get Href of Area (only external link)

Reimplemented from ilImageMapEditorGUI.

Definition at line 239 of file class.ilPCImageMapEditorGUI.php.

239 : string
240 {
241 return $this->std_alias_item->getHrefOfArea($a_nr);
242 }

◆ getImageMapTableHTML()

ilPCImageMapEditorGUI::getImageMapTableHTML ( )

Reimplemented from ilImageMapEditorGUI.

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

71 : string
72 {
73 $image_map_table = new ilPCImageMapTableGUI(
74 $this,
75 "editMapAreas",
76 $this->content_obj,
77 $this->getParentNodeName()
78 );
79 return $image_map_table->getHTML();
80 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References getParentNodeName().

+ Here is the call graph for this function:

◆ getLinkTypeOfArea()

ilPCImageMapEditorGUI::getLinkTypeOfArea ( int  $a_nr)

Get Link Type of Area.

Reimplemented from ilImageMapEditorGUI.

Definition at line 207 of file class.ilPCImageMapEditorGUI.php.

207 : string
208 {
209 return $this->std_alias_item->getLinkTypeOfArea($a_nr);
210 }

◆ getParentNodeName()

ilPCImageMapEditorGUI::getParentNodeName ( )

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

66 : string
67 {
68 return "MediaObject";
69 }

Referenced by getImageMapTableHTML().

+ Here is the caller graph for this function:

◆ getTargetFrameOfArea()

ilPCImageMapEditorGUI::getTargetFrameOfArea ( int  $a_nr)

Get TargetFrame of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

Definition at line 231 of file class.ilPCImageMapEditorGUI.php.

231 : string
232 {
233 return $this->std_alias_item->getTargetFrameOfArea($a_nr);
234 }

◆ getTargetOfArea()

ilPCImageMapEditorGUI::getTargetOfArea ( int  $a_nr)

Get Target of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

Definition at line 223 of file class.ilPCImageMapEditorGUI.php.

223 : string
224 {
225 return $this->std_alias_item->getTargetOfArea($a_nr);
226 }

◆ getTypeOfArea()

ilPCImageMapEditorGUI::getTypeOfArea ( int  $a_nr)

Get Type of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

Definition at line 215 of file class.ilPCImageMapEditorGUI.php.

215 : string
216 {
217 return $this->std_alias_item->getTypeOfArea($a_nr);
218 }

◆ makeMapWorkCopy()

ilPCImageMapEditorGUI::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.

Reimplemented from ilImageMapEditorGUI.

Definition at line 285 of file class.ilPCImageMapEditorGUI.php.

291 : ilMediaItem {
292 // old for pc media object
293 // $media_object = $this->media_object->getMediaItem("Standard");
294 $media_object = $this->content_obj->getMediaObject();
295
296 // create/update imagemap work copy
297 $st_item = $media_object->getMediaItem("Standard");
298 $st_alias_item = new ilMediaAliasItem(
299 $this->content_obj->getDomDoc(),
300 $this->content_obj->hier_id,
301 "Standard",
302 $this->content_obj->getPCId(),
303 $this->getParentNodeName()
304 );
305
306 if ($a_edit_property == "shape") {
307 $st_alias_item->makeMapWorkCopy(
308 $st_item,
309 $a_area_nr,
310 true,
311 $a_output_new_area,
312 $a_area_type,
313 $a_coords
314 ); // exclude area currently being edited
315 } else {
316 $st_alias_item->makeMapWorkCopy(
317 $st_item,
318 $a_area_nr,
319 false,
320 $a_output_new_area,
321 $a_area_type,
322 $a_coords
323 );
324 }
325
326 return $st_item;
327 }
Class ilMediaItem Media Item, component of a media object (file or reference)
getMediaItem(string $a_purpose)
get item for media purpose

◆ saveArea()

ilPCImageMapEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilImageMapEditorGUI.

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

85 : string
86 {
88 $ilCtrl = $this->ctrl;
89
90 switch ($this->map->getMode()) {
91 // save edited link
92 case "edit_link":
93 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
94 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
95
96 $area_link_type = $this->edit_request->getString("area_link_type");
97 if ($area_link_type == IL_INT_LINK) {
98 $int_link = $this->map->getInternalLink();
99 $this->std_alias_item->setAreaIntLink(
100 $this->map->getAreaNr(),
101 $int_link["type"],
102 $int_link["target"],
103 $int_link["target_frame"]
104 );
105 } elseif ($area_link_type == IL_NO_LINK) {
106 $this->std_alias_item->setAreaExtLink(
107 $this->map->getAreaNr(),
108 ""
109 );
110 } else {
111 $this->std_alias_item->setAreaExtLink(
112 $this->map->getAreaNr(),
113 $this->edit_request->getString("area_link_ext")
114 );
115 }
116 $this->page->update();
117 break;
118
119 // save edited shape
120 case "edit_shape":
121 $this->std_alias_item->setShape(
122 $this->map->getAreaNr(),
123 $this->map->getAreaType(),
124 $this->map->getCoords()
125 );
126 $this->page->update();
127 break;
128
129 // save new area
130 default:
131 $area_type = $this->map->getAreaType();
132 $coords = $this->map->getCoords();
133 $link = [];
134 $area_link_type = $this->edit_request->getString("area_link_type");
135 switch ($area_link_type) {
136 case IL_EXT_LINK:
137 $link = array(
138 "LinkType" => IL_EXT_LINK,
139 "Href" => $this->edit_request->getString("area_link_ext"));
140 break;
141
142 case IL_NO_LINK:
143 $link = array(
144 "LinkType" => IL_EXT_LINK,
145 "Href" => "");
146 break;
147
148 case IL_INT_LINK:
149 $int_link = $this->map->getInternalLink();
150 $link = array(
151 "LinkType" => IL_INT_LINK,
152 "Type" => $int_link["type"],
153 "Target" => $int_link["target"],
154 "TargetFrame" => $int_link["target_frame"]);
155 break;
156 }
157
158 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
159 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
160 $this->std_alias_item->addMapArea(
161 $area_type,
162 $coords,
163 $this->edit_request->getString("area_name"),
164 $link
165 );
166 $this->page->update();
167 break;
168 }
169
170 //$this->initMapParameters();
171 $this->main_tpl->setOnScreenMessage('success', $lng->txt("cont_saved_map_area"), true);
172 $ilCtrl->redirect($this, "editMapAreas");
173 return "";
174 }
const IL_INT_LINK
const IL_EXT_LINK
const IL_NO_LINK

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

+ Here is the call graph for this function:

◆ updateAreas()

ilPCImageMapEditorGUI::updateAreas ( )

Update map areas.

Reimplemented from ilImageMapEditorGUI.

Definition at line 247 of file class.ilPCImageMapEditorGUI.php.

247 : void
248 {
250 $ilCtrl = $this->ctrl;
251
252 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
253 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
254 $areas = $this->std_alias_item->getMapAreas();
255 foreach ($areas as $area) {
256 // fix #26032 empty values lead to "empty text node" errors on page update
257 $name = $this->edit_request->getString("name_" . $area["Nr"]);
258 $hl_mode = $this->edit_request->getString("hl_mode_" . $area["Nr"]);
259 $hl_class = $this->edit_request->getString("hl_class_" . $area["Nr"]);
260 if ($name == "") {
261 $name = " ";
262 }
263 $this->std_alias_item->setAreaTitle(
264 $area["Nr"],
265 $name
266 );
267 $this->std_alias_item->setAreaHighlightMode(
268 $area["Nr"],
269 $hl_mode
270 );
271 $this->std_alias_item->setAreaHighlightClass(
272 $area["Nr"],
273 $hl_class
274 );
275 }
276 $this->page->update();
277
278 $this->main_tpl->setOnScreenMessage('success', $lng->txt("cont_saved_map_data"), true);
279 $ilCtrl->redirect($this, "editMapAreas");
280 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

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

+ Here is the call graph for this function:

Field Documentation

◆ $content_obj

ilPCInteractiveImage ilPCMediaObject ilPCImageMapEditorGUI::$content_obj
protected

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

◆ $edit_request

EditGUIRequest ilPCImageMapEditorGUI::$edit_request
protected

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

◆ $map_repo

MapEditorSessionRepository ilPCImageMapEditorGUI::$map_repo
protected

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

◆ $page

ilPageObject ilPCImageMapEditorGUI::$page
protected

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

◆ $std_alias_item

ilMediaAliasItem ilPCImageMapEditorGUI::$std_alias_item
protected

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


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