ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPCIIMTriggerEditorGUI Class Reference

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

+ Inheritance diagram for ilPCIIMTriggerEditorGUI:
+ Collaboration diagram for ilPCIIMTriggerEditorGUI:

Public Member Functions

 __construct ($a_content_obj, $a_page)
 Constructor. More...
 
 getParentNodeName ()
 Get parent node name. More...
 
 getEditorTitle ()
 Get editor title. More...
 
 getImageMapTableHTML ()
 Get trigger table. More...
 
 getToolbar ()
 Get toolbar. More...
 
 addNewArea ()
 Add new area. More...
 
 initAreaEditingForm ($a_edit_property)
 Init area editing form. More...
 
 saveArea ()
 Save new or updated map area. More...
 
 updateTrigger ()
 Update trigger. More...
 
 confirmDeleteTrigger ()
 Confirm trigger deletion. More...
 
 deleteTrigger ()
 Delete trigger. More...
 
 getAdditionalPageXML ()
 Get additional page xml (to be overwritten) More...
 
 outputPostProcessing ($a_output)
 Output post processing. More...
 
- Public Member Functions inherited from ilPCImageMapEditorGUI
 __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 ilPCIIMTriggerEditorGUI: ilInternalLinkGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCIIMTriggerEditorGUI::__construct (   $a_content_obj,
  $a_page 
)

Constructor.

Reimplemented from ilPCImageMapEditorGUI.

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

23 {
24 global $tpl;
25
26 $tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
27
28 parent::__construct($a_content_obj, $a_page);
29 }
global $tpl
Definition: ilias.php:8

References $tpl.

Member Function Documentation

◆ addNewArea()

ilPCIIMTriggerEditorGUI::addNewArea ( )

Add new area.

Parameters

return

Reimplemented from ilImageMapEditorGUI.

Definition at line 117 of file class.ilPCIIMTriggerEditorGUI.php.

118 {
119 global $ilCtrl, $lng;
120
121 if ($_POST["shape"] == "Marker")
122 {
123 $this->content_obj->addTriggerMarker();
124 $this->updated = $this->page->update();
125 ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
126 $ilCtrl->redirect($this, "editMapAreas");
127 }
128 else
129 {
130 return parent::addNewArea();
131 }
132 }
static sendSuccess($a_info="", $a_keep=false)
Send Success 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, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ confirmDeleteTrigger()

ilPCIIMTriggerEditorGUI::confirmDeleteTrigger ( )

Confirm trigger deletion.

Definition at line 227 of file class.ilPCIIMTriggerEditorGUI.php.

228 {
229 global $ilCtrl, $tpl, $lng;
230
231 if (!is_array($_POST["tr"]) || count($_POST["tr"]) == 0)
232 {
233 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
234 $ilCtrl->redirect($this, "editMapAreas");
235 }
236 else
237 {
238 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
239 $cgui = new ilConfirmationGUI();
240 $cgui->setFormAction($ilCtrl->getFormAction($this));
241 $cgui->setHeaderText($lng->txt("cont_really_delete_triggers"));
242 $cgui->setCancel($lng->txt("cancel"), "editMapAreas");
243 $cgui->setConfirm($lng->txt("delete"), "deleteTrigger");
244
245 foreach ($_POST["tr"] as $i)
246 {
247 $cgui->addItem("tr[]", $i, $_POST["title"][$i]);
248 }
249
250 $tpl->setContent($cgui->getHTML());
251 }
252 }
Confirmation screen class.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ deleteTrigger()

ilPCIIMTriggerEditorGUI::deleteTrigger ( )

Delete trigger.

Definition at line 257 of file class.ilPCIIMTriggerEditorGUI.php.

258 {
259 global $ilCtrl, $lng;
260
261 if (is_array($_POST["tr"]) && count($_POST["tr"]) > 0)
262 {
263 foreach ($_POST["tr"] as $tr_nr)
264 {
265 $this->content_obj->deleteTrigger($this->std_alias_item, $tr_nr);
266 }
267 $this->updated = $this->page->update();
268 ilUtil::sendSuccess($lng->txt("cont_areas_deleted"), true);
269 }
270
271 $ilCtrl->redirect($this, "editMapAreas");
272 }

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

+ Here is the call graph for this function:

