ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilImageMapEditorGUI Class Reference

User interface class for map editor. More...

+ Inheritance diagram for ilImageMapEditorGUI:
+ Collaboration diagram for ilImageMapEditorGUI:

Public Member Functions

 __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...
 
 _recoverParameters ()
 Recover parameters from session variables (static) 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...
 

Detailed Description

User interface class for map editor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilImageMapEditorGUI: ilInternalLinkGUI

Definition at line 14 of file class.ilImageMapEditorGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilImageMapEditorGUI::__construct (   $a_media_object)

Constructor.

Definition at line 19 of file class.ilImageMapEditorGUI.php.

20  {
21  $this->media_object = $a_media_object;
22  }

Member Function Documentation

◆ _recoverParameters()

ilImageMapEditorGUI::_recoverParameters ( )

Recover parameters from session variables (static)

Definition at line 744 of file class.ilImageMapEditorGUI.php.

References $_GET, and $_SESSION.

Referenced by editImagemapForward(), and ilInternalLinkGUI\renderLink().

745  {
746  $_GET["ref_id"] = $_SESSION["il_map_edit_ref_id"];
747  $_GET["obj_id"] = $_SESSION["il_map_edit_obj_id"];
748  $_GET["hier_id"] = $_SESSION["il_map_edit_hier_id"];
749  $_GET["pc_id"] = $_SESSION["il_map_edit_pc_id"];
750  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ addArea()

ilImageMapEditorGUI::addArea (   $a_handle = true)

Handle adding new area process.

Definition at line 294 of file class.ilImageMapEditorGUI.php.

References $_SESSION, ilMapArea\countCoords(), editMapArea(), and handleMapParameters().

Referenced by addCircle(), addPolygon(), addRectangle(), and setInternalLink().

295  {
296 
297  // handle map parameters
298  if($a_handle)
299  {
300  $this->handleMapParameters();
301  }
302 
303  $area_type = $_SESSION["il_map_edit_area_type"];
304  $coords = $_SESSION["il_map_edit_coords"];
305  include_once("./Services/MediaObjects/classes/class.ilMapArea.php");
306  $cnt_coords = ilMapArea::countCoords($coords);
307 
308  // decide what to do next
309  switch ($area_type)
310  {
311  // Rectangle
312  case "Rect" :
313  if ($cnt_coords < 2)
314  {
315  $html = $this->editMapArea(true, false, false);
316  return $html;
317  }
318  else if ($cnt_coords == 2)
319  {
320  return $this->editMapArea(false, true, true);
321  }
322  break;
323 
324  // Circle
325  case "Circle":
326  if ($cnt_coords <= 1)
327  {
328  return $this->editMapArea(true, false, false);
329  }
330  else
331  {
332  if ($cnt_coords == 2)
333  {
334  $c = explode(",",$coords);
335  $coords = $c[0].",".$c[1].","; // determine radius
336  $coords .= round(sqrt(pow(abs($c[3]-$c[1]),2)+pow(abs($c[2]-$c[0]),2)));
337  }
338  $_SESSION["il_map_edit_coords"] = $coords;
339 
340  return $this->editMapArea(false, true, true);
341  }
342  break;
343 
344  // Polygon
345  case "Poly":
346  if ($cnt_coords < 1)
347  {
348  return $this->editMapArea(true, false, false);
349  }
350  else if ($cnt_coords < 3)
351  {
352  return $this->editMapArea(true, true, false);
353  }
354  else
355  {
356  return $this->editMapArea(true, true, true);
357  }
358  break;
359 
360  // Whole picture
361  case "WholePicture":
362  return $this->editMapArea(false, false, true);
363  break;
364  }
365  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
handleMapParameters()
handle parameter during map area editing (storing to session)
countCoords($c)
count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,x3,y3,...")
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addCircle()

ilImageMapEditorGUI::addCircle ( )

Add a new circle.

Definition at line 258 of file class.ilImageMapEditorGUI.php.

References $_SESSION, addArea(), and clearSessionVars().

Referenced by addNewArea().

259  {
260  $this->clearSessionVars();
261  $_SESSION["il_map_edit_area_type"] = "Circle";
262  return $this->addArea(false);
263  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
addArea($a_handle=true)
Handle adding new area process.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNewArea()

ilImageMapEditorGUI::addNewArea ( )

Add area.

Definition at line 222 of file class.ilImageMapEditorGUI.php.

References $_POST, addCircle(), addPolygon(), addRectangle(), and linkWholePicture().

223  {
224  switch ($_POST["shape"])
225  {
226  case "WholePicture": return $this->linkWholePicture();
227  case "Rect": return $this->addRectangle();
228  case "Circle": return $this->addCircle();
229  case "Poly": return $this->addPolygon();
230  }
231  }
addPolygon()
Add a new polygon.
$_POST['username']
Definition: cron.php:12
linkWholePicture()
Link the whole picture.
addRectangle()
Add a new rectangle.
+ Here is the call graph for this function:

◆ addPolygon()

ilImageMapEditorGUI::addPolygon ( )

Add a new polygon.

Definition at line 268 of file class.ilImageMapEditorGUI.php.

References $_SESSION, addArea(), and clearSessionVars().

Referenced by addNewArea().

269  {
270  $this->clearSessionVars();
271  $_SESSION["il_map_edit_area_type"] = "Poly";
272  return $this->addArea(false);
273  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
addArea($a_handle=true)
Handle adding new area process.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addRectangle()

ilImageMapEditorGUI::addRectangle ( )

Add a new rectangle.

Definition at line 248 of file class.ilImageMapEditorGUI.php.

References $_SESSION, addArea(), and clearSessionVars().

Referenced by addNewArea().

249  {
250  $this->clearSessionVars();
251  $_SESSION["il_map_edit_area_type"] = "Rect";
252  return $this->addArea(false);
253  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
addArea($a_handle=true)
Handle adding new area process.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearSessionVars()

ilImageMapEditorGUI::clearSessionVars ( )

Clear Session Vars.

Definition at line 278 of file class.ilImageMapEditorGUI.php.

References $_SESSION.

Referenced by addCircle(), addPolygon(), addRectangle(), editShapeCircle(), editShapePolygon(), editShapeRectangle(), editShapeWholePicture(), and linkWholePicture().

279  {
280  $_SESSION["il_map_area_nr"] = "";
281  $_SESSION["il_map_edit_coords"] = "";
282  $_SESSION["il_map_edit_mode"] = "";
283  $_SESSION["il_map_el_href"] = "";
284  $_SESSION["il_map_il_type"] = "";
285  $_SESSION["il_map_il_ltype"] = "";
286  $_SESSION["il_map_il_target"] = "";
287  $_SESSION["il_map_il_targetframe"] = "";
288  $_SESSION["il_map_edit_area_type"] = "";
289  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ deleteAreas()

ilImageMapEditorGUI::deleteAreas ( )

Delete map areas.

Definition at line 966 of file class.ilImageMapEditorGUI.php.

References $_POST, $ilCtrl, $lng, ilMapArea\_getMaxNr(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

967  {
968  global $ilCtrl, $lng;
969 
970  if (!isset($_POST["area"]))
971  {
972  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
973  $ilCtrl->redirect($this, "editMapAreas");
974  }
975 
976  $st_item = $this->media_object->getMediaItem("Standard");
977  $max = ilMapArea::_getMaxNr($st_item->getId());
978 
979  if (count($_POST["area"]) > 0)
980  {
981  $i = 0;
982 
983  foreach ($_POST["area"] as $area_nr)
984  {
985  $st_item->deleteMapArea($area_nr - $i);
986  $i++;
987  }
988 
989  $this->media_object->update();
990  ilUtil::sendSuccess($lng->txt("cont_areas_deleted"), true);
991  }
992 
993  $ilCtrl->redirect($this, "editMapAreas");
994  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
_getMaxNr($a_item_id)
get maximum nr of media item (static)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ editImagemapForward()

ilImageMapEditorGUI::editImagemapForward ( )

Get image map coordinates.

Definition at line 725 of file class.ilImageMapEditorGUI.php.

References $_POST, $_SESSION, _recoverParameters(), and ilUtil\redirect().

726  {
728 
729  if ($_SESSION["il_map_edit_coords"] != "")
730  {
731  $_SESSION["il_map_edit_coords"] .= ",";
732  }
733 
734  $_SESSION["il_map_edit_coords"] .= $_POST["editImagemapForward_x"].",".
735  $_POST["editImagemapForward_y"];
736 
737  // call editing script
738  ilUtil::redirect($_SESSION["il_map_edit_target_script"]);
739  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
_recoverParameters()
Recover parameters from session variables (static)
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ editLink()

ilImageMapEditorGUI::editLink ( )

Edit existing link.

Definition at line 999 of file class.ilImageMapEditorGUI.php.

References $_SESSION, and setLink().

1000  {
1001  $_SESSION["il_map_edit_coords"] = "";
1002  $_SESSION["il_map_edit_mode"] = "";
1003  $_SESSION["il_map_el_href"] = "";
1004  $_SESSION["il_map_il_type"] = "";
1005  $_SESSION["il_map_il_ltype"] = "";
1006  $_SESSION["il_map_il_target"] = "";
1007  $_SESSION["il_map_il_targetframe"] = "";
1008  $_SESSION["il_map_area_nr"] = "";
1009  return $this->setLink(false);
1010  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setLink($a_handle=true)
Set link.
+ Here is the call graph for this function:

◆ editMapArea()

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

Parameters
boolean$a_get_next_coordinateenable next coordinate input
boolean$a_output_new_areaoutput the new area
boolean$a_save_fromoutput save form
string$a_edit_property"" | "link" | "shape"

Definition at line 375 of file class.ilImageMapEditorGUI.php.

References $_SESSION, $ilCtrl, $lng, $tpl, ilMapArea\countCoords(), getImageMapOutput(), ilInternalLinkGUI\getInitHTML(), initAreaEditingForm(), makeMapWorkCopy(), and ilUtil\sendInfo().

Referenced by addArea(), linkWholePicture(), setLink(), and setShape().

377  {
378  global $ilCtrl, $lng, $tpl;
379 
380  $area_type = $_SESSION["il_map_edit_area_type"];
381  $coords = $_SESSION["il_map_edit_coords"];
382  include_once("./Services/MediaObjects/classes/class.ilMapArea.php");
383  $cnt_coords = ilMapArea::countCoords($coords);
384 
385  $this->tpl = new ilTemplate("tpl.map_edit.html", true, true, "Services/MediaObjects");
386 
387  $this->tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
388 
389  if ($a_edit_property != "link")
390  {
391  switch ($area_type)
392  {
393  // rectangle
394  case "Rect" :
395  if ($cnt_coords == 0)
396  {
397  ilUtil::sendInfo($lng->txt("cont_click_tl_corner"));
398  }
399  if ($cnt_coords == 1)
400  {
401  ilUtil::sendInfo($lng->txt("cont_click_br_corner"));
402  }
403  break;
404 
405  // circle
406  case "Circle" :
407  if ($cnt_coords == 0)
408  {
409  ilUtil::sendInfo($lng->txt("cont_click_center"));
410  }
411  if ($cnt_coords == 1)
412  {
413  ilUtil::sendInfo($lng->txt("cont_click_circle"));
414  }
415  break;
416 
417  // polygon
418  case "Poly" :
419  if ($cnt_coords == 0)
420  {
421  ilUtil::sendInfo($lng->txt("cont_click_starting_point"));
422  }
423  else if ($cnt_coords < 3)
424  {
425  ilUtil::sendInfo($lng->txt("cont_click_next_point"));
426  }
427  else
428  {
429  ilUtil::sendInfo($lng->txt("cont_click_next_or_save"));
430  }
431  break;
432  }
433  }
434 
435 
436  // map properties input fields (name and link)
437  if ($a_save_form)
438  {
439  if ($a_edit_property != "shape")
440  {
441  // prepare link gui
442  $ilCtrl->setParameter($this, "linkmode", "map");
443  include_once("./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
444  $this->tpl->setCurrentBlock("int_link_prep");
445  $this->tpl->setVariable("INT_LINK_PREP", ilInternalLinkGUI::getInitHTML(
446  $ilCtrl->getLinkTargetByClass("ilinternallinkgui",
447  "", false, true, false)));
448  $this->tpl->parseCurrentBlock();
449  }
450  $form = $this->initAreaEditingForm($a_edit_property);
451  $this->tpl->setVariable("FORM", $form->getHTML());
452  }
453 
454  $this->makeMapWorkCopy($a_edit_property, $a_area_nr,
455  $a_output_new_area, $area_type, $coords);
456 
457  $edit_mode = ($a_get_next_coordinate)
458  ? "get_coords"
459  : (($a_output_new_area)
460  ? "new_area"
461  :"");
462  $output = $this->getImageMapOutput($edit_mode);
463  $this->tpl->setVariable("IMAGE_MAP", $output);
464 
465  return $this->tpl->get();
466  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getImageMapOutput($a_map_edit_mode="")
Render the image map.
initAreaEditingForm($a_edit_property)
Init area editing form.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
countCoords($c)
count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,x3,y3,...")
global $lng
Definition: privfeed.php:40
makeMapWorkCopy($a_edit_property="", $a_area_nr=0, $a_output_new_area=false, $a_area_type="", $a_coords="")
Make work file for editing.
getInitHTML($a_url, $a_move_to_body=false)
Get initialisation HTML to use interna link editing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editMapAreas()

ilImageMapEditorGUI::editMapAreas ( )

Show map areas.

Definition at line 67 of file class.ilImageMapEditorGUI.php.

References $_SESSION, $ilCtrl, $lng, getImageMapOutput(), getImageMapTableHTML(), getToolbar(), handleMapParameters(), and makeMapWorkCopy().

68  {
69  global $ilCtrl, $lng, $ilToolbar;
70 
71  $_SESSION["il_map_edit_target_script"] = $ilCtrl->getLinkTarget($this, "addArea",
72  "", false, false);
73  $this->handleMapParameters();
74 
75  $this->tpl = new ilTemplate("tpl.map_edit.html", true, true, "Services/MediaObjects");
76  $this->tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
77 
78  // create/update imagemap work copy
79  $this->makeMapWorkCopy();
80 
81  $output = $this->getImageMapOutput();
82  $this->tpl->setVariable("IMAGE_MAP", $output);
83 
84  $this->tpl->setVariable("TOOLBAR", $this->getToolbar()->getHTML());
85 
86  // table
87  $this->tpl->setVariable("MAP_AREA_TABLE", $this->getImageMapTableHTML());
88 
89  return $this->tpl->get();
90  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getImageMapOutput($a_map_edit_mode="")
Render the image map.
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
handleMapParameters()
handle parameter during map area editing (storing to session)
global $lng
Definition: privfeed.php:40
makeMapWorkCopy($a_edit_property="", $a_area_nr=0, $a_output_new_area=false, $a_area_type="", $a_coords="")
Make work file for editing.
getImageMapTableHTML()
Get table HTML.
+ Here is the call graph for this function:

◆ editShapeCircle()

ilImageMapEditorGUI::editShapeCircle ( )

Edit an existing shape (make it a circle)

Definition at line 1035 of file class.ilImageMapEditorGUI.php.

References $_SESSION, clearSessionVars(), and setShape().

1036  {
1037  $this->clearSessionVars();
1038  $_SESSION["il_map_edit_area_type"] = "Circle";
1039  return $this->setShape(false);
1040  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
setShape($a_handle=true)
edit shape of existing map area
+ Here is the call graph for this function:

◆ editShapePolygon()

ilImageMapEditorGUI::editShapePolygon ( )

Edit an existing shape (make it a polygon)

Definition at line 1045 of file class.ilImageMapEditorGUI.php.

References $_SESSION, clearSessionVars(), and setShape().

1046  {
1047  $this->clearSessionVars();
1048  $_SESSION["il_map_edit_area_type"] = "Poly";
1049  return $this->setShape(false);
1050  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
setShape($a_handle=true)
edit shape of existing map area
+ Here is the call graph for this function:

◆ editShapeRectangle()

ilImageMapEditorGUI::editShapeRectangle ( )

Edit an existing shape (make it a rectangle)

Definition at line 1025 of file class.ilImageMapEditorGUI.php.

References $_SESSION, clearSessionVars(), and setShape().

1026  {
1027  $this->clearSessionVars();
1028  $_SESSION["il_map_edit_area_type"] = "Rect";
1029  return $this->setShape(false);
1030  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
setShape($a_handle=true)
edit shape of existing map area
+ Here is the call graph for this function:

◆ editShapeWholePicture()

ilImageMapEditorGUI::editShapeWholePicture ( )

Edit an existing shape (make it a whole picture link)

Definition at line 1015 of file class.ilImageMapEditorGUI.php.

References $_SESSION, clearSessionVars(), and setShape().

1016  {
1017  $this->clearSessionVars();
1018  $_SESSION["il_map_edit_area_type"] = "WholePicture";
1019  return $this->setShape(false);
1020  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
setShape($a_handle=true)
edit shape of existing map area
+ Here is the call graph for this function:

◆ executeCommand()

ilImageMapEditorGUI::executeCommand ( )

Execute current command.

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

References $_POST, $cmd, $ilCtrl, $ret, $tpl, and ilObjMediaObjectGUI\includePresentationJS().

28  {
29  global $ilCtrl, $tpl;
30 
31  $next_class = $ilCtrl->getNextClass($this);
32  $cmd = $ilCtrl->getCmd();
33 
34  switch($next_class)
35  {
36  case "ilinternallinkgui":
37  require_once("./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
38  $link_gui = new ilInternalLinkGUI("Media_Media", 0);
39  $link_gui->setMode("link");
40  $link_gui->setSetLinkTargetScript(
41  $ilCtrl->getLinkTarget($this,
42  "setInternalLink"));
43  $link_gui->filterLinkType("File");
44  $link_gui->setMode("asynch");
45  $ret = $ilCtrl->forwardCommand($link_gui);
46  break;
47 
48  default:
49  require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
51  if (isset($_POST["editImagemapForward"]) ||
52  isset($_POST["editImagemapForward_x"]) ||
53  isset($_POST["editImagemapForward_y"]))
54  {
55  $cmd = "editImagemapForward";
56  }
57  $ret = $this->$cmd();
58  break;
59  }
60 
61  return $ret;
62  }
$_POST['username']
Definition: cron.php:12
$cmd
Definition: sahs_server.php:35
Class ilInternalLinkGUI.
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
includePresentationJS($a_tpl=null)
Include media object presentation JS.
+ Here is the call graph for this function:

◆ getAdditionalPageXML()

ilImageMapEditorGUI::getAdditionalPageXML ( )

Get additional page xml (to be overwritten)

Returns
string additional page xml

Definition at line 642 of file class.ilImageMapEditorGUI.php.

Referenced by getImageMapOutput().

643  {
644  return "";
645  }
+ Here is the caller graph for this function:

◆ getAliasXML()

ilImageMapEditorGUI::getAliasXML ( )

Definition at line 658 of file class.ilImageMapEditorGUI.php.

References IL_MODE_ALIAS.

Referenced by getImageMapOutput().

659  {
660  return $this->media_object->getXML(IL_MODE_ALIAS);
661  }
const IL_MODE_ALIAS
+ Here is the caller graph for this function:

◆ getEditorTitle()

ilImageMapEditorGUI::getEditorTitle ( )

Get editor title.

Returns
string editor title

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

References $lng.

145  {
146  global $lng;
147 
148  return $lng->txt("cont_imagemap");
149  }
global $lng
Definition: privfeed.php:40

◆ getHrefOfArea()

ilImageMapEditorGUI::getHrefOfArea (   $a_nr)

Get Href of Area (only external link)

Definition at line 956 of file class.ilImageMapEditorGUI.php.

Referenced by setLink().

957  {
958  $st_item = $this->media_object->getMediaItem("Standard");
959  $area = $st_item->getMapArea($a_nr);
960  return $area->getHref();
961  }
+ Here is the caller graph for this function:

◆ getImageMapOutput()

ilImageMapEditorGUI::getImageMapOutput (   $a_map_edit_mode = "")

Render the image map.

Definition at line 599 of file class.ilImageMapEditorGUI.php.

References $_GET, $ilCtrl, getAdditionalPageXML(), getAliasXML(), ilUtil\getWebspaceDir(), IL_MODE_OUTPUT, outputPostProcessing(), xslt_create(), xslt_error(), xslt_free(), and xslt_process().

Referenced by editMapArea(), and editMapAreas().

600  {
601  global $ilCtrl;
602 
603  $st_item = $this->media_object->getMediaItem("Standard");
604 
605  // output image map
606  $xml = "<dummy>";
607  $xml.= $this->getAliasXML();
608  $xml.= $this->media_object->getXML(IL_MODE_OUTPUT);
609  $xml.= $this->getAdditionalPageXML();
610  $xml.="</dummy>";
611  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
612 //echo htmlentities($xml);
613  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
614  $xh = xslt_create();
615  $wb_path = ilUtil::getWebspaceDir("output")."/";
616  $mode = "media";
617 //echo htmlentities($ilCtrl->getLinkTarget($this, "showImageMap"));
618  $params = array ('map_edit_mode' => $a_map_edit_mode,
619  'map_item' => $st_item->getId(),
620  'map_mob_id' => $this->media_object->getId(),
621  'mode' => $mode,
622  'media_mode' => 'enable',
623  'image_map_link' => $ilCtrl->getLinkTarget($this, "showImageMap", "", false, false),
624  'link_params' => "ref_id=".$_GET["ref_id"]."&rand=".rand(1,999999),
625  'ref_id' => $_GET["ref_id"],
626  'pg_frame' => "",
627  'webspace_path' => $wb_path);
628  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
629  echo xslt_error($xh);
630  xslt_free($xh);
631 
632  $output = $this->outputPostProcessing($output);
633 
634  return $output;
635  }
xslt_create()
$_GET["client_id"]
xslt_free(&$proc)
global $ilCtrl
Definition: ilias.php:18
xslt_error(&$proc)
xslt_process(&$proc, $xml_var, $xslt_var, $dummy, $args, $params, $a_no_warnings=false)
outputPostProcessing($a_output)
Output post processing.
getAdditionalPageXML()
Get additional page xml (to be overwritten)
const IL_MODE_OUTPUT
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageMapTableHTML()

ilImageMapEditorGUI::getImageMapTableHTML ( )

Get table HTML.

Definition at line 155 of file class.ilImageMapEditorGUI.php.

Referenced by editMapAreas().

156  {
157  include_once("./Services/MediaObjects/classes/class.ilImageMapTableGUI.php");
158  $image_map_table = new ilImageMapTableGUI($this, "editMapAreas", $this->media_object);
159  return $image_map_table->getHTML();
160  }
TableGUI class for image map editor.
+ Here is the caller graph for this function:

◆ getLinkTypeOfArea()

ilImageMapEditorGUI::getLinkTypeOfArea (   $a_nr)

Get Link Type of Area.

Definition at line 916 of file class.ilImageMapEditorGUI.php.

Referenced by setLink().

917  {
918  $st_item = $this->media_object->getMediaItem("Standard");
919  $area = $st_item->getMapArea($a_nr);
920  return $area->getLinkType();
921  }
+ Here is the caller graph for this function:

◆ getMapAreaLinkString()

ilImageMapEditorGUI::getMapAreaLinkString (   $a_target,
  $a_type,
  $a_frame 
)

Get text name of internal link.

Parameters
string$a_targettarget object link id
string$a_typetype
string$a_frametarget frame

private

Definition at line 672 of file class.ilImageMapEditorGUI.php.

References $lng, ilObject\_lookupObjId(), ilLMObject\_lookupTitle(), and ilObject\_lookupTitle().

Referenced by initAreaEditingForm().

673  {
674  global $lng;
675 
676  $t_arr = explode("_", $a_target);
677  if ($a_frame != "")
678  {
679  $frame_str = " (".$a_frame." Frame)";
680  }
681  switch($a_type)
682  {
683  case "StructureObject":
684  require_once("./Modules/LearningModule/classes/class.ilLMObject.php");
685  $title = ilLMObject::_lookupTitle($t_arr[count($t_arr) - 1]);
686  $link_str = $lng->txt("chapter").
687  ": ".$title." [".$t_arr[count($t_arr) - 1]."]".$frame_str;
688  break;
689 
690  case "PageObject":
691  require_once("./Modules/LearningModule/classes/class.ilLMObject.php");
692  $title = ilLMObject::_lookupTitle($t_arr[count($t_arr) - 1]);
693  $link_str = $lng->txt("page").
694  ": ".$title." [".$t_arr[count($t_arr) - 1]."]".$frame_str;
695  break;
696 
697  case "GlossaryItem":
698  require_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
699  $term =& new ilGlossaryTerm($t_arr[count($t_arr) - 1]);
700  $link_str = $lng->txt("term").
701  ": ".$term->getTerm()." [".$t_arr[count($t_arr) - 1]."]".$frame_str;
702  break;
703 
704  case "MediaObject":
705  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
706  $mob =& new ilObjMediaObject($t_arr[count($t_arr) - 1]);
707  $link_str = $lng->txt("mob").
708  ": ".$mob->getTitle()." [".$t_arr[count($t_arr) - 1]."]".$frame_str;
709  break;
710 
711  case "RepositoryItem":
712  $title = ilObject::_lookupTitle(
713  ilObject::_lookupObjId($t_arr[count($t_arr) - 1]));
714  $link_str = $lng->txt("obj_".$t_arr[count($t_arr) - 2]).
715  ": ".$title." [".$t_arr[count($t_arr) - 1]."]".$frame_str;
716  break;
717  }
718 
719  return $link_str;
720  }
Class ilGlossaryTerm.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
static _lookupObjId($a_id)
Class ilObjMediaObject.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetFrameOfArea()

ilImageMapEditorGUI::getTargetFrameOfArea (   $a_nr)

Get TargetFrame of Area (only internal link)

Definition at line 946 of file class.ilImageMapEditorGUI.php.

Referenced by setLink().

947  {
948  $st_item = $this->media_object->getMediaItem("Standard");
949  $area = $st_item->getMapArea($a_nr);
950  return $area->getTargetFrame();
951  }
+ Here is the caller graph for this function:

◆ getTargetOfArea()

ilImageMapEditorGUI::getTargetOfArea (   $a_nr)

Get Target of Area (only internal link)

Definition at line 936 of file class.ilImageMapEditorGUI.php.

Referenced by setLink().

937  {
938  $st_item = $this->media_object->getMediaItem("Standard");
939  $area = $st_item->getMapArea($a_nr);
940  return $area->getTarget();
941  }
+ Here is the caller graph for this function:

◆ getToolbar()

ilImageMapEditorGUI::getToolbar ( )

Get toolbar.

Returns
object toolbar

Definition at line 97 of file class.ilImageMapEditorGUI.php.

References $ilCtrl, $lng, $options, $si, $tpl, and ilSelectInputGUI\setOptions().

Referenced by editMapAreas().

98  {
99  global $ilCtrl, $lng, $tpl;
100 
101  // toolbar
102  $tb = new ilToolbarGUI();
103  $tb->setFormAction($ilCtrl->getFormAction($this));
104  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
105  $options = array(
106  "WholePicture" => $lng->txt("cont_WholePicture"),
107  "Rect" => $lng->txt("cont_Rect"),
108  "Circle" => $lng->txt("cont_Circle"),
109  "Poly" => $lng->txt("cont_Poly"),
110  );
111  $si = new ilSelectInputGUI($lng->txt("cont_shape"), "shape");
112  $si->setOptions($options);
113  $tb->addInputItem($si, true);
114  $tb->addFormButton($lng->txt("cont_add_area"), "addNewArea");
115 
116 
117  // highlight mode
118 /* if (strtolower(get_class($this)) == "ilimagemapeditorgui")
119  {
120  $st_item = $this->media_object->getMediaItem("Standard");
121  $tb->addSeparator();
122  $options = ilMapArea::getAllHighlightModes();
123  $hl = new ilSelectInputGUI($lng->txt("cont_highlight_mode"), "highlight_mode");
124  $hl->setOptions($options);
125 // $hl->setValue($st_item->getHighlightMode());
126  $tb->addInputItem($hl, true);
127  $options = ilMapArea::getAllHighlightClasses();
128  $hc = new ilSelectInputGUI($lng->txt("cont_highlight_class"), "highlight_class");
129  $hc->setOptions($options);
130 // $hc->setValue($st_item->getHighlightClass());
131  $tb->addInputItem($hc, false);
132  $tb->addFormButton($lng->txt("cont_set"), "setHighlight");
133  }*/
134 
135  return $tb;
136  }
This class represents a selection list property in a property form.
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
setOptions($a_options)
Set Options.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTypeOfArea()

ilImageMapEditorGUI::getTypeOfArea (   $a_nr)

Get Type of Area (only internal link)

Definition at line 926 of file class.ilImageMapEditorGUI.php.

Referenced by setLink().

927  {
928  $st_item = $this->media_object->getMediaItem("Standard");
929  $area = $st_item->getMapArea($a_nr);
930  return $area->getType();
931  }
+ Here is the caller graph for this function:

◆ handleMapParameters()

ilImageMapEditorGUI::handleMapParameters ( )

handle parameter during map area editing (storing to session)

Definition at line 165 of file class.ilImageMapEditorGUI.php.

References $_GET, and $_SESSION.

Referenced by addArea(), editMapAreas(), setLink(), and setShape().

166  {
167  if($_GET["ref_id"] != "")
168  {
169  $_SESSION["il_map_edit_ref_id"] = $_GET["ref_id"];
170  }
171 
172  if($_GET["obj_id"] != "")
173  {
174  $_SESSION["il_map_edit_obj_id"] = $_GET["obj_id"];
175  }
176 
177  if($_GET["hier_id"] != "")
178  {
179  $_SESSION["il_map_edit_hier_id"] = $_GET["hier_id"];
180  }
181 
182  if($_GET["pc_id"] != "")
183  {
184  $_SESSION["il_map_edit_pc_id"] = $_GET["pc_id"];
185  }
186  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ initAreaEditingForm()

ilImageMapEditorGUI::initAreaEditingForm (   $a_edit_property)

Init area editing form.

Parameters
int$a_modeEdit Mode

Definition at line 473 of file class.ilImageMapEditorGUI.php.

References $_SESSION, $ilCtrl, $lng, getMapAreaLinkString(), ilTextInputGUI\setMaxLength(), and ilRadioGroupInputGUI\setValue().

Referenced by editMapArea().

474  {
475  global $lng, $ilCtrl;
476 
477  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
478  $form = new ilPropertyFormGUI();
479  $form->setOpenTag(false);
480  $form->setCloseTag(false);
481 
482  // link
483  if ($a_edit_property != "shape")
484  {
485  //
486  $radg = new ilRadioGroupInputGUI($lng->txt("cont_link"), "area_link_type");
487  if ($_SESSION["il_map_il_ltype"] != "int")
488  {
489  if ($_SESSION["il_map_el_href"] == "")
490  {
491  $radg->setValue("no");
492  }
493  else
494  {
495  $radg->setValue("ext");
496  }
497  }
498  else
499  {
500  $radg->setValue("int");
501  }
502 
503  // external link
504  $ext = new ilRadioOption($lng->txt("cont_link_ext"), "ext");
505  $radg->addOption($ext);
506 
507  $ti = new ilTextInputGUI("", "area_link_ext");
508  $ti->setMaxLength(200);
509  $ti->setSize(50);
510  if ($_SESSION["il_map_el_href"] != "")
511  {
512  $ti->setValue($_SESSION["il_map_el_href"]);
513  }
514  else
515  {
516  $ti->setValue("http://");
517  }
518  $ext->addSubItem($ti);
519 
520  // internal link
521  $int = new ilRadioOption($lng->txt("cont_link_int"), "int");
522  $radg->addOption($int);
523 
524  $ne = new ilNonEditableValueGUI("", "", true);
525  $link_str = "";
526  if($_SESSION["il_map_il_target"] != "")
527  {
528  $link_str = $this->getMapAreaLinkString($_SESSION["il_map_il_target"],
529  $_SESSION["il_map_il_type"], $_SESSION["il_map_il_targetframe"]);
530  }
531  $ne->setValue($link_str.
532  '&nbsp;<a id="iosEditInternalLinkTrigger" href="#">'.
533  "[".$lng->txt("cont_get_link")."]".
534  '</a>'
535  );
536  $int->addSubItem($ne);
537 
538  // no link
539  $no = new ilRadioOption($lng->txt("cont_link_no"), "no");
540  $radg->addOption($no);
541 
542  $form->addItem($radg);
543  }
544 
545 
546  // name
547  if ($a_edit_property != "link" && $a_edit_property != "shape")
548  {
549  $ti = new ilTextInputGUI($lng->txt("cont_name"), "area_name");
550  $ti->setMaxLength(200);
551  $ti->setSize(20);
552  $form->addItem($ti);
553  }
554 
555  // save and cancel commands
556  if ($a_edit_property == "")
557  {
558  $form->setTitle($lng->txt("cont_new_area"));
559  $form->addCommandButton("saveArea", $lng->txt("save"));
560  }
561  else
562  {
563  $form->setTitle($lng->txt("cont_new_area"));
564  $form->addCommandButton("saveArea", $lng->txt("save"));
565  }
566 
567 // $form->setFormAction($ilCtrl->getFormAction($this));
568 
569  return $form;
570  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
This class represents an option in a radio group.
This class represents a property form user interface.
getMapAreaLinkString($a_target, $a_type, $a_frame)
Get text name of internal link.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
This class represents a non editable value in a property form.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ linkWholePicture()

ilImageMapEditorGUI::linkWholePicture ( )

Link the whole picture.

Definition at line 237 of file class.ilImageMapEditorGUI.php.

References $_SESSION, clearSessionVars(), and editMapArea().

Referenced by addNewArea().

238  {
239  $this->clearSessionVars();
240  $_SESSION["il_map_edit_area_type"] = "WholePicture";
241 
242  return $this->editMapArea(false, false, true);
243  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
clearSessionVars()
Clear Session Vars.
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeMapWorkCopy()

ilImageMapEditorGUI::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 575 of file class.ilImageMapEditorGUI.php.

Referenced by editMapArea(), and editMapAreas().

577  {
578  // create/update imagemap work copy
579  $st_item = $this->media_object->getMediaItem("Standard");
580 
581  if ($a_edit_property == "shape")
582  {
583  $st_item->makeMapWorkCopy($a_area_nr, true); // exclude area currently being edited
584  }
585  else
586  {
587  $st_item->makeMapWorkCopy($a_area_nr, false);
588  }
589 
590  if ($a_output_new_area)
591  {
592  $st_item->addAreaToMapWorkCopy($a_area_type, $a_coords);
593  }
594  }
+ Here is the caller graph for this function:

◆ outputPostProcessing()

ilImageMapEditorGUI::outputPostProcessing (   $a_output)

Output post processing.

Parameters

Definition at line 653 of file class.ilImageMapEditorGUI.php.

Referenced by getImageMapOutput().

654  {
655  return $a_output;
656  }
+ Here is the caller graph for this function:

◆ saveArea()

ilImageMapEditorGUI::saveArea ( )

Save new or updated map area.

Definition at line 755 of file class.ilImageMapEditorGUI.php.

References $_POST, $_SESSION, $ilCtrl, $lng, ilMapArea\_getMaxNr(), IL_EXT_LINK, IL_INT_LINK, IL_NO_LINK, ilUtil\sendSuccess(), ilMapArea\setLinkType(), ilMapArea\setShape(), and ilUtil\stripSlashes().

Referenced by setShape().

756  {
757  global $lng, $ilCtrl;
758 
759  switch ($_SESSION["il_map_edit_mode"])
760  {
761  // save edited link
762  case "edit_link":
763  $st_item = $this->media_object->getMediaItem("Standard");
764  $max = ilMapArea::_getMaxNr($st_item->getId());
765  $area = new ilMapArea($st_item->getId(), $_SESSION["il_map_area_nr"]);
766 
767  if ($_POST["area_link_type"] == IL_INT_LINK)
768  {
769  $area->setLinkType(IL_INT_LINK);
770  $area->setType($_SESSION["il_map_il_type"]);
771  $area->setTarget($_SESSION["il_map_il_target"]);
772  $area->setTargetFrame($_SESSION["il_map_il_targetframe"]);
773  }
774  else
775  {
776  $area->setLinkType(IL_EXT_LINK);
777  if ($_POST["area_link_type"] != IL_NO_LINK)
778  {
779  $area->setHref(ilUtil::stripSlashes($_POST["area_link_ext"]));
780  }
781  else
782  {
783  $area->setHref("");
784  }
785  }
786  $area->update();
787  break;
788 
789  // save edited shape
790  case "edit_shape":
791  $st_item = $this->media_object->getMediaItem("Standard");
792  $max = ilMapArea::_getMaxNr($st_item->getId());
793  $area =& new ilMapArea($st_item->getId(), $_SESSION["il_map_area_nr"]);
794 
795  $area->setShape($_SESSION["il_map_edit_area_type"]);
796  $area->setCoords($_SESSION["il_map_edit_coords"]);
797  $area->update();
798  break;
799 
800  // save new area
801  default:
802  $area_type = $_SESSION["il_map_edit_area_type"];
803  $coords = $_SESSION["il_map_edit_coords"];
804 
805  $st_item = $this->media_object->getMediaItem("Standard");
806  $max = ilMapArea::_getMaxNr($st_item->getId());
807 
808  // make new area object
809  $area = new ilMapArea();
810  $area->setItemId($st_item->getId());
811  $area->setShape($area_type);
812  $area->setCoords($coords);
813  $area->setNr($max + 1);
814  $area->setTitle(ilUtil::stripSlashes($_POST["area_name"]));
815  switch($_POST["area_link_type"])
816  {
817  case "ext":
818  $area->setLinkType(IL_EXT_LINK);
819  $area->setHref($_POST["area_link_ext"]);
820  break;
821 
822  case "int":
823  $area->setLinkType(IL_INT_LINK);
824  $area->setType($_SESSION["il_map_il_type"]);
825  $area->setTarget($_SESSION["il_map_il_target"]);
826  $area->setTargetFrame($_SESSION["il_map_il_targetframe"]);
827  break;
828  }
829 
830  // put area into item and update media object
831  $st_item->addMapArea($area);
832  $this->media_object->update();
833  break;
834  }
835 
836  //$this->initMapParameters();
837  ilUtil::sendSuccess($lng->txt("cont_saved_map_area"), true);
838  $ilCtrl->redirect($this, "editMapAreas");
839  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
const IL_NO_LINK
global $ilCtrl
Definition: ilias.php:18
const IL_INT_LINK
_getMaxNr($a_item_id)
get maximum nr of media item (static)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const IL_EXT_LINK
Class ilMapArea.
setShape($a_shape)
set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)
global $lng
Definition: privfeed.php:40
setLinkType($a_link_type)
set link type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHighlight()

ilImageMapEditorGUI::setHighlight ( )

Set highlight settings.

Parameters

Definition at line 1159 of file class.ilImageMapEditorGUI.php.

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

1160  {
1161  global $ilCtrl, $lng;
1162 
1163  $st_item = $this->media_object->getMediaItem("Standard");
1164  $st_item->setHighlightMode(ilUtil::stripSlashes($_POST["highlight_mode"]));
1165  $st_item->setHighlightClass(ilUtil::stripSlashes($_POST["highlight_class"]));
1166  $st_item->update();
1167 
1168  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1169  $ilCtrl->redirect($this, "editMapAreas");
1170  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setInternalLink()

ilImageMapEditorGUI::setInternalLink ( )

Set internal link.

Definition at line 844 of file class.ilImageMapEditorGUI.php.

References $_GET, $_SESSION, addArea(), and setLink().

845  {
846  $_SESSION["il_map_il_type"] = $_GET["linktype"];
847  $_SESSION["il_map_il_ltype"] = "int";
848 
849  $_SESSION["il_map_il_target"] = $_GET["linktarget"];
850  $_SESSION["il_map_il_targetframe"] = $_GET["linktargetframe"];
851  switch ($_SESSION["il_map_edit_mode"])
852  {
853  case "edit_link":
854  return $this->setLink();
855  break;
856 
857  default:
858  return $this->addArea();
859  break;
860  }
861  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
setLink($a_handle=true)
Set link.
addArea($a_handle=true)
Handle adding new area process.
+ Here is the call graph for this function:

◆ setLink()

ilImageMapEditorGUI::setLink (   $a_handle = true)

Set link.

Definition at line 866 of file class.ilImageMapEditorGUI.php.

References $_POST, $_SESSION, $ilCtrl, $lng, editMapArea(), getHrefOfArea(), getLinkTypeOfArea(), getTargetFrameOfArea(), getTargetOfArea(), getTypeOfArea(), handleMapParameters(), IL_INT_LINK, and ilUtil\sendFailure().

Referenced by editLink(), and setInternalLink().

867  {
868  global $lng, $ilCtrl;
869 
870  if($a_handle)
871  {
872  $this->handleMapParameters();
873  }
874  if ($_SESSION["il_map_area_nr"] != "")
875  {
876  $_POST["area"][0] = $_SESSION["il_map_area_nr"];
877  }
878  if (!isset($_POST["area"]))
879  {
880  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
881  $ilCtrl->redirect($this, "editMapAreas");
882  }
883 
884  if (count($_POST["area"]) > 1)
885  {
886  //$this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
887  ilUtil::sendFailure($lng->txt("cont_select_max_one_item"), true);
888  $ilCtrl->redirect($this, "editMapAreas");
889  }
890 
891 
892  if ($_SESSION["il_map_edit_mode"] != "edit_link")
893  {
894  $_SESSION["il_map_area_nr"] = $_POST["area"][0];
895  $_SESSION["il_map_il_ltype"] = $this->getLinkTypeOfArea($_POST["area"][0]);
896  $_SESSION["il_map_edit_mode"] = "edit_link";
897  $_SESSION["il_map_edit_target_script"] = $ilCtrl->getLinkTarget($this, "setLink");
898  if ($_SESSION["il_map_il_ltype"] == IL_INT_LINK)
899  {
900  $_SESSION["il_map_il_type"] = $this->getTypeOfArea($_POST["area"][0]);
901  $_SESSION["il_map_il_target"] = $this->getTargetOfArea($_POST["area"][0]);
902  $_SESSION["il_map_il_targetframe"] = $this->getTargetFrameOfArea($_POST["area"][0]);
903  }
904  else
905  {
906  $_SESSION["il_map_el_href"] = $this->getHrefOfArea($_POST["area"][0]);
907  }
908  }
909 
910  return $this->editMapArea(false, false, true, "link", $_POST["area"][0]);
911  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
getLinkTypeOfArea($a_nr)
Get Link Type of Area.
getTargetFrameOfArea($a_nr)
Get TargetFrame of Area (only internal link)
global $ilCtrl
Definition: ilias.php:18
const IL_INT_LINK
handleMapParameters()
handle parameter during map area editing (storing to session)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getHrefOfArea($a_nr)
Get Href of Area (only external link)
global $lng
Definition: privfeed.php:40
getTypeOfArea($a_nr)
Get Type of Area (only internal link)
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.
getTargetOfArea($a_nr)
Get Target of Area (only internal link)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShape()

ilImageMapEditorGUI::setShape (   $a_handle = true)

edit shape of existing map area

Definition at line 1055 of file class.ilImageMapEditorGUI.php.

References $_POST, $_SESSION, $ilCtrl, $lng, ilMapArea\countCoords(), editMapArea(), handleMapParameters(), saveArea(), and ilUtil\sendFailure().

Referenced by editShapeCircle(), editShapePolygon(), editShapeRectangle(), and editShapeWholePicture().

1056  {
1057  global $lng, $ilCtrl;
1058 
1059  if($a_handle)
1060  {
1061  $this->handleMapParameters();
1062  }
1063  if($_POST["areatype2"] != "")
1064  {
1065  $_SESSION["il_map_edit_area_type"] = $_POST["areatype2"];
1066  }
1067  if ($_SESSION["il_map_area_nr"] != "")
1068  {
1069  $_POST["area"][0] = $_SESSION["il_map_area_nr"];
1070  }
1071  if (!isset($_POST["area"]))
1072  {
1073  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1074  $ilCtrl->redirect($this, "editMapAreas");
1075  }
1076 
1077  if (count($_POST["area"]) > 1)
1078  {
1079  ilUtil::sendFailure($lng->txt("cont_select_max_one_item"), true);
1080  $ilCtrl->redirect($this, "editMapAreas");
1081  }
1082 
1083  if ($_SESSION["il_map_edit_mode"] != "edit_shape")
1084  {
1085  $_SESSION["il_map_area_nr"] = $_POST["area"][0];
1086  $_SESSION["il_map_edit_mode"] = "edit_shape";
1087  $_SESSION["il_map_edit_target_script"] = $ilCtrl->getLinkTarget($this, "setShape", "", false, false);
1088  }
1089 
1090 
1091  $area_type = $_SESSION["il_map_edit_area_type"];
1092  $coords = $_SESSION["il_map_edit_coords"];
1093  $cnt_coords = ilMapArea::countCoords($coords);
1094 
1095  // decide what to do next
1096  switch ($area_type)
1097  {
1098  // Rectangle
1099  case "Rect" :
1100  if ($cnt_coords < 2)
1101  {
1102  return $this->editMapArea(true, false, false, "shape", $_POST["area"][0]);
1103  }
1104  else if ($cnt_coords == 2)
1105  {
1106  return $this->saveArea();
1107  }
1108  break;
1109 
1110  // Circle
1111  case "Circle":
1112  if ($cnt_coords <= 1)
1113  {
1114  return $this->editMapArea(true, false, false, "shape", $_POST["area"][0]);
1115  }
1116  else
1117  {
1118  if ($cnt_coords == 2)
1119  {
1120  $c = explode(",",$coords);
1121  $coords = $c[0].",".$c[1].","; // determine radius
1122  $coords .= round(sqrt(pow(abs($c[3]-$c[1]),2)+pow(abs($c[2]-$c[0]),2)));
1123  }
1124  $_SESSION["il_map_edit_coords"] = $coords;
1125 
1126  return $this->saveArea();
1127  }
1128  break;
1129 
1130  // Polygon
1131  case "Poly":
1132  if ($cnt_coords < 1)
1133  {
1134  return $this->editMapArea(true, false, false, "shape", $_POST["area"][0]);
1135  }
1136  else if ($cnt_coords < 3)
1137  {
1138  return $this->editMapArea(true, true, false, "shape", $_POST["area"][0]);
1139  }
1140  else
1141  {
1142  return $this->editMapArea(true, true, true, "shape", $_POST["area"][0]);
1143  }
1144  break;
1145 
1146  // Whole Picture
1147  case "WholePicture":
1148  return $this->saveArea();
1149  }
1150 
1151  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
saveArea()
Save new or updated map area.
global $ilCtrl
Definition: ilias.php:18
handleMapParameters()
handle parameter during map area editing (storing to session)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
countCoords($c)
count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,x3,y3,...")
global $lng
Definition: privfeed.php:40
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showImageMap()

ilImageMapEditorGUI::showImageMap ( )

show image map

Definition at line 191 of file class.ilImageMapEditorGUI.php.

References $_GET.

192  {
193  $item =& new ilMediaItem($_GET["item_id"]);
194  $item->outputMapWorkCopy();
195  }
$_GET["client_id"]
Class ilMediaItem.

◆ updateAreas()

ilImageMapEditorGUI::updateAreas ( )

Update map areas.

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

References $_POST, $ilCtrl, $lng, ilMapArea\_getMaxNr(), ilUtil\sendSuccess(), ilMapArea\setTitle(), and ilUtil\stripSlashes().

201  {
202  global $lng, $ilCtrl;
203 
204  $st_item =& $this->media_object->getMediaItem("Standard");
205  $max = ilMapArea::_getMaxNr($st_item->getId());
206  for ($i=1; $i<=$max; $i++)
207  {
208  $area =& new ilMapArea($st_item->getId(), $i);
209  $area->setTitle(ilUtil::stripSlashes($_POST["name_".$i]));
210  $area->setHighlightMode(ilUtil::stripSlashes($_POST["hl_mode_".$i]));
211  $area->setHighlightClass(ilUtil::stripSlashes($_POST["hl_class_".$i]));
212  $area->update();
213  }
214 
215  ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
216  $ilCtrl->redirect($this, "editMapAreas");
217  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
set (tooltip)title of area
_getMaxNr($a_item_id)
get maximum nr of media item (static)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilMapArea.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

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