ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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$

ilPCIIMTriggerEditorGUI: ilInternalLinkGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCIIMTriggerEditorGUI::__construct (   $a_content_obj,
  $a_page 
)

Constructor.

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

References $DIC, $tpl, ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), and iljQueryUtil\initjQueryUI().

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  }
global $DIC
Definition: saml.php:7
static addJavaScript(ilTemplate $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.txt for included components)
+ Here is the call graph for this function:

Member Function Documentation

◆ addNewArea()

ilPCIIMTriggerEditorGUI::addNewArea ( )

Add new area.

Parameters

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

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

153  {
155  $lng = $this->lng;
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  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ confirmDeleteTrigger()

ilPCIIMTriggerEditorGUI::confirmDeleteTrigger ( )

Confirm trigger deletion.

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

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

266  {
268  $tpl = $this->tpl;
269  $lng = $this->lng;
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 
286  $tpl->setContent($cgui->getHTML());
287  }
288  }
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$i
Definition: disco.tpl.php:19
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteTrigger()

ilPCIIMTriggerEditorGUI::deleteTrigger ( )

Delete trigger.

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

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

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

◆ getAdditionalPageXML()

ilPCIIMTriggerEditorGUI::getAdditionalPageXML ( )

Get additional page xml (to be overwritten)

Returns
string additional page xml

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

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

◆ getEditorTitle()

ilPCIIMTriggerEditorGUI::getEditorTitle ( )

Get editor title.

Returns
string editor title

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

References $lng.

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

◆ getImageMapTableHTML()

ilPCIIMTriggerEditorGUI::getImageMapTableHTML ( )

Get trigger table.

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

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

91  {
92  $tpl = $this->tpl;
93  $ilToolbar = $this->toolbar;
94  $lng = $this->lng;
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  }
global $ilCtrl
Definition: ilias.php:18
TableGUI class for pc image map editor.
getParentNodeName()
Get parent node name.
+ Here is the call graph for this function:

◆ getParentNodeName()

ilPCIIMTriggerEditorGUI::getParentNodeName ( )

Get parent node name.

Returns
string name of parent node

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

Referenced by getImageMapTableHTML().

71  {
72  return "InteractiveImage";
73  }
+ Here is the caller graph for this function:

◆ getToolbar()

ilPCIIMTriggerEditorGUI::getToolbar ( )

Get toolbar.

Returns
object toolbar

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

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

124  {
126  $lng = $this->lng;
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.
global $ilCtrl
Definition: ilias.php:18
setOptions($a_options)
Set Options.
+ Here is the call graph for this function:

◆ initAreaEditingForm()

ilPCIIMTriggerEditorGUI::initAreaEditingForm (   $a_edit_property)

Init area editing form.

Parameters
int$a_modeEdit Mode

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

References $ctrl, $form, $ilCtrl, $lng, and ilTextInputGUI\setMaxLength().

173  {
174  $lng = $this->lng;
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.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ Here is the call graph for this function:

◆ outputPostProcessing()

ilPCIIMTriggerEditorGUI::outputPostProcessing (   $a_output)

Output post processing.

Parameters

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

References $h, IL_PAGE_PREVIEW, and ilPageObjectGUI\setOutputMode().

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

◆ saveArea()

ilPCIIMTriggerEditorGUI::saveArea ( )

Save new or updated map area.

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

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

207  {
208  $lng = $this->lng;
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"]
$coords
Definition: example_030.php:88
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ updateTrigger()

ilPCIIMTriggerEditorGUI::updateTrigger ( )

Update trigger.

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

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

246  {
247  $lng = $this->lng;
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  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

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: