ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 _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 page content map editor.

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

@ilCtrl_Calls ilPCImageMapEditorGUI: ilInternalLinkGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCImageMapEditorGUI::__construct (   $a_content_obj,
  $a_page 
)

Constructor.

Reimplemented in ilPCIIMTriggerEditorGUI.

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

23 {
24 $this->content_obj = $a_content_obj;
25 $this->page = $a_page;
26 parent::__construct($a_content_obj->getMediaObject());
27
28 $this->std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
29 $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId(),
30 $this->getParentNodeName());
31 }
Class ilMediaAliasItem.

Member Function Documentation

◆ deleteAreas()

ilPCImageMapEditorGUI::deleteAreas ( )

Delete map areas.

Reimplemented from ilImageMapEditorGUI.

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

142 {
143 global $ilCtrl, $lng;
144
145 if (!isset($_POST["area"]))
146 {
147 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
148 $ilCtrl->redirect($this, "editMapAreas");
149 }
150
151// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
152// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
153
154 if (count($_POST["area"]) > 0)
155 {
156 $i = 0;
157 arsort($_POST["area"]);
158 foreach ($_POST["area"] as $area_nr)
159 {
160 $this->std_alias_item->deleteMapArea($area_nr);
161 }
162 $this->updated = $this->page->update();
163 ilUtil::sendSuccess($lng->txt("cont_areas_deleted"), true);
164 }
165
166 $ilCtrl->redirect($this, "editMapAreas");
167 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

◆ getAliasXML()

ilPCImageMapEditorGUI::getAliasXML ( )

Reimplemented from ilImageMapEditorGUI.

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

273 {
274 return $this->content_obj->dumpXML();
275 }

◆ getHrefOfArea()

ilPCImageMapEditorGUI::getHrefOfArea (   $a_nr)

Get Href of Area (only external link)

Reimplemented from ilImageMapEditorGUI.

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

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

◆ getImageMapTableHTML()

ilPCImageMapEditorGUI::getImageMapTableHTML ( )

Get table HTML.

Reimplemented from ilImageMapEditorGUI.

Reimplemented in ilPCIIMTriggerEditorGUI.

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

47 {
48 include_once("./Services/COPage/classes/class.ilPCImageMapTableGUI.php");
49 $image_map_table = new ilPCImageMapTableGUI($this, "editMapAreas", $this->content_obj,
50 $this->getParentNodeName());
51 return $image_map_table->getHTML();
52 }
getParentNodeName()
Get parent node name.
TableGUI class for pc image map editor.

References getParentNodeName().

+ Here is the call graph for this function:

◆ getLinkTypeOfArea()

ilPCImageMapEditorGUI::getLinkTypeOfArea (   $a_nr)

Get Link Type of Area.

Reimplemented from ilImageMapEditorGUI.

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

173 {
174// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
175// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
176 return $this->std_alias_item->getLinkTypeOfArea($a_nr);
177 }

◆ getParentNodeName()

ilPCImageMapEditorGUI::getParentNodeName ( )

Get parent node name.

Returns
string name of parent node

Reimplemented in ilPCIIMTriggerEditorGUI.

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

39 {
40 return "MediaObject";
41 }

Referenced by getImageMapTableHTML().

+ Here is the caller graph for this function:

◆ getTargetFrameOfArea()

ilPCImageMapEditorGUI::getTargetFrameOfArea (   $a_nr)

Get TargetFrame of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

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

◆ getTargetOfArea()

ilPCImageMapEditorGUI::getTargetOfArea (   $a_nr)

Get Target of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

193 {
194// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
195// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
196 return $this->std_alias_item->getTargetOfArea($a_nr);
197 }

◆ getTypeOfArea()

ilPCImageMapEditorGUI::getTypeOfArea (   $a_nr)

Get Type of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

183 {
184// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
185// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
186 return $this->std_alias_item->getTypeOfArea($a_nr);
187 }

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

Reimplemented from ilImageMapEditorGUI.

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

249 {
250// old for pc media object
251// $media_object = $this->media_object->getMediaItem("Standard");
252 $media_object = $this->content_obj->getMediaObject();
253
254 // create/update imagemap work copy
255 $st_item = $media_object->getMediaItem("Standard");
256 $st_alias_item = new ilMediaAliasItem($this->content_obj->dom,
257 $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId(),
258 $this->getParentNodeName());
259
260 if ($a_edit_property == "shape")
261 {
262 $st_alias_item->makeMapWorkCopy($st_item, $a_area_nr, true,
263 $a_output_new_area, $a_area_type, $a_coords); // exclude area currently being edited
264 }
265 else
266 {
267 $st_alias_item->makeMapWorkCopy($st_item, $a_area_nr, false,
268 $a_output_new_area, $a_area_type, $a_coords);
269 }
270 }

◆ saveArea()

ilPCImageMapEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilImageMapEditorGUI.

Reimplemented in ilPCIIMTriggerEditorGUI.

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

58 {
59 global $lng, $ilCtrl;
60
61 switch ($_SESSION["il_map_edit_mode"])
62 {
63 // save edited link
64 case "edit_link":
65// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
66// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
67
68 if ($_POST["area_link_type"] == IL_INT_LINK)
69 {
70 $this->std_alias_item->setAreaIntLink($_SESSION["il_map_area_nr"],
71 $_SESSION["il_map_il_type"], $_SESSION["il_map_il_target"],
72 $_SESSION["il_map_il_targetframe"]);
73 }
74 else if ($_POST["area_link_type"] == IL_NO_LINK)
75 {
76 $this->std_alias_item->setAreaExtLink($_SESSION["il_map_area_nr"],
77 "");
78 }
79 else
80 {
81 $this->std_alias_item->setAreaExtLink($_SESSION["il_map_area_nr"],
82 ilUtil::stripSlashes($_POST["area_link_ext"]));
83 }
84 $this->updated = $this->page->update();
85 break;
86
87 // save edited shape
88 case "edit_shape":
89// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
90// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
91 $this->std_alias_item->setShape($_SESSION["il_map_area_nr"],
92 $_SESSION["il_map_edit_area_type"], $_SESSION["il_map_edit_coords"]);
93 $this->updated = $this->page->update();
94 break;
95
96 // save new area
97 default:
98 $area_type = $_SESSION["il_map_edit_area_type"];
99 $coords = $_SESSION["il_map_edit_coords"];
100
101 switch($_POST["area_link_type"])
102 {
103 case IL_EXT_LINK:
104 $link = array(
105 "LinkType" => IL_EXT_LINK,
106 "Href" => ilUtil::stripSlashes($_POST["area_link_ext"]));
107 break;
108
109 case IL_NO_LINK:
110 $link = array(
111 "LinkType" => IL_EXT_LINK,
112 "Href" => "");
113 break;
114
115 case IL_INT_LINK:
116 $link = array(
117 "LinkType" => IL_INT_LINK,
118 "Type" => $_SESSION["il_map_il_type"],
119 "Target" => $_SESSION["il_map_il_target"],
120 "TargetFrame" => $_SESSION["il_map_il_targetframe"]);
121 break;
122 }
123
124// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
125// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
126 $this->std_alias_item->addMapArea($area_type, $coords,
127 ilUtil::stripSlashes($_POST["area_name"]), $link);
128 $this->updated = $this->page->update();
129
130 break;
131 }
132
133 //$this->initMapParameters();
134 ilUtil::sendSuccess($lng->txt("cont_saved_map_area"), true);
135 $ilCtrl->redirect($this, "editMapAreas");
136 }
$_SESSION["AccountId"]
const IL_INT_LINK
const IL_EXT_LINK
const IL_NO_LINK
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$coords
Definition: example_030.php:88

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

+ Here is the call graph for this function:

◆ updateAreas()

ilPCImageMapEditorGUI::updateAreas ( )

Update map areas.

Reimplemented from ilImageMapEditorGUI.

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

223 {
224 global $lng, $ilCtrl;
225
226// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
227// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
228 $areas = $this->std_alias_item->getMapAreas();
229 foreach($areas as $area)
230 {
231 $this->std_alias_item->setAreaTitle($area["Nr"],
232 ilUtil::stripSlashes($_POST["name_".$area["Nr"]]));
233 $this->std_alias_item->setAreaHighlightMode($area["Nr"],
234 ilUtil::stripSlashes($_POST["hl_mode_".$area["Nr"]]));
235 $this->std_alias_item->setAreaHighlightClass($area["Nr"],
236 ilUtil::stripSlashes($_POST["hl_class_".$area["Nr"]]));
237 }
238 $this->page->update();
239
240 ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
241 $ilCtrl->redirect($this, "editMapAreas");
242 }

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

+ Here is the call graph for this function:

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