◆ getAdditionalPageXML()

ilPCIIMTriggerEditorGUI::getAdditionalPageXML ( )

Get additional page xml (to be overwritten)

Returns
string additional page xml

Reimplemented from ilImageMapEditorGUI.

Definition at line 279 of file class.ilPCIIMTriggerEditorGUI.php.

280 {
281 return $this->page->getMultimediaXML();
282 }

◆ getEditorTitle()

ilPCIIMTriggerEditorGUI::getEditorTitle ( )

Get editor title.

Returns
string editor title

Reimplemented from ilImageMapEditorGUI.

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

47 {
48 global $lng;
49
50 return $lng->txt("cont_pc_iim");
51 }

References $lng.

◆ getImageMapTableHTML()

ilPCIIMTriggerEditorGUI::getImageMapTableHTML ( )

Get trigger table.

Reimplemented from ilPCImageMapEditorGUI.

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

57 {
58 global $tpl, $ilToolbar, $lng, $ilCtrl;
59
60 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
62
63 $tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
64 $tpl->addJavascript("./Services/COPage/js/ilCOPagePCInteractiveImage.js");
65
66 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
69
70 $ilToolbar->addText($lng->txt("cont_drag_element_click_save"));
71 $ilToolbar->setId("drag_toolbar");
72 $ilToolbar->setHidden(true);
73 $ilToolbar->addButton($lng->txt("save"),"#", "", "", "", "save_pos_button");
74
75 $ilToolbar->addButton($lng->txt("cancel"),
76 $ilCtrl->getLinkTarget($this, "editMapAreas"));
77
78 include_once("./Services/COPage/classes/class.ilPCIIMTriggerTableGUI.php");
79 $image_map_table = new ilPCIIMTriggerTableGUI($this, "editMapAreas", $this->content_obj,
80 $this->getParentNodeName());
81 return $image_map_table->getHTML();
82 }
static addJavaScript()
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
getParentNodeName()
Get parent node name.
TableGUI class for pc image map editor.
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)

References $ilCtrl, $lng, $tpl, ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), getParentNodeName(), and iljQueryUtil\initjQueryUI().

+ Here is the call graph for this function:

◆ getParentNodeName()

ilPCIIMTriggerEditorGUI::getParentNodeName ( )

Get parent node name.

Returns
string name of parent node

Reimplemented from ilPCImageMapEditorGUI.

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

37 {
38 return "InteractiveImage";
39 }

Referenced by getImageMapTableHTML().

+ Here is the caller graph for this function:

◆ getToolbar()

ilPCIIMTriggerEditorGUI::getToolbar ( )

Get toolbar.

Returns
object toolbar

Reimplemented from ilImageMapEditorGUI.

Definition at line 89 of file class.ilPCIIMTriggerEditorGUI.php.

90 {
91 global $ilCtrl, $lng;
92
93 // toolbar
94 $tb = new ilToolbarGUI();
95 $tb->setFormAction($ilCtrl->getFormAction($this));
96 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
97 $options = array(
98 "Rect" => $lng->txt("cont_Rect"),
99 "Circle" => $lng->txt("cont_Circle"),
100 "Poly" => $lng->txt("cont_Poly"),
101 "Marker" => $lng->txt("cont_marker")
102 );
103 $si = new ilSelectInputGUI($lng->txt("cont_trigger_area"), "shape");
104 $si->setOptions($options);
105 $tb->addInputItem($si, true);
106 $tb->addFormButton($lng->txt("add"), "addNewArea");
107
108 return $tb;
109 }
This class represents a selection list property in a property form.
if(!is_array($argv)) $options

References $ilCtrl, $lng, $options, and $si.

◆ initAreaEditingForm()

ilPCIIMTriggerEditorGUI::initAreaEditingForm (   $a_edit_property)

Init area editing form.

Parameters
int$a_modeEdit Mode

Reimplemented from ilImageMapEditorGUI.

Definition at line 139 of file class.ilPCIIMTriggerEditorGUI.php.

140 {
141 global $lng, $ilCtrl;
142
143 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
144 $form = new ilPropertyFormGUI();
145 $form->setOpenTag(false);
146 $form->setCloseTag(false);
147
148 // name
149 if ($a_edit_property != "link" && $a_edit_property != "shape")
150 {
151 $ti = new ilTextInputGUI($lng->txt("cont_name"), "area_name");
152 $ti->setMaxLength(200);
153 $ti->setSize(20);
154 $ti->setRequired(true);
155 $form->addItem($ti);
156 }
157
158 // save and cancel commands
159 if ($a_edit_property == "")
160 {
161 $form->setTitle($lng->txt("cont_new_trigger_area"));
162 $form->addCommandButton("saveArea", $lng->txt("save"));
163 }
164 else
165 {
166 $form->setTitle($lng->txt("cont_new_area"));
167 $form->addCommandButton("saveArea", $lng->txt("save"));
168 }
169
170 return $form;
171 }
This class represents a property form user interface.
This class represents a text property in a property form.

References $ilCtrl, and $lng.

◆ outputPostProcessing()

ilPCIIMTriggerEditorGUI::outputPostProcessing (   $a_output)

Output post processing.

Parameters

return

Reimplemented from ilImageMapEditorGUI.

Definition at line 290 of file class.ilPCIIMTriggerEditorGUI.php.

291 {
292
293 // for question html get the page gui object
294 include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
295 $pg_gui = new ilPageObjectGUI($this->page->getParentType(), $this->page->getId());
296 $pg_gui->setOutputMode(IL_PAGE_PREVIEW);
297 $pg_gui->getPageConfig()->setEnableSelfAssessment(true);
298// $pg_gui->initSelfAssessmentRendering(true); // todo: solve in other way
299 $qhtml = $pg_gui->getQuestionHTML();
300 if (is_array($qhtml))
301 {
302 foreach ($qhtml as $k => $h)
303 {
304 $a_output = str_replace($pg_gui->pl_start."Question;il__qst_$k".$pg_gui->pl_end, " ".$h, $a_output);
305 }
306 }
307// $a_output = $pg_gui->selfAssessmentRendering($a_output);
308
309 return $a_output;
310 }
const IL_PAGE_PREVIEW
Class ilPageObjectGUI.
$h

References $h, and IL_PAGE_PREVIEW.

◆ saveArea()

ilPCIIMTriggerEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilPCImageMapEditorGUI.

Definition at line 176 of file class.ilPCIIMTriggerEditorGUI.php.

177 {
178 global $lng, $ilCtrl;
179
180 switch ($_SESSION["il_map_edit_mode"])
181 {
182 // save edited shape
183 case "edit_shape":
184 $this->std_alias_item->setShape($_SESSION["il_map_area_nr"],
185 $_SESSION["il_map_edit_area_type"], $_SESSION["il_map_edit_coords"]);
186 $this->updated = $this->page->update();
187 break;
188
189 // save new area
190 default:
191 $area_type = $_SESSION["il_map_edit_area_type"];
192 $coords = $_SESSION["il_map_edit_coords"];
193 $this->content_obj->addTriggerArea($this->std_alias_item,
194 $area_type, $coords,
195 ilUtil::stripSlashes($_POST["area_name"]), $link);
196 $this->updated = $this->page->update();
197 break;
198 }
199
200 //$this->initMapParameters();
201 ilUtil::sendSuccess($lng->txt("cont_saved_map_area"), true);
202 $ilCtrl->redirect($this, "editMapAreas");
203 }
$_SESSION["AccountId"]
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, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ updateTrigger()

ilPCIIMTriggerEditorGUI::updateTrigger ( )

Update trigger.

Definition at line 208 of file class.ilPCIIMTriggerEditorGUI.php.

209 {
210 global $lng, $ilCtrl;
211
212 $this->content_obj->setTriggerOverlays($_POST["ov"]);
213 $this->content_obj->setTriggerPopups($_POST["pop"]);
214 $this->content_obj->setTriggerOverlayPositions($_POST["ovpos"]);
215 $this->content_obj->setTriggerMarkerPositions($_POST["markpos"]);
216 $this->content_obj->setTriggerPopupPositions($_POST["poppos"]);
217 $this->content_obj->setTriggerPopupSize($_POST["popsize"]);
218 $this->content_obj->setTriggerTitles($_POST["title"]);
219 $this->updated = $this->page->update();
220 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
221 $ilCtrl->redirect($this, "editMapAreas");
222 }

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

+ Here is the call graph for this function:

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