ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 getParentNodeName ()
 Get parent node name.
 getImageMapTableHTML ()
 Get table HTML.
 saveArea ()
 Save new or updated map area.
 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.
 getToolbar ()
 Get toolbar.
 getEditorTitle ()
 Get editor title.
 handleMapParameters ()
 handle parameter during map area editing (storing to session)
 showImageMap ()
 show image map
 addNewArea ()
 Add area.
 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.
 initAreaEditingForm ($a_edit_property)
 Init area editing form.
 getImageMapOutput ($a_map_edit_mode="")
 Render the image map.
 getAdditionalPageXML ()
 Get additional page xml (to be overwritten)
 outputPostProcessing ($a_output)
 Output post processing.
 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$

ilPCImageMapEditorGUI: ilInternalLinkGUI

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

Constructor & Destructor Documentation

ilPCImageMapEditorGUI::__construct (   $a_content_obj,
  $a_page 
)

Constructor.

Reimplemented in ilPCIIMTriggerEditorGUI.

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

References getParentNodeName().

{
$this->content_obj = $a_content_obj;
$this->page = $a_page;
parent::__construct($a_content_obj->getMediaObject());
$this->std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
$this->content_obj->hier_id, "Standard", $this->content_obj->getPcId(),
$this->getParentNodeName());
}

+ Here is the call graph for this function:

Member Function Documentation

ilPCImageMapEditorGUI::deleteAreas ( )

Delete map areas.

Reimplemented from ilImageMapEditorGUI.

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

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

{
global $ilCtrl, $lng;
if (!isset($_POST["area"]))
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "editMapAreas");
}
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
if (count($_POST["area"]) > 0)
{
$i = 0;
arsort($_POST["area"]);
foreach ($_POST["area"] as $area_nr)
{
$this->std_alias_item->deleteMapArea($area_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:

ilPCImageMapEditorGUI::getAliasXML ( )

Reimplemented from ilImageMapEditorGUI.

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

{
return $this->content_obj->dumpXML();
}
ilPCImageMapEditorGUI::getHrefOfArea (   $a_nr)

Get Href of Area (only external link)

Reimplemented from ilImageMapEditorGUI.

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

{
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
return $this->std_alias_item->getHrefOfArea($a_nr);
}
ilPCImageMapEditorGUI::getImageMapTableHTML ( )

Get table HTML.

Reimplemented from ilImageMapEditorGUI.

Reimplemented in ilPCIIMTriggerEditorGUI.

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

References getParentNodeName().

{
include_once("./Services/COPage/classes/class.ilPCImageMapTableGUI.php");
$image_map_table = new ilPCImageMapTableGUI($this, "editMapAreas", $this->content_obj,
$this->getParentNodeName());
return $image_map_table->getHTML();
}

+ Here is the call graph for this function:

ilPCImageMapEditorGUI::getLinkTypeOfArea (   $a_nr)

Get Link Type of Area.

Reimplemented from ilImageMapEditorGUI.

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

{
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
return $this->std_alias_item->getLinkTypeOfArea($a_nr);
}
ilPCImageMapEditorGUI::getParentNodeName ( )

Get parent node name.

Returns
string name of parent node

Reimplemented in ilPCIIMTriggerEditorGUI.

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

Referenced by __construct(), getImageMapTableHTML(), and makeMapWorkCopy().

{
return "MediaObject";
}

+ Here is the caller graph for this function:

ilPCImageMapEditorGUI::getTargetFrameOfArea (   $a_nr)

Get TargetFrame of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

{
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
return $this->std_alias_item->getTargetFrameOfArea($a_nr);
}
ilPCImageMapEditorGUI::getTargetOfArea (   $a_nr)

Get Target of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

{
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
return $this->std_alias_item->getTargetOfArea($a_nr);
}
ilPCImageMapEditorGUI::getTypeOfArea (   $a_nr)

Get Type of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

{
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
return $this->std_alias_item->getTypeOfArea($a_nr);
}
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.

References getParentNodeName(), and ilMediaAliasItem\makeMapWorkCopy().

{
// old for pc media object
// $media_object = $this->media_object->getMediaItem("Standard");
$media_object = $this->content_obj->getMediaObject();
// create/update imagemap work copy
$st_item = $media_object->getMediaItem("Standard");
$st_alias_item = new ilMediaAliasItem($this->content_obj->dom,
$this->content_obj->hier_id, "Standard", $this->content_obj->getPcId(),
$this->getParentNodeName());
if ($a_edit_property == "shape")
{
$st_alias_item->makeMapWorkCopy($st_item, $a_area_nr, true,
$a_output_new_area, $a_area_type, $a_coords); // exclude area currently being edited
}
else
{
$st_alias_item->makeMapWorkCopy($st_item, $a_area_nr, false,
$a_output_new_area, $a_area_type, $a_coords);
}
}

+ Here is the call graph for this function:

ilPCImageMapEditorGUI::saveArea ( )

Save new or updated map area.

Reimplemented from ilImageMapEditorGUI.

Reimplemented in ilPCIIMTriggerEditorGUI.

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

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

{
global $lng, $ilCtrl;
switch ($_SESSION["il_map_edit_mode"])
{
// save edited link
case "edit_link":
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
if ($_POST["area_link_type"] == IL_INT_LINK)
{
$this->std_alias_item->setAreaIntLink($_SESSION["il_map_area_nr"],
$_SESSION["il_map_il_type"], $_SESSION["il_map_il_target"],
$_SESSION["il_map_il_targetframe"]);
}
else if ($_POST["area_link_type"] == IL_NO_LINK)
{
$this->std_alias_item->setAreaExtLink($_SESSION["il_map_area_nr"],
"");
}
else
{
$this->std_alias_item->setAreaExtLink($_SESSION["il_map_area_nr"],
ilUtil::stripSlashes($_POST["area_link_ext"]));
}
$this->updated = $this->page->update();
break;
// save edited shape
case "edit_shape":
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
$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"];
switch($_POST["area_link_type"])
{
$link = array(
"LinkType" => IL_EXT_LINK,
"Href" => ilUtil::stripSlashes($_POST["area_link_ext"]));
break;
case IL_NO_LINK:
$link = array(
"LinkType" => IL_EXT_LINK,
"Href" => "");
break;
$link = array(
"LinkType" => IL_INT_LINK,
"Type" => $_SESSION["il_map_il_type"],
"Target" => $_SESSION["il_map_il_target"],
"TargetFrame" => $_SESSION["il_map_il_targetframe"]);
break;
}
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
$this->std_alias_item->addMapArea($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:

ilPCImageMapEditorGUI::updateAreas ( )

Update map areas.

Reimplemented from ilImageMapEditorGUI.

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

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

{
global $lng, $ilCtrl;
// $std_alias_item = new ilMediaAliasItem($this->content_obj->dom,
// $this->content_obj->hier_id, "Standard", $this->content_obj->getPcId());
$areas = $this->std_alias_item->getMapAreas();
foreach($areas as $area)
{
$this->std_alias_item->setAreaTitle($area["Nr"],
ilUtil::stripSlashes($_POST["name_".$area["Nr"]]));
$this->std_alias_item->setAreaHighlightMode($area["Nr"],
ilUtil::stripSlashes($_POST["hl_mode_".$area["Nr"]]));
$this->std_alias_item->setAreaHighlightClass($area["Nr"],
ilUtil::stripSlashes($_POST["hl_class_".$area["Nr"]]));
}
$this->page->update();
ilUtil::sendSuccess($lng->txt("cont_saved_map_data"), true);
$ilCtrl->redirect($this, "editMapAreas");
}

+ Here is the call graph for this function:


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