ILIAS  eassessment Revision 61809
 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_pc_media_object, $a_page)
 Constructor.
 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.
 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

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 16 of file class.ilPCImageMapEditorGUI.php.

Constructor & Destructor Documentation

ilPCImageMapEditorGUI::__construct (   $a_pc_media_object,
  $a_page 
)

Constructor.

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

{
$this->pc_media_object = $a_pc_media_object;
$this->page = $a_page;
parent::__construct($a_pc_media_object->getMediaObject());
}

Member Function Documentation

ilPCImageMapEditorGUI::deleteAreas ( )

Delete map areas.

Reimplemented from ilImageMapEditorGUI.

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

References $_POST, $ilCtrl, $lng, ilMediaAliasItem\deleteMapArea(), 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->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
if (count($_POST["area"]) > 0)
{
$i = 0;
foreach ($_POST["area"] as $area_nr)
{
$std_alias_item->deleteMapArea($area_nr - $i);
$i++;
}
$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 238 of file class.ilPCImageMapEditorGUI.php.

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

Get Href of Area (only external link)

Reimplemented from ilImageMapEditorGUI.

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

References ilMediaAliasItem\getHrefOfArea().

{
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
return $std_alias_item->getHrefOfArea($a_nr);
}

+ Here is the call graph for this function:

ilPCImageMapEditorGUI::getImageMapTableHTML ( )

Get table HTML.

Reimplemented from ilImageMapEditorGUI.

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

{
include_once("./Services/COPage/classes/class.ilPCImageMapTableGUI.php");
$image_map_table = new ilPCImageMapTableGUI($this, "editMapAreas", $this->pc_media_object);
return $image_map_table->getHTML();
}
ilPCImageMapEditorGUI::getLinkTypeOfArea (   $a_nr)

Get Link Type of Area.

Reimplemented from ilImageMapEditorGUI.

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

References ilMediaAliasItem\getLinkTypeOfArea().

{
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
return $std_alias_item->getLinkTypeOfArea($a_nr);
}

+ Here is the call graph for this function:

ilPCImageMapEditorGUI::getTargetFrameOfArea (   $a_nr)

Get TargetFrame of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

References ilMediaAliasItem\getTargetFrameOfArea().

{
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
return $std_alias_item->getTargetFrameOfArea($a_nr);
}

+ Here is the call graph for this function:

ilPCImageMapEditorGUI::getTargetOfArea (   $a_nr)

Get Target of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

References ilMediaAliasItem\getTargetOfArea().

{
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
return $std_alias_item->getTargetOfArea($a_nr);
}

+ Here is the call graph for this function:

ilPCImageMapEditorGUI::getTypeOfArea (   $a_nr)

Get Type of Area (only internal link)

Reimplemented from ilImageMapEditorGUI.

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

References ilMediaAliasItem\getTypeOfArea().

{
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
return $std_alias_item->getTypeOfArea($a_nr);
}

+ Here is the call graph for this function:

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 218 of file class.ilPCImageMapEditorGUI.php.

References ilMediaAliasItem\makeMapWorkCopy().

{
// create/update imagemap work copy
$st_item = $this->media_object->getMediaItem("Standard");
$st_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
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.

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

References $_POST, $_SESSION, $ilCtrl, $lng, ilMediaAliasItem\addMapArea(), IL_EXT_LINK, IL_INT_LINK, ilUtil\sendSuccess(), ilMediaAliasItem\setAreaIntLink(), ilMediaAliasItem\setShape(), and ilUtil\stripSlashes().

{
global $lng, $ilCtrl;
switch ($_SESSION["il_map_edit_mode"])
{
// save edited link
case "edit_link":
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
if ($_POST["area_link_type"] == IL_INT_LINK)
{
$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
{
$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->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
$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"])
{
case "ext":
$link = array(
"LinkType" => IL_EXT_LINK,
"Href" => ilUtil::stripSlashes($_POST["area_link_ext"]));
break;
case "int":
$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->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
$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 197 of file class.ilPCImageMapEditorGUI.php.

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

{
global $lng, $ilCtrl;
$std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
$this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
$areas = $std_alias_item->getMapAreas();
foreach($areas as $area)
{
$std_alias_item->setAreaTitle($area["Nr"],
ilUtil::stripSlashes($_POST["name_".$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: