ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $a_page)
 Constructor. More...
 
 getParentNodeName ()
 Get parent node name. More...
 
 getImageMapTableHTML ()
 Get table HTML. More...
 
 saveArea ()
 Save new or updated map area. More...
 
 deleteAreas ()
 Delete map areas. More...
 
 getLinkTypeOfArea ($a_nr)
 Get Link Type of Area. More...
 
 getTypeOfArea ($a_nr)
 Get Type of Area (only internal link) More...
 
 getTargetOfArea ($a_nr)
 Get Target of Area (only internal link) More...
 
 getTargetFrameOfArea ($a_nr)
 Get TargetFrame of Area (only internal link) More...
 
 getHrefOfArea ($a_nr)
 Get Href of Area (only external link) More...
 
 updateAreas ()
 Update map areas. More...
 
 makeMapWorkCopy ( $a_edit_property="", $a_area_nr=0, $a_output_new_area=false, $a_area_type="", $a_coords="")
 Make work file for editing. More...
 
 getAliasXML ()
 
- Public Member Functions inherited from ilImageMapEditorGUI
 __construct ($a_media_object)
 Constructor. More...
 
 executeCommand ()
 Execute current command. More...
 
 editMapAreas ()
 Show map areas. More...
 
 getToolbar ()
 Get toolbar. More...
 
 getEditorTitle ()
 Get editor title. More...
 
 getImageMapTableHTML ()
 Get table HTML. More...
 
 handleMapParameters ()
 handle parameter during map area editing (storing to session) More...
 
 showImageMap ()
 show image map More...
 
 updateAreas ()
 Update map areas. More...
 
 addNewArea ()
 Add area. More...
 
 linkWholePicture ()
 Link the whole picture. More...
 
 addRectangle ()
 Add a new rectangle. More...
 
 addCircle ()
 Add a new circle. More...
 
 addPolygon ()
 Add a new polygon. More...
 
 clearSessionVars ()
 Clear Session Vars. More...
 
 addArea ($a_handle=true)
 Handle adding new area process. More...
 
 editMapArea ( $a_get_next_coordinate=false, $a_output_new_area=false, $a_save_form=false, $a_edit_property="", $a_area_nr=0)
 Edit a single map area. More...
 
 initAreaEditingForm ($a_edit_property)
 Init area editing form. More...
 
 makeMapWorkCopy ( $a_edit_property="", $a_area_nr=0, $a_output_new_area=false, $a_area_type="", $a_coords="")
 Make work file for editing. More...
 
 getImageMapOutput ($a_map_edit_mode="")
 Render the image map. More...
 
 getAdditionalPageXML ()
 Get additional page xml (to be overwritten) More...
 
 outputPostProcessing ($a_output)
 Output post processing. More...
 
 getAliasXML ()
 
 getMapAreaLinkString ($a_target, $a_type, $a_frame)
 Get text name of internal link. More...
 
 editImagemapForward ()
 Get image map coordinates. More...
 
 saveArea ()
 Save new or updated map area. More...
 
 setInternalLink ()
 Set internal link. More...
 
 setLink ($a_handle=true)
 Set link. More...
 
 getLinkTypeOfArea ($a_nr)
 Get Link Type of Area. More...
 
 getTypeOfArea ($a_nr)
 Get Type of Area (only internal link) More...
 
 getTargetOfArea ($a_nr)
 Get Target of Area (only internal link) More...
 
 getTargetFrameOfArea ($a_nr)
 Get TargetFrame of Area (only internal link) More...
 
 getHrefOfArea ($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 ($a_handle=true)
 edit shape of existing map area More...
 
 setHighlight ()
 Set highlight settings. More...
 

Protected Attributes

 $lng
 
 $ctrl
 
- Protected Attributes inherited from ilImageMapEditorGUI
 $ctrl
 
 $tpl
 
 $lng
 
 $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
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilPCImageMapEditorGUI: ilInternalLinkGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCImageMapEditorGUI::__construct (   $a_content_obj,
  $a_page 
)

Constructor.

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

References $DIC, and getParentNodeName().

33  {
34  global $DIC;
35 
36  $this->lng = $DIC->language();
37  $this->ctrl = $DIC->ctrl();
38  $this->content_obj = $a_content_obj;
39  $this->page = $a_page;
40  parent::__construct($a_content_obj->getMediaObject());
41 
42  $this->std_alias_item = new ilMediaAliasItem(
43  $this->content_obj->dom,
44  $this->content_obj->hier_id,
45  "Standard",
46  $this->content_obj->getPcId(),
47  $this->getParentNodeName()
48  );
49  }
global $DIC
Definition: saml.php:7
Class ilMediaAliasItem.
getParentNodeName()
Get parent node name.
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteAreas()

ilPCImageMapEditorGUI::deleteAreas ( )

Delete map areas.

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

References $_POST, $ctrl, $i, $ilCtrl, $lng, ilUtil\sendFailure(), and ilUtil\sendSuccess().

172  {
174  $lng = $this->lng;
175 
176  if (!isset($_POST["area"])) {
177  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
178  $ilCtrl->redirect($this, "editMapAreas");
179  }
180 
181  // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
182  // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
183 
184  if (count($_POST["area"]) > 0) {
185  $i = 0;
186  arsort($_POST["area"]);
187  foreach ($_POST["area"] as $area_nr) {
188  $this->std_alias_item->deleteMapArea($area_nr);
189  }
190  $this->updated = $this->page->update();
191  ilUtil::sendSuccess($lng->txt("cont_areas_deleted"), true);
192  }
193 
194  $ilCtrl->redirect($this, "editMapAreas");
195  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$i
Definition: disco.tpl.php:19
$_POST["username"]
+ Here is the call graph for this function:

◆ getAliasXML()

ilPCImageMapEditorGUI::getAliasXML ( )

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

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

◆ getHrefOfArea()

ilPCImageMapEditorGUI::getHrefOfArea (   $a_nr)

Get Href of Area (only external link)

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

241  {
242  // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
243  // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
244  return $this->std_alias_item->getHrefOfArea($a_nr);
245  }

◆ getImageMapTableHTML()

ilPCImageMapEditorGUI::getImageMapTableHTML ( )

Get table HTML.

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

References getParentNodeName().

65  {
66  include_once("./Services/COPage/classes/class.ilPCImageMapTableGUI.php");
67  $image_map_table = new ilPCImageMapTableGUI(
68  $this,
69  "editMapAreas",
70  $this->content_obj,
71  $this->getParentNodeName()
72  );
73  return $image_map_table->getHTML();
74  }
getParentNodeName()
Get parent node name.
TableGUI class for pc image map editor.
+ Here is the call graph for this function:

◆ getLinkTypeOfArea()

ilPCImageMapEditorGUI::getLinkTypeOfArea (   $a_nr)

Get Link Type of Area.

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

201  {
202  // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
203  // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
204  return $this->std_alias_item->getLinkTypeOfArea($a_nr);
205  }

◆ getParentNodeName()

ilPCImageMapEditorGUI::getParentNodeName ( )

Get parent node name.

Returns
string name of parent node

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

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

57  {
58  return "MediaObject";
59  }
+ Here is the caller graph for this function:

◆ getTargetFrameOfArea()

ilPCImageMapEditorGUI::getTargetFrameOfArea (   $a_nr)

Get TargetFrame of Area (only internal link)

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

231  {
232  // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
233  // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
234  return $this->std_alias_item->getTargetFrameOfArea($a_nr);
235  }

◆ getTargetOfArea()

ilPCImageMapEditorGUI::getTargetOfArea (   $a_nr)

Get Target of Area (only internal link)

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

221  {
222  // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
223  // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
224  return $this->std_alias_item->getTargetOfArea($a_nr);
225  }

◆ getTypeOfArea()

ilPCImageMapEditorGUI::getTypeOfArea (   $a_nr)

Get Type of Area (only internal link)

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

211  {
212  // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
213  // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
214  return $this->std_alias_item->getTypeOfArea($a_nr);
215  }

◆ makeMapWorkCopy()

ilPCImageMapEditorGUI::makeMapWorkCopy (   $a_edit_property = "",
  $a_area_nr = 0,
  $a_output_new_area = false,
  $a_area_type = "",
  $a_coords = "" 
)

Make work file for editing.

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

References getParentNodeName(), and ilMediaAliasItem\makeMapWorkCopy().

292  {
293  // old for pc media object
294  // $media_object = $this->media_object->getMediaItem("Standard");
295  $media_object = $this->content_obj->getMediaObject();
296 
297  // create/update imagemap work copy
298  $st_item = $media_object->getMediaItem("Standard");
299  $st_alias_item = new ilMediaAliasItem(
300  $this->content_obj->dom,
301  $this->content_obj->hier_id,
302  "Standard",
303  $this->content_obj->getPcId(),
304  $this->getParentNodeName()
305  );
306 
307  if ($a_edit_property == "shape") {
308  $st_alias_item->makeMapWorkCopy(
309  $st_item,
310  $a_area_nr,
311  true,
312  $a_output_new_area,
313  $a_area_type,
314  $a_coords
315  ); // exclude area currently being edited
316  } else {
317  $st_alias_item->makeMapWorkCopy(
318  $st_item,
319  $a_area_nr,
320  false,
321  $a_output_new_area,
322  $a_area_type,
323  $a_coords
324  );
325  }
326  }
makeMapWorkCopy( $a_st_item, $a_area_nr=0, $a_exclude=false, $a_output_new_area, $a_area_type, $a_coords)
make map work copy of image
Class ilMediaAliasItem.
getParentNodeName()
Get parent node name.
+ Here is the call graph for this function:

◆ saveArea()

ilPCImageMapEditorGUI::saveArea ( )

Save new or updated map area.

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

References $_POST, $_SESSION, $coords, $ctrl, $ilCtrl, $lng, array, IL_EXT_LINK, IL_INT_LINK, IL_NO_LINK, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

80  {
81  $lng = $this->lng;
83 
84  switch ($_SESSION["il_map_edit_mode"]) {
85  // save edited link
86  case "edit_link":
87 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
88 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
89 
90  if ($_POST["area_link_type"] == IL_INT_LINK) {
91  $this->std_alias_item->setAreaIntLink(
92  $_SESSION["il_map_area_nr"],
93  $_SESSION["il_map_il_type"],
94  $_SESSION["il_map_il_target"],
95  $_SESSION["il_map_il_targetframe"]
96  );
97  } elseif ($_POST["area_link_type"] == IL_NO_LINK) {
98  $this->std_alias_item->setAreaExtLink(
99  $_SESSION["il_map_area_nr"],
100  ""
101  );
102  } else {
103  $this->std_alias_item->setAreaExtLink(
104  $_SESSION["il_map_area_nr"],
105  ilUtil::stripSlashes($_POST["area_link_ext"])
106  );
107  }
108  $this->updated = $this->page->update();
109  break;
110 
111  // save edited shape
112  case "edit_shape":
113 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
114 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
115  $this->std_alias_item->setShape(
116  $_SESSION["il_map_area_nr"],
117  $_SESSION["il_map_edit_area_type"],
118  $_SESSION["il_map_edit_coords"]
119  );
120  $this->updated = $this->page->update();
121  break;
122 
123  // save new area
124  default:
125  $area_type = $_SESSION["il_map_edit_area_type"];
126  $coords = $_SESSION["il_map_edit_coords"];
127 
128  switch ($_POST["area_link_type"]) {
129  case IL_EXT_LINK:
130  $link = array(
131  "LinkType" => IL_EXT_LINK,
132  "Href" => ilUtil::stripSlashes($_POST["area_link_ext"]));
133  break;
134 
135  case IL_NO_LINK:
136  $link = array(
137  "LinkType" => IL_EXT_LINK,
138  "Href" => "");
139  break;
140 
141  case IL_INT_LINK:
142  $link = array(
143  "LinkType" => IL_INT_LINK,
144  "Type" => $_SESSION["il_map_il_type"],
145  "Target" => $_SESSION["il_map_il_target"],
146  "TargetFrame" => $_SESSION["il_map_il_targetframe"]);
147  break;
148  }
149 
150 // $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
151 // $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
152  $this->std_alias_item->addMapArea(
153  $area_type,
154  $coords,
155  ilUtil::stripSlashes($_POST["area_name"]),
156  $link
157  );
158  $this->updated = $this->page->update();
159 
160  break;
161  }
162 
163  //$this->initMapParameters();
164  ilUtil::sendSuccess($lng->txt("cont_saved_map_area"), true);
165  $ilCtrl->redirect($this, "editMapAreas");
166  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
$coords
Definition: example_030.php:88
const IL_NO_LINK
global $ilCtrl
Definition: ilias.php:18
const IL_INT_LINK
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
const IL_EXT_LINK
$_POST["username"]
+ Here is the call graph for this function:

◆ updateAreas()

ilPCImageMapEditorGUI::updateAreas ( )

Update map areas.

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

References $_POST, $ctrl, $ilCtrl, $lng, $name, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

251  {
252  $lng = $this->lng;
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 = ilUtil::stripSlashes($_POST["name_" . $area["Nr"]]);
261  if ($name == "") {
262  $name = " ";
263  }
264  $this->std_alias_item->setAreaTitle(
265  $area["Nr"],
266  $name
267  );
268  $this->std_alias_item->setAreaHighlightMode(
269  $area["Nr"],
270  ilUtil::stripSlashes($_POST["hl_mode_" . $area["Nr"]])
271  );
272  $this->std_alias_item->setAreaHighlightClass(
273  $area["Nr"],
274  ilUtil::stripSlashes($_POST["hl_class_" . $area["Nr"]])
275  );
276  }
277  $this->page->update();
278 
279  ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
280  $ilCtrl->redirect($this, "editMapAreas");
281  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:146
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilPCImageMapEditorGUI::$ctrl
protected

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

Referenced by deleteAreas(), saveArea(), and updateAreas().

◆ $lng

ilPCImageMapEditorGUI::$lng
protected

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

Referenced by deleteAreas(), saveArea(), and updateAreas().


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