ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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
 
 $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 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 42 of file class.ilPCImageMapEditorGUI.php.

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

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

Member Function Documentation

◆ deleteAreas()

ilPCImageMapEditorGUI::deleteAreas ( )

Delete map areas.

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

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

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

◆ getAliasXML()

ilPCImageMapEditorGUI::getAliasXML ( )

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

332  : string
333  {
334  return $this->content_obj->dumpXML();
335  }

◆ getHrefOfArea()

ilPCImageMapEditorGUI::getHrefOfArea ( int  $a_nr)

Get Href of Area (only external link)

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

242  : string
243  {
244  return $this->std_alias_item->getHrefOfArea($a_nr);
245  }

◆ getImageMapTableHTML()

ilPCImageMapEditorGUI::getImageMapTableHTML ( )

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

References getParentNodeName().

74  : string
75  {
76  $image_map_table = new ilPCImageMapTableGUI(
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...
+ Here is the call graph for this function:

◆ getLinkTypeOfArea()

ilPCImageMapEditorGUI::getLinkTypeOfArea ( int  $a_nr)

Get Link Type of Area.

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

210  : string
211  {
212  return $this->std_alias_item->getLinkTypeOfArea($a_nr);
213  }

◆ getParentNodeName()

ilPCImageMapEditorGUI::getParentNodeName ( )

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

Referenced by __construct(), getImageMapTableHTML(), and makeMapWorkCopy().

69  : string
70  {
71  return "MediaObject";
72  }
+ Here is the caller graph for this function:

◆ getTargetFrameOfArea()

ilPCImageMapEditorGUI::getTargetFrameOfArea ( int  $a_nr)

Get TargetFrame of Area (only internal link)

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

234  : string
235  {
236  return $this->std_alias_item->getTargetFrameOfArea($a_nr);
237  }

◆ getTargetOfArea()

ilPCImageMapEditorGUI::getTargetOfArea ( int  $a_nr)

Get Target of Area (only internal link)

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

226  : string
227  {
228  return $this->std_alias_item->getTargetOfArea($a_nr);
229  }

◆ getTypeOfArea()

ilPCImageMapEditorGUI::getTypeOfArea ( int  $a_nr)

Get Type of Area (only internal link)

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

218  : string
219  {
220  return $this->std_alias_item->getTypeOfArea($a_nr);
221  }

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

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

References ilImageMapEditorGUI\$media_object, ilObjMediaObject\getMediaItem(), getParentNodeName(), and ilMediaAliasItem\makeMapWorkCopy().

294  : ilMediaItem {
295  // old for pc media object
296  // $media_object = $this->media_object->getMediaItem("Standard");
297  $media_object = $this->content_obj->getMediaObject();
298 
299  // create/update imagemap work copy
300  $st_item = $media_object->getMediaItem("Standard");
301  $st_alias_item = new ilMediaAliasItem(
302  $this->content_obj->getDomDoc(),
303  $this->content_obj->hier_id,
304  "Standard",
305  $this->content_obj->getPCId(),
306  $this->getParentNodeName()
307  );
308 
309  if ($a_edit_property == "shape") {
310  $st_alias_item->makeMapWorkCopy(
311  $st_item,
312  $a_area_nr,
313  true,
314  $a_output_new_area,
315  $a_area_type,
316  $a_coords
317  ); // exclude area currently being edited
318  } else {
319  $st_alias_item->makeMapWorkCopy(
320  $st_item,
321  $a_area_nr,
322  false,
323  $a_output_new_area,
324  $a_area_type,
325  $a_coords
326  );
327  }
328 
329  return $st_item;
330  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
makeMapWorkCopy(ilMediaItem $a_st_item, int $a_area_nr, bool $a_exclude, bool $a_output_new_area, string $a_area_type, string $a_coords)
make map work copy of image
getMediaItem(string $a_purpose)
get item for media purpose
Class ilMediaItem Media Item, component of a media object (file or reference)
+ Here is the call graph for this function:

◆ saveArea()

ilPCImageMapEditorGUI::saveArea ( )

Save new or updated map area.

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

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

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

◆ updateAreas()

ilPCImageMapEditorGUI::updateAreas ( )

Update map areas.

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

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

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

Field Documentation

◆ $content_obj

ilPCImageMapEditorGUI::$content_obj
protected

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

◆ $edit_request

EditGUIRequest ilPCImageMapEditorGUI::$edit_request
protected

Definition at line 37 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: