ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 getParentNodeName ()
 Get parent node name.
 getEditorTitle ()
 Get editor title.
 getImageMapTableHTML ()
 Get trigger table.
 getToolbar ()
 Get toolbar.
 addNewArea ()
 Add new area.
 initAreaEditingForm ($a_edit_property)
 Init area editing form.
 saveArea ()
 Save new or updated map area.
 updateTrigger ()
 Update trigger.
 confirmDeleteTrigger ()
 Confirm trigger deletion.
 deleteTrigger ()
 Delete trigger.
 getAdditionalPageXML ()
 Get additional page xml (to be overwritten)
 outputPostProcessing ($a_output)
 Output post processing.
- Public Member Functions inherited from ilPCImageMapEditorGUI
 deleteAreas ()
 Delete map areas.
 getLinkTypeOfArea ($a_nr)
 Get Link Type of Area.
 getTypeOfArea ($a_nr)
 Get Type of Area (only internal link)
 getTargetOfArea ($a_nr)
 Get Target of Area (only internal link)
 getTargetFrameOfArea ($a_nr)
 Get TargetFrame of Area (only internal link)
 getHrefOfArea ($a_nr)
 Get Href of Area (only external link)
 updateAreas ()
 Update map areas.
 makeMapWorkCopy ($a_edit_property="", $a_area_nr=0, $a_output_new_area=false, $a_area_type="", $a_coords="")
 Make work file for editing.
 getAliasXML ()
- Public Member Functions inherited from ilImageMapEditorGUI
 __construct ($a_media_object)
 Constructor.
 executeCommand ()
 Execute current command.
 editMapAreas ()
 Show map areas.
 handleMapParameters ()
 handle parameter during map area editing (storing to session)
 showImageMap ()
 show image map
 linkWholePicture ()
 Link the whole picture.
 addRectangle ()
 Add a new rectangle.
 addCircle ()
 Add a new circle.
 addPolygon ()
 Add a new polygon.
 clearSessionVars ()
 Clear Session Vars.
 addArea ($a_handle=true)
 Handle adding new area process.
 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.
 getImageMapOutput ($a_map_edit_mode="")
 Render the image map.
 getMapAreaLinkString ($a_target, $a_type, $a_frame)
 Get text name of internal link.
 editImagemapForward ()
 Get image map coordinates.
 _recoverParameters ()
 Recover parameters from session variables (static)
 setInternalLink ()
 Set internal link.
 setLink ($a_handle=true)
 Set link.
 editLink ()
 Edit existing link.
 editShapeWholePicture ()
 Edit an existing shape (make it a whole picture link)
 editShapeRectangle ()
 Edit an existing shape (make it a rectangle)
 editShapeCircle ()
 Edit an existing shape (make it a circle)
 editShapePolygon ()
 Edit an existing shape (make it a polygon)
 setShape ($a_handle=true)
 edit shape of existing map area
 setHighlight ()
 Set highlight settings.

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

ilPCIIMTriggerEditorGUI::__construct (   $a_content_obj,
  $a_page 
)

Constructor.

Reimplemented from ilPCImageMapEditorGUI.

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

References $tpl.

{
global $tpl;
$tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
parent::__construct($a_content_obj, $a_page);
}

Member Function Documentation

ilPCIIMTriggerEditorGUI::addNewArea ( )

Add new area.

Parameters
@return

Reimplemented from ilImageMapEditorGUI.

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

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

{
global $ilCtrl, $lng;
if ($_POST["shape"] == "Marker")
{
$this->content_obj->addTriggerMarker();
$this->updated = $this->page->update();
ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
$ilCtrl->redirect($this, "editMapAreas");
}
else
{
}
}

+ Here is the call graph for this function:

ilPCIIMTriggerEditorGUI::confirmDeleteTrigger ( )

Confirm trigger deletion.

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

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

{
global $ilCtrl, $tpl, $lng;
if (!is_array($_POST["tr"]) || count($_POST["tr"]) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "editMapAreas");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("cont_really_delete_triggers"));
$cgui->setCancel($lng->txt("cancel"), "editMapAreas");
$cgui->setConfirm($lng->txt("delete"), "deleteTrigger");
foreach ($_POST["tr"] as $i)
{
$cgui->addItem("tr[]", $i, $_POST["title"][$i]);
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilPCIIMTriggerEditorGUI::deleteTrigger ( )

Delete trigger.

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

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

{
global $ilCtrl, $lng;
if (is_array($_POST["tr"]) && count($_POST["tr"]) > 0)
{
foreach ($_POST["tr"] as $tr_nr)
{
$this->content_obj->deleteTrigger($this->std_alias_item, $tr_nr);
}
$this->updated = $this->page->update();
ilUtil::sendSuccess($lng->txt("cont_areas_deleted"), true);
}
$ilCtrl->redirect($this, "editMapAreas");
}

+ Here is the call graph for this function:

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.

{
return $this->page->getMultimediaXML();
}
ilPCIIMTriggerEditorGUI::getEditorTitle ( )

Get editor title.

Returns
string editor title

Reimplemented from ilImageMapEditorGUI.

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

References $lng.

{
global $lng;
return $lng->txt("cont_pc_iim");
}
ilPCIIMTriggerEditorGUI::getImageMapTableHTML ( )

Get trigger table.

Reimplemented from ilPCImageMapEditorGUI.

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

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

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
$tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
$tpl->addJavascript("./Services/COPage/js/ilCOPagePCInteractiveImage.js");
include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
$ilToolbar->addText($lng->txt("cont_drag_element_click_save"));
$ilToolbar->setId("drag_toolbar");
$ilToolbar->setHidden(true);
$ilToolbar->addButton($lng->txt("save"),"#", "", "", "", "save_pos_button");
$ilToolbar->addButton($lng->txt("cancel"),
$ilCtrl->getLinkTarget($this, "editMapAreas"));
include_once("./Services/COPage/classes/class.ilPCIIMTriggerTableGUI.php");
$image_map_table = new ilPCIIMTriggerTableGUI($this, "editMapAreas", $this->content_obj,
$this->getParentNodeName());
return $image_map_table->getHTML();
}

+ Here is the call graph for this function:

ilPCIIMTriggerEditorGUI::getParentNodeName ( )

Get parent node name.

Returns
string name of parent node

Reimplemented from ilPCImageMapEditorGUI.

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

Referenced by getImageMapTableHTML().

{
return "InteractiveImage";
}

+ Here is the caller graph for this function:

ilPCIIMTriggerEditorGUI::getToolbar ( )

Get toolbar.

Returns
object toolbar

Reimplemented from ilImageMapEditorGUI.

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

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

{
global $ilCtrl, $lng;
// toolbar
$tb = new ilToolbarGUI();
$tb->setFormAction($ilCtrl->getFormAction($this));
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$options = array(
"Rect" => $lng->txt("cont_Rect"),
"Circle" => $lng->txt("cont_Circle"),
"Poly" => $lng->txt("cont_Poly"),
"Marker" => $lng->txt("cont_marker")
);
$si = new ilSelectInputGUI($lng->txt("cont_trigger_area"), "shape");
$tb->addInputItem($si, true);
$tb->addFormButton($lng->txt("add"), "addNewArea");
return $tb;
}

+ Here is the call graph for this function:

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.

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setOpenTag(false);
$form->setCloseTag(false);
// name
if ($a_edit_property != "link" && $a_edit_property != "shape")
{
$ti = new ilTextInputGUI($lng->txt("cont_name"), "area_name");
$ti->setMaxLength(200);
$ti->setSize(20);
$ti->setRequired(true);
$form->addItem($ti);
}
// save and cancel commands
if ($a_edit_property == "")
{
$form->setTitle($lng->txt("cont_new_trigger_area"));
$form->addCommandButton("saveArea", $lng->txt("save"));
}
else
{
$form->setTitle($lng->txt("cont_new_area"));
$form->addCommandButton("saveArea", $lng->txt("save"));
}
return $form;
}

+ Here is the call graph for this function:

ilPCIIMTriggerEditorGUI::outputPostProcessing (   $a_output)

Output post processing.

Parameters
@return

Reimplemented from ilImageMapEditorGUI.

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

References IL_PAGE_PREVIEW, and ilPageObjectGUI\setOutputMode().

{
// for question html get the page gui object
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
$pg_gui = new ilPageObjectGUI($this->page->getParentType(), $this->page->getId());
$pg_gui->getPageConfig()->setEnableSelfAssessment(true);
// $pg_gui->initSelfAssessmentRendering(true); // todo: solve in other way
$qhtml = $pg_gui->getQuestionHTML();
if (is_array($qhtml))
{
foreach ($qhtml as $k => $h)
{
$a_output = str_replace($pg_gui->pl_start."Question;il__qst_$k".$pg_gui->pl_end, " ".$h, $a_output);
}
}
// $a_output = $pg_gui->selfAssessmentRendering($a_output);
return $a_output;
}

+ Here is the call graph for this function:

ilPCIIMTriggerEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilPCImageMapEditorGUI.

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

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

{
global $lng, $ilCtrl;
switch ($_SESSION["il_map_edit_mode"])
{
// save edited shape
case "edit_shape":
$this->std_alias_item->setShape($_SESSION["il_map_area_nr"],
$_SESSION["il_map_edit_area_type"], $_SESSION["il_map_edit_coords"]);
$this->updated = $this->page->update();
break;
// save new area
default:
$area_type = $_SESSION["il_map_edit_area_type"];
$coords = $_SESSION["il_map_edit_coords"];
$this->content_obj->addTriggerArea($this->std_alias_item,
$area_type, $coords,
ilUtil::stripSlashes($_POST["area_name"]), $link);
$this->updated = $this->page->update();
break;
}
//$this->initMapParameters();
ilUtil::sendSuccess($lng->txt("cont_saved_map_area"), true);
$ilCtrl->redirect($this, "editMapAreas");
}

+ Here is the call graph for this function:

ilPCIIMTriggerEditorGUI::updateTrigger ( )

Update trigger.

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

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

{
global $lng, $ilCtrl;
$this->content_obj->setTriggerOverlays($_POST["ov"]);
$this->content_obj->setTriggerPopups($_POST["pop"]);
$this->content_obj->setTriggerOverlayPositions($_POST["ovpos"]);
$this->content_obj->setTriggerMarkerPositions($_POST["markpos"]);
$this->content_obj->setTriggerPopupPositions($_POST["poppos"]);
$this->content_obj->setTriggerPopupSize($_POST["popsize"]);
$this->content_obj->setTriggerTitles($_POST["title"]);
$this->updated = $this->page->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "editMapAreas");
}

+ Here is the call graph for this function:


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