ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 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

 $tpl
 
 $lng
 
 $toolbar
 
 $ctrl
 
- Protected Attributes inherited from ilPCImageMapEditorGUI
 $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$

@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 42 of file class.ilPCIIMTriggerEditorGUI.php.

43 {
44 global $DIC;
45
46 $this->tpl = $DIC["tpl"];
47 $this->lng = $DIC->language();
48 $this->toolbar = $DIC->toolbar();
49 $this->ctrl = $DIC->ctrl();
50 $tpl = $DIC["tpl"];
51
52 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
54
55 $tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
56 $tpl->addJavascript("./Services/COPage/js/ilCOPagePCInteractiveImage.js");
57
58 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
61
62 parent::__construct($a_content_obj, $a_page);
63 }
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, $tpl, ILIAS\GlobalScreen\Provider\__construct(), ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), and iljQueryUtil\initjQueryUI().

+ Here is the call graph for this function:

Member Function Documentation

◆ addNewArea()

ilPCIIMTriggerEditorGUI::addNewArea ( )

Add new area.

Parameters

return

Reimplemented from ilImageMapEditorGUI.

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

153 {
156
157 if ($_POST["shape"] == "Marker") {
158 $this->content_obj->addTriggerMarker();
159 $this->updated = $this->page->update();
160 ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
161 $ilCtrl->redirect($this, "editMapAreas");
162 } else {
163 return parent::addNewArea();
164 }
165 }
$_POST["username"]
global $ilCtrl
Definition: ilias.php:18

References $_POST, $ctrl, $ilCtrl, and $lng.

◆ confirmDeleteTrigger()

ilPCIIMTriggerEditorGUI::confirmDeleteTrigger ( )

Confirm trigger deletion.

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

266 {
270
271 if (!is_array($_POST["tr"]) || count($_POST["tr"]) == 0) {
272 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
273 $ilCtrl->redirect($this, "editMapAreas");
274 } else {
275 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
276 $cgui = new ilConfirmationGUI();
277 $cgui->setFormAction($ilCtrl->getFormAction($this));
278 $cgui->setHeaderText($lng->txt("cont_really_delete_triggers"));
279 $cgui->setCancel($lng->txt("cancel"), "editMapAreas");
280 $cgui->setConfirm($lng->txt("delete"), "deleteTrigger");
281
282 foreach ($_POST["tr"] as $i) {
283 $cgui->addItem("tr[]", $i, $_POST["title"][$i]);
284 }
285 $tpl->setContent($cgui->getHTML());
286 }
287 }
Confirmation screen class.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$i
Definition: metadata.php:24

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

+ Here is the call graph for this function:

◆ deleteTrigger()

ilPCIIMTriggerEditorGUI::deleteTrigger ( )

Delete trigger.

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

293 {
296
297 if (is_array($_POST["tr"]) && count($_POST["tr"]) > 0) {
298 foreach ($_POST["tr"] as $tr_nr) {
299 $this->content_obj->deleteTrigger($this->std_alias_item, $tr_nr);
300 }
301 $this->updated = $this->page->update();
302 ilUtil::sendSuccess($lng->txt("cont_areas_deleted"), true);
303 }
304
305 $ilCtrl->redirect($this, "editMapAreas");
306 }

References $_POST, $ctrl, $ilCtrl, and $lng.

◆ getAdditionalPageXML()

ilPCIIMTriggerEditorGUI::getAdditionalPageXML ( )

Get additional page xml (to be overwritten)

Returns
string additional page xml

Reimplemented from ilImageMapEditorGUI.

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

314 {
315 return $this->page->getMultimediaXML();
316 }

◆ getEditorTitle()

ilPCIIMTriggerEditorGUI::getEditorTitle ( )

Get editor title.

Returns
string editor title

Reimplemented from ilImageMapEditorGUI.

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

81 {
83
84 return $lng->txt("cont_pc_iim");
85 }

References $lng.

◆ getImageMapTableHTML()

ilPCIIMTriggerEditorGUI::getImageMapTableHTML ( )

Get trigger table.

Reimplemented from ilPCImageMapEditorGUI.

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

91 {
93 $ilToolbar = $this->toolbar;
96
97
98 $ilToolbar->addText($lng->txt("cont_drag_element_click_save"));
99 $ilToolbar->setId("drag_toolbar");
100 $ilToolbar->setHidden(true);
101 $ilToolbar->addButton($lng->txt("save"), "#", "", "", "", "save_pos_button");
102
103 $ilToolbar->addButton(
104 $lng->txt("cancel"),
105 $ilCtrl->getLinkTarget($this, "editMapAreas")
106 );
107
108 include_once("./Services/COPage/classes/class.ilPCIIMTriggerTableGUI.php");
109 $image_map_table = new ilPCIIMTriggerTableGUI(
110 $this,
111 "editMapAreas",
112 $this->content_obj,
113 $this->getParentNodeName()
114 );
115 return $image_map_table->getHTML();
116 }
getParentNodeName()
Get parent node name.
TableGUI class for pc image map editor.

References $ctrl, $ilCtrl, $lng, $toolbar, $tpl, and getParentNodeName().

+ 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 70 of file class.ilPCIIMTriggerEditorGUI.php.

71 {
72 return "InteractiveImage";
73 }

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 123 of file class.ilPCIIMTriggerEditorGUI.php.

124 {
127
128 // toolbar
129 $tb = new ilToolbarGUI();
130 $tb->setFormAction($ilCtrl->getFormAction($this));
131 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
132 $options = array(
133 "Rect" => $lng->txt("cont_Rect"),
134 "Circle" => $lng->txt("cont_Circle"),
135 "Poly" => $lng->txt("cont_Poly"),
136 "Marker" => $lng->txt("cont_marker")
137 );
138 $si = new ilSelectInputGUI($lng->txt("cont_trigger_area"), "shape");
139 $si->setOptions($options);
140 $tb->addInputItem($si, true);
141 $tb->addFormButton($lng->txt("add"), "addNewArea");
142
143 return $tb;
144 }
This class represents a selection list property in a property form.

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

◆ initAreaEditingForm()

ilPCIIMTriggerEditorGUI::initAreaEditingForm (   $a_edit_property)

Init area editing form.

Parameters
int$a_modeEdit Mode

Reimplemented from ilImageMapEditorGUI.

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

173 {
176
177 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
178 $form = new ilPropertyFormGUI();
179 $form->setOpenTag(false);
180 $form->setCloseTag(false);
181
182 // name
183 if ($a_edit_property != "link" && $a_edit_property != "shape") {
184 $ti = new ilTextInputGUI($lng->txt("cont_name"), "area_name");
185 $ti->setMaxLength(200);
186 $ti->setSize(20);
187 //$ti->setRequired(true);
188 $form->addItem($ti);
189 }
190
191 // save and cancel commands
192 if ($a_edit_property == "") {
193 $form->setTitle($lng->txt("cont_new_trigger_area"));
194 $form->addCommandButton("saveArea", $lng->txt("save"));
195 } else {
196 $form->setTitle($lng->txt("cont_new_area"));
197 $form->addCommandButton("saveArea", $lng->txt("save"));
198 }
199
200 return $form;
201 }
This class represents a property form user interface.
This class represents a text property in a property form.

References $ctrl, $ilCtrl, and $lng.

◆ outputPostProcessing()

ilPCIIMTriggerEditorGUI::outputPostProcessing (   $a_output)

Output post processing.

Parameters

return

Reimplemented from ilImageMapEditorGUI.

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

325 {
326
327 // for question html get the page gui object
328 include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
329 $pg_gui = new ilPageObjectGUI($this->page->getParentType(), $this->page->getId());
330 $pg_gui->setOutputMode(ilPageObjectGUI::PREVIEW);
331 $pg_gui->getPageConfig()->setEnableSelfAssessment(true);
332 // $pg_gui->initSelfAssessmentRendering(true); // todo: solve in other way
333 $qhtml = $pg_gui->getQuestionHTML();
334 if (is_array($qhtml)) {
335 foreach ($qhtml as $k => $h) {
336 $a_output = str_replace($pg_gui->pl_start . "Question;il__qst_$k" . $pg_gui->pl_end, " " . $h, $a_output);
337 }
338 }
339 // $a_output = $pg_gui->selfAssessmentRendering($a_output);
340
341 return $a_output;
342 }
Class ilPageObjectGUI.

References ilPageObjectGUI\PREVIEW.

◆ saveArea()

ilPCIIMTriggerEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilPCImageMapEditorGUI.

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

207 {
210
211 switch ($_SESSION["il_map_edit_mode"]) {
212 // save edited shape
213 case "edit_shape":
214 $this->std_alias_item->setShape(
215 $_SESSION["il_map_area_nr"],
216 $_SESSION["il_map_edit_area_type"],
217 $_SESSION["il_map_edit_coords"]
218 );
219 $this->updated = $this->page->update();
220 break;
221
222 // save new area
223 default:
224 $area_type = $_SESSION["il_map_edit_area_type"];
225 $coords = $_SESSION["il_map_edit_coords"];
226 $this->content_obj->addTriggerArea(
227 $this->std_alias_item,
228 $area_type,
229 $coords,
230 ilUtil::stripSlashes($_POST["area_name"]),
231 $link
232 );
233 $this->updated = $this->page->update();
234 break;
235 }
236
237 //$this->initMapParameters();
238 ilUtil::sendSuccess($lng->txt("cont_saved_map_area"), true);
239 $ilCtrl->redirect($this, "editMapAreas");
240 }
$_SESSION["AccountId"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ updateTrigger()

ilPCIIMTriggerEditorGUI::updateTrigger ( )

Update trigger.

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

246 {
249
250 $this->content_obj->setTriggerOverlays($_POST["ov"]);
251 $this->content_obj->setTriggerPopups($_POST["pop"]);
252 $this->content_obj->setTriggerOverlayPositions($_POST["ovpos"]);
253 $this->content_obj->setTriggerMarkerPositions($_POST["markpos"]);
254 $this->content_obj->setTriggerPopupPositions($_POST["poppos"]);
255 $this->content_obj->setTriggerPopupSize($_POST["popsize"]);
256 $this->content_obj->setTriggerTitles($_POST["title"]);
257 $this->updated = $this->page->update();
258 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
259 $ilCtrl->redirect($this, "editMapAreas");
260 }

References $_POST, $ctrl, $ilCtrl, and $lng.

Field Documentation

◆ $ctrl

◆ $lng

◆ $toolbar

ilPCIIMTriggerEditorGUI::$toolbar
protected

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

Referenced by getImageMapTableHTML().

◆ $tpl

ilPCIIMTriggerEditorGUI::$tpl
protected

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