ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMapArea Class Reference

Class ilMapArea. More...

+ Collaboration diagram for ilMapArea:

Public Member Functions

 __construct ($a_item_id=0, $a_nr=0)
 map area More...
 
 create ()
 create persistent map area object in db More...
 
 read ()
 read map area data into object (item id and nr must be set) More...
 
 update ()
 update map area More...
 
 setHighlightMode ($a_val)
 Set highlight mode. More...
 
 getHighlightMode ()
 Get highlight mode. More...
 
 setHighlightClass ($a_val)
 Set highlight class. More...
 
 getHighlightClass ()
 Get highlight class. More...
 
 setItemId ($a_item_id)
 set media item id More...
 
 getItemId ()
 get item id More...
 
 setNr ($a_nr)
 set area number More...
 
 getNr ()
 get area number More...
 
 setShape ($a_shape)
 set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE) More...
 
 getShape ()
 get shape More...
 
 setCoords ($a_coords)
 set coords of area More...
 
 getCoords ()
 get coords More...
 
 setTitle ($a_title)
 set (tooltip)title of area More...
 
 appendTitle ($a_title_str)
 append string to (tooltip) title of area More...
 
 getTitle ()
 get (tooltip) title More...
 
 setLinkType ($a_link_type)
 set link type More...
 
 getLinkType ()
 get link type More...
 
 setHref ($a_href)
 set hyper reference (external link only) More...
 
 getHref ()
 get hyper reference url (external link only) More...
 
 setExtTitle ($a_title)
 set link text (external link only) More...
 
 getExtTitle ()
 get link text (external link only) More...
 
 setTarget ($a_target)
 set link target (internal link only) More...
 
 getTarget ($a_insert_inst=false)
 get link target (internal link only) More...
 
 setType ($a_type)
 set link type (internal link only) More...
 
 getType ()
 get link type (internal link only) More...
 
 setTargetFrame ($a_target_frame)
 set link target frame (internal link only) More...
 
 getTargetFrame ()
 get link target frame (internal link only) More...
 
 draw (&$a_image, $a_col1, $a_col2, $a_close_poly=true, $a_x_ratio=1, $a_y_ratio=1)
 draw image to More...
 
 drawLine (&$im, $x1, $y1, $x2, $y2, $c1, $c2)
 draws an outlined two color line in an image More...
 
 drawRect (&$im, $coords, $c1, $c2, $a_x_ratio=1, $a_y_ratio=1)
 draws an outlined two color rectangle More...
 
 drawPoly (&$im, $coords, $c1, $c2, $closed, $a_x_ratio=1, $a_y_ratio=1)
 draws an outlined two color polygon More...
 
 drawCircle (&$im, $coords, $c1, $c2, $a_x_ratio=1, $a_y_ratio=1)
 draws an outlined two colored circle More...
 

Static Public Member Functions

static _getMaxNr ($a_item_id)
 get maximum nr of media item (static) More...
 
static _resolveIntLinks ($a_item_id)
 resolve internal links of an item id More...
 
static _getIntLinks ($a_item_id)
 get all internal links of a media items map areas More...
 
static _getMobsForTarget ($a_type, $a_target)
 Get areas for a certain target. More...
 
static getAllHighlightModes ()
 Get all highlight modes. More...
 
static getAllHighlightClasses ()
 Get all highlight classes. More...
 
static countCoords ($c)
 count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,x3,y3,...") More...
 

Data Fields

const HL_NONE = ""
 
const HL_HOVER = "Hover"
 
const HL_ALWAYS = "Always"
 
const HLCL_ACCENTED = ""
 
const HLCL_LIGHT = "Light"
 
const HLCL_DARK = "Dark"
 
 $item_id
 
 $nr
 
 $shape
 
 $coords
 
 $title
 
 $linktype
 
 $xl_title
 
 $xl_href
 
 $il_target
 
 $il_type
 
 $il_target_frame
 

Detailed Description

Class ilMapArea.

Map Area of an Image Map, subobject of Media Item

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilMapArea::__construct (   $a_item_id = 0,
  $a_nr = 0 
)

map area

Parameters
int$a_item_idparent media item id
int$a_nrmap area number within media item

Definition at line 64 of file class.ilMapArea.php.

References read(), setItemId(), and setNr().

65  {
66  $this->title = "";
67  if ($a_item_id !=0 && $a_nr != 0)
68  {
69  $this->setItemId($a_item_id);
70  $this->setNr($a_nr);
71  $this->read();
72  }
73  }
read()
read map area data into object (item id and nr must be set)
setNr($a_nr)
set area number
setItemId($a_item_id)
set media item id
+ Here is the call graph for this function:

Member Function Documentation

◆ _getIntLinks()

static ilMapArea::_getIntLinks (   $a_item_id)
static

get all internal links of a media items map areas

Parameters
int$a_item_idmedia item id

Definition at line 207 of file class.ilMapArea.php.

References $ilDB, $target, array, and IL_INT_LINK.

Referenced by ilMediaItem\_getMapAreasIntLinks(), and ilObjMediaObject\getLinkedMediaObjects().

208  {
209  global $ilDB;
210 
211  $q = "SELECT * FROM map_area WHERE item_id = ".
212  $ilDB->quote($a_item_id, "integer");
213  $area_set = $ilDB->query($q);
214 
215  $links = array();
216 
217  while ($area_rec = $ilDB->fetchAssoc($area_set))
218  {
219  $target = $area_rec["target"];
220  $type = $area_rec["type"];
221  $targetframe = $area_rec["target_frame"];
222 
223  if (($area_rec["link_type"] == IL_INT_LINK) && (is_int(strpos($target, "__"))))
224  {
225  $links[$target.":".$type.":".$targetframe] =
226  array("Target" => $target, "Type" => $type,
227  "TargetFrame" => $targetframe);
228  }
229  }
230  return $links;
231  }
const IL_INT_LINK
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _getMaxNr()

static ilMapArea::_getMaxNr (   $a_item_id)
static

get maximum nr of media item (static)

Parameters
int$a_item_iditem id
Returns
int maximum nr

Definition at line 107 of file class.ilMapArea.php.

References $ilDB.

Referenced by ilMediaItem\_getMediaItemsOfMOb(), ilImageMapEditorGUI\deleteAreas(), ilImageMapTableGUI\getItems(), ilMediaItem\read(), ilImageMapEditorGUI\saveArea(), and ilImageMapEditorGUI\updateAreas().

108  {
109  global $ilDB;
110 
111  $q = "SELECT max(nr) AS max_nr FROM map_area WHERE item_id = ".
112  $ilDB->quote($a_item_id, "integer");
113  $max_set = $ilDB->query($q);
114  $max_rec = $ilDB->fetchAssoc($max_set);
115 
116  return $max_rec["max_nr"];
117  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getMobsForTarget()

static ilMapArea::_getMobsForTarget (   $a_type,
  $a_target 
)
static

Get areas for a certain target.

Definition at line 236 of file class.ilMapArea.php.

References $a_type, $ilDB, $mobs, ilMediaItem\_lookupMobId(), and array.

Referenced by ilLMObject\updateInternalLinks().

237  {
238  global $ilDB;
239 
240  $q = "SELECT * FROM map_area WHERE ".
241  " link_type = ".$ilDB->quote($a_type, "text").
242  " AND target = ".$ilDB->quote($a_target, "text");
243  $set = $ilDB->query($q);
244 
245  $mobs = array();
246  while($rec = $ilDB->fetchAssoc($set))
247  {
248  $mob_id = ilMediaItem::_lookupMobId($rec["item_id"]);
249  $mobs[$mob_id] = $mob_id;
250  }
251 
252  return $mobs;
253  }
$a_type
Definition: workflow.php:93
$mobs
static _lookupMobId($a_med_id)
Lookup Mob ID.
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _resolveIntLinks()

static ilMapArea::_resolveIntLinks (   $a_item_id)
static

resolve internal links of an item id

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

References $ilDB, $query, $target, ilInternalLink\_getIdForImportId(), and IL_INT_LINK.

Referenced by ilMediaItem\_resolveMapAreaLinks().

173  {
174  global $ilDB;
175 
176 //echo "maparea::resolve<br>";
177  $q = "SELECT * FROM map_area WHERE item_id = ".
178  $ilDB->quote($a_item_id, "integer");
179  $area_set = $ilDB->query($q);
180  while ($area_rec = $ilDB->fetchAssoc($area_set))
181  {
182  $target = $area_rec["target"];
183  $type = $area_rec["type"];
184  $item_id = $area_rec["item_id"];
185  $nr = $area_rec["nr"];
186 
187  if (($area_rec["link_type"] == IL_INT_LINK) && (!is_int(strpos($target, "__"))))
188  {
189  $new_target = ilInternalLink::_getIdForImportId($type, $target);
190  if ($new_target !== false)
191  {
192  $query = "UPDATE map_area SET ".
193  "target = ".$ilDB->quote($new_target, "text")." ".
194  "WHERE item_id = ".$ilDB->quote($item_id, "integer").
195  " AND nr = ".$ilDB->quote($nr, "integer");
196  $ilDB->manipulate($query);
197  }
198  }
199  }
200  }
const IL_INT_LINK
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendTitle()

ilMapArea::appendTitle (   $a_title_str)

append string to (tooltip) title of area

Parameters
string$a_title_strtitle string

Definition at line 425 of file class.ilMapArea.php.

426  {
427  $this->title.= $a_title_str;
428  }

◆ countCoords()

static ilMapArea::countCoords (   $c)
static

count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,x3,y3,...")

Parameters
string$ccoordinate string
Returns
int number of coordinates

Definition at line 706 of file class.ilMapArea.php.

Referenced by ilImageMapEditorGUI\addArea(), drawPoly(), ilImageMapEditorGUI\editMapArea(), and ilImageMapEditorGUI\setShape().

707  {
708  if ($c == "")
709  {
710  return 0;
711  }
712  else
713  {
714  $coord_array = explode(",", $c);
715  return (count($coord_array) / 2);
716  }
717  }
+ Here is the caller graph for this function:

◆ create()

ilMapArea::create ( )

create persistent map area object in db

Definition at line 78 of file class.ilMapArea.php.

References $ilDB, getCoords(), getHighlightClass(), getHighlightMode(), getHref(), getItemId(), getLinkType(), getNr(), getShape(), getTarget(), getTargetFrame(), getTitle(), and getType().

79  {
80  global $ilDB;
81 
82  $q = "INSERT INTO map_area (item_id, nr, shape, ".
83  "coords, link_type, title, href, target, type, highlight_mode, highlight_class, target_frame) ".
84  " VALUES (".
85  $ilDB->quote($this->getItemId(), "integer").",".
86  $ilDB->quote($this->getNr(), "integer").",".
87  $ilDB->quote($this->getShape(), "text").",".
88  $ilDB->quote($this->getCoords(), "text").",".
89  $ilDB->quote($this->getLinkType(), "text").",".
90  $ilDB->quote($this->getTitle(), "text").",".
91  $ilDB->quote($this->getHref(), "text").",".
92  $ilDB->quote($this->getTarget(), "text").",".
93  $ilDB->quote($this->getType(), "text").",".
94  $ilDB->quote($this->getHighlightMode(), "text").",".
95  $ilDB->quote($this->getHighlightClass(), "text").",".
96  $ilDB->quote($this->getTargetFrame(), "text").")";
97  $ilDB->manipulate($q);
98  }
getTargetFrame()
get link target frame (internal link only)
getItemId()
get item id
getTitle()
get (tooltip) title
getHref()
get hyper reference url (external link only)
getCoords()
get coords
getNr()
get area number
getHighlightMode()
Get highlight mode.
getLinkType()
get link type
getShape()
get shape
global $ilDB
getHighlightClass()
Get highlight class.
getTarget($a_insert_inst=false)
get link target (internal link only)
getType()
get link type (internal link only)
+ Here is the call graph for this function:

◆ draw()

ilMapArea::draw ( $a_image,
  $a_col1,
  $a_col2,
  $a_close_poly = true,
  $a_x_ratio = 1,
  $a_y_ratio = 1 
)

draw image to

Parameters
boolean$a_close_polyclose polygon

Definition at line 575 of file class.ilMapArea.php.

References drawCircle(), drawPoly(), drawRect(), getCoords(), and getShape().

577  {
578  switch ($this->getShape())
579  {
580  case "Rect" :
581  $this->drawRect($a_image, $this->getCoords(), $a_col1, $a_col2,
582  $a_x_ratio, $a_y_ratio);
583  break;
584 
585  case "Circle" :
586  $this->drawCircle($a_image, $this->getCoords(), $a_col1, $a_col2,
587  $a_x_ratio, $a_y_ratio);
588  break;
589 
590  case "Poly" :
591  $this->drawPoly($a_image, $this->getCoords(), $a_col1, $a_col2, $a_close_poly,
592  $a_x_ratio, $a_y_ratio);
593  break;
594  }
595  }
drawCircle(&$im, $coords, $c1, $c2, $a_x_ratio=1, $a_y_ratio=1)
draws an outlined two colored circle
drawRect(&$im, $coords, $c1, $c2, $a_x_ratio=1, $a_y_ratio=1)
draws an outlined two color rectangle
getCoords()
get coords
getShape()
get shape
drawPoly(&$im, $coords, $c1, $c2, $closed, $a_x_ratio=1, $a_y_ratio=1)
draws an outlined two color polygon
+ Here is the call graph for this function:

◆ drawCircle()

ilMapArea::drawCircle ( $im,
  $coords,
  $c1,
  $c2,
  $a_x_ratio = 1,
  $a_y_ratio = 1 
)

draws an outlined two colored circle

Parameters
int$imimage identifier as returned by ImageCreateFromGIF()
string$coordscoordinate string, format : "x,y,r" with (x,y) as center point and r as radius
int$c1color identifier 1
int$c3color identifier 2

Definition at line 689 of file class.ilMapArea.php.

Referenced by draw().

690  {
691  $c = explode(",", $coords);
692  imagearc($im, $c[0] / $a_x_ratio, $c[1] / $a_y_ratio,
693  ($c[2]+1)*2 / $a_x_ratio, ($c[2]+1)*2 / $a_y_ratio, 1, 360, $c1);
694  imagearc($im, $c[0] / $a_x_ratio, $c[1] / $a_y_ratio,
695  ($c[2]-1)*2 / $a_x_ratio, ($c[2]-1)*2 / $a_y_ratio, 1, 360, $c1);
696  imagearc($im, $c[0] / $a_x_ratio, $c[1] / $a_y_ratio,
697  $c[2]*2 / $a_x_ratio, $c[2]*2 / $a_y_ratio, 1, 360, $c2);
698  }
+ Here is the caller graph for this function:

◆ drawLine()

ilMapArea::drawLine ( $im,
  $x1,
  $y1,
  $x2,
  $y2,
  $c1,
  $c2 
)

draws an outlined two color line in an image

Parameters
int$imimage identifier as returned by ImageCreateFromGIF() etc.
int$x1x-coordinate of starting point
int$y1y-coordinate of starting point
int$x2x-coordinate of ending point
int$y2y-coordinate of ending point
int$c1color identifier 1
int$c2color identifier 2

Definition at line 608 of file class.ilMapArea.php.

Referenced by drawPoly(), and drawRect().

609  {
610  imageline($im, $x1+1, $y1, $x2+1, $y2, $c1);
611  imageline($im, $x1-1, $y1, $x2-1, $y2, $c1);
612  imageline($im, $x1, $y1+1, $x2, $y2+1, $c1);
613  imageline($im, $x1, $y1-1, $x2, $y2-1, $c1);
614  imageline($im, $x1, $y1, $x2, $y2, $c2);
615  }
+ Here is the caller graph for this function:

◆ drawPoly()

ilMapArea::drawPoly ( $im,
  $coords,
  $c1,
  $c2,
  $closed,
  $a_x_ratio = 1,
  $a_y_ratio = 1 
)

draws an outlined two color polygon

Parameters
int$imimage identifier as returned by ImageCreateFromGIF() etc.
string$coordscoordinate string, format : "x1,y1,x2,y2,..." with every (x,y) pair is an ending point of a line of the polygon
int$c1color identifier 1
int$c3color identifier 2
boolean$closedtrue: the first and the last point will be connected with a line

Definition at line 651 of file class.ilMapArea.php.

References countCoords(), and drawLine().

Referenced by draw().

652  {
653  if ($closed)
654  {
655  $p = 0;
656  }
657  else
658  {
659  $p = 1;
660  }
661 
663 
664  if ($anz < (3 - $p))
665  {
666  return;
667  }
668 
669  $c = explode(",", $coords);
670 
671  for($i=0; $i<$anz-$p; $i++)
672  {
673  $this->drawLine($im, $c[$i*2] / $a_x_ratio, $c[$i*2+1] / $a_y_ratio,
674  $c[($i*2+2)%(2*$anz)] / $a_x_ratio,
675  $c[($i*2+3)%(2*$anz)] / $a_y_ratio, $c1, $c2);
676  }
677  }
static countCoords($c)
count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,x3,y3,...")
drawLine(&$im, $x1, $y1, $x2, $y2, $c1, $c2)
draws an outlined two color line in an image
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawRect()

ilMapArea::drawRect ( $im,
  $coords,
  $c1,
  $c2,
  $a_x_ratio = 1,
  $a_y_ratio = 1 
)

draws an outlined two color rectangle

Parameters
int$imimage identifier as returned by ImageCreateFromGIF() etc.
string$coordscoordinate string, format : "x1,y1,x2,y2" with (x1,y1) is top left and (x2,y2) is bottom right point of the rectangle
int$c1color identifier 1
int$c2color identifier 2

Definition at line 626 of file class.ilMapArea.php.

References drawLine().

Referenced by draw().

627  {
628  $coord=explode(",", $coords);
629 
630  $this->drawLine($im, $coord[0] / $a_x_ratio, $coord[1] / $a_y_ratio,
631  $coord[0] / $a_x_ratio, $coord[3] / $a_y_ratio, $c1, $c2);
632  $this->drawLine($im, $coord[0] / $a_x_ratio, $coord[3] / $a_y_ratio,
633  $coord[2] / $a_x_ratio, $coord[3] / $a_y_ratio, $c1, $c2);
634  $this->drawLine($im, $coord[2] / $a_x_ratio, $coord[3] / $a_y_ratio,
635  $coord[2] / $a_x_ratio, $coord[1] / $a_y_ratio, $c1, $c2);
636  $this->drawLine($im, $coord[2] / $a_x_ratio, $coord[1] / $a_y_ratio,
637  $coord[0] / $a_x_ratio, $coord[1] / $a_y_ratio, $c1, $c2);
638  }
drawLine(&$im, $x1, $y1, $x2, $y2, $c1, $c2)
draws an outlined two color line in an image
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllHighlightClasses()

static ilMapArea::getAllHighlightClasses ( )
static

Get all highlight classes.

Returns
array

Definition at line 299 of file class.ilMapArea.php.

References $lng, and array.

Referenced by ilImageMapTableGUI\__construct().

300  {
301  global $lng;
302 
303  return array(
304  self::HLCL_ACCENTED => $lng->txt("cont_accented"),
305  self::HLCL_LIGHT => $lng->txt("cont_light"),
306  self::HLCL_DARK => $lng->txt("cont_dark"),
307  );
308  }
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getAllHighlightModes()

static ilMapArea::getAllHighlightModes ( )
static

Get all highlight modes.

Parameters

Definition at line 261 of file class.ilMapArea.php.

References $lng, and array.

Referenced by ilImageMapTableGUI\__construct().

262  {
263  global $lng;
264 
265  return array(
266  self::HL_NONE => $lng->txt("cont_none"),
267  self::HL_HOVER => $lng->txt("cont_hover"),
268  self::HL_ALWAYS => $lng->txt("cont_always")
269  );
270 
271  }
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getCoords()

ilMapArea::getCoords ( )

get coords

Returns
string coords (comma separated integers)

Definition at line 405 of file class.ilMapArea.php.

References $coords.

Referenced by create(), draw(), and update().

406  {
407  return $this->coords;
408  }
+ Here is the caller graph for this function:

◆ getExtTitle()

ilMapArea::getExtTitle ( )

get link text (external link only)

Returns
string link text

Definition at line 495 of file class.ilMapArea.php.

References $xl_title.

496  {
497  return $this->xl_title;
498  }

◆ getHighlightClass()

ilMapArea::getHighlightClass ( )

Get highlight class.

Returns
string highlight class

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

Referenced by create(), and update().

326  {
327  return $this->highlight_class;
328  }
+ Here is the caller graph for this function:

◆ getHighlightMode()

ilMapArea::getHighlightMode ( )

Get highlight mode.

Returns
string highlight mode

Definition at line 289 of file class.ilMapArea.php.

Referenced by create(), and update().

290  {
291  return $this->highlight_mode;
292  }
+ Here is the caller graph for this function:

◆ getHref()

ilMapArea::getHref ( )

get hyper reference url (external link only)

Parameters
stringhyper ref url

Definition at line 475 of file class.ilMapArea.php.

References $xl_href.

Referenced by create(), and update().

476  {
477  return $this->xl_href;
478  }
+ Here is the caller graph for this function:

◆ getItemId()

ilMapArea::getItemId ( )

get item id

Returns
int media item id

Definition at line 345 of file class.ilMapArea.php.

References $item_id.

Referenced by create(), read(), and update().

346  {
347  return $this->item_id;
348  }
+ Here is the caller graph for this function:

◆ getLinkType()

ilMapArea::getLinkType ( )

get link type

Returns
int link type (IL_INT_LINK, IL_EXT_LINK)

Definition at line 455 of file class.ilMapArea.php.

References $linktype.

Referenced by create(), and update().

456  {
457  return $this->linktype;
458  }
+ Here is the caller graph for this function:

◆ getNr()

ilMapArea::getNr ( )

get area number

Returns
int number (of area within parent media object)

Definition at line 365 of file class.ilMapArea.php.

References $nr.

Referenced by create(), read(), and update().

366  {
367  return $this->nr;
368  }
+ Here is the caller graph for this function:

◆ getShape()

ilMapArea::getShape ( )

get shape

Returns
string (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)

Definition at line 385 of file class.ilMapArea.php.

References $shape.

Referenced by create(), draw(), and update().

386  {
387  return $this->shape;
388  }
+ Here is the caller graph for this function:

◆ getTarget()

ilMapArea::getTarget (   $a_insert_inst = false)

get link target (internal link only)

Returns
string link target

Definition at line 515 of file class.ilMapArea.php.

References $il_target, and $target.

Referenced by create(), and update().

516  {
518 
519  if ((substr($target, 0, 4) == "il__") && $a_insert_inst)
520  {
521  $target = "il_".IL_INST_ID."_".substr($target, 4, strlen($target) - 4);
522  }
523 
524  return $target;
525  }
+ Here is the caller graph for this function:

◆ getTargetFrame()

ilMapArea::getTargetFrame ( )

get link target frame (internal link only)

Returns
string link target frame target frame (IL_TF_MEDIA | IL_TF_FAQ | IL_TF_GLOSSARY | IL_TF_NEW)

Definition at line 565 of file class.ilMapArea.php.

References $il_target_frame.

Referenced by create(), and update().

566  {
567  return $this->il_target_frame;
568  }
+ Here is the caller graph for this function:

◆ getTitle()

ilMapArea::getTitle ( )

get (tooltip) title

Returns
string title

Definition at line 435 of file class.ilMapArea.php.

References $title.

Referenced by create(), and update().

436  {
437  return $this->title;
438  }
+ Here is the caller graph for this function:

◆ getType()

ilMapArea::getType ( )

get link type (internal link only)

Returns
string (IL_LT_STRUCTURE | IL_LT_PAGE | IL_LT_MEDIA | IL_LT_GLITEM)

Definition at line 543 of file class.ilMapArea.php.

References $il_type.

Referenced by create(), and update().

544  {
545  return $this->il_type;
546  }
+ Here is the caller graph for this function:

◆ read()

ilMapArea::read ( )

read map area data into object (item id and nr must be set)

Definition at line 122 of file class.ilMapArea.php.

References $ilDB, getItemId(), getNr(), setCoords(), setHighlightClass(), setHighlightMode(), setHref(), setLinkType(), setNr(), setShape(), setTarget(), setTargetFrame(), setTitle(), and setType().

Referenced by __construct().

123  {
124  global $ilDB;
125 
126  $q = "SELECT * FROM map_area WHERE item_id = ".
127  $ilDB->quote($this->getItemId(), "integer").
128  " AND nr = ".$ilDB->quote($this->getNr(), "integer");
129  $area_set = $ilDB->query($q);
130  $area_rec = $ilDB->fetchAssoc($area_set);
131 
132  $this->setShape($area_rec["shape"]);
133 //echo $area_rec["Shape"];
134  $this->setNr($area_rec["nr"]);
135  $this->setCoords($area_rec["coords"]);
136  $this->setLinkType($area_rec["link_type"]);
137  $this->setTitle($area_rec["title"]);
138  $this->setHref($area_rec["href"]);
139  $this->setTarget($area_rec["target"]);
140  $this->setType($area_rec["type"]);
141  $this->setTargetFrame($area_rec["target_frame"]);
142  $this->setHighlightMode($area_rec["highlight_mode"]);
143  $this->setHighlightClass($area_rec["highlight_class"]);
144 
145  }
setHighlightClass($a_val)
Set highlight class.
setTarget($a_target)
set link target (internal link only)
setTargetFrame($a_target_frame)
set link target frame (internal link only)
getItemId()
get item id
setHref($a_href)
set hyper reference (external link only)
setCoords($a_coords)
set coords of area
setHighlightMode($a_val)
Set highlight mode.
getNr()
get area number
setType($a_type)
set link type (internal link only)
setTitle($a_title)
set (tooltip)title of area
setShape($a_shape)
set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)
global $ilDB
setNr($a_nr)
set area number
setLinkType($a_link_type)
set link type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCoords()

ilMapArea::setCoords (   $a_coords)

set coords of area

Parameters
string$a_coordscoords (comma separated integers)

Definition at line 395 of file class.ilMapArea.php.

Referenced by read().

396  {
397  $this->coords = $a_coords;
398  }
+ Here is the caller graph for this function:

◆ setExtTitle()

ilMapArea::setExtTitle (   $a_title)

set link text (external link only)

Parameters
string$a_titlelink text

Definition at line 485 of file class.ilMapArea.php.

486  {
487  $this->xl_title = $a_title;
488  }

◆ setHighlightClass()

ilMapArea::setHighlightClass (   $a_val)

Set highlight class.

Parameters
string$a_valhighlight class

Definition at line 315 of file class.ilMapArea.php.

Referenced by read().

316  {
317  $this->highlight_class = $a_val;
318  }
+ Here is the caller graph for this function:

◆ setHighlightMode()

ilMapArea::setHighlightMode (   $a_val)

Set highlight mode.

Parameters
string$a_valhighlight mode

Definition at line 279 of file class.ilMapArea.php.

Referenced by read().

280  {
281  $this->highlight_mode = $a_val;
282  }
+ Here is the caller graph for this function:

◆ setHref()

ilMapArea::setHref (   $a_href)

set hyper reference (external link only)

Parameters
string$a_hrefhyper ref url

Definition at line 465 of file class.ilMapArea.php.

Referenced by read().

466  {
467  $this->xl_href = $a_href;
468  }
+ Here is the caller graph for this function:

◆ setItemId()

ilMapArea::setItemId (   $a_item_id)

set media item id

Parameters
int$a_item_idmedia item id

Definition at line 335 of file class.ilMapArea.php.

Referenced by __construct().

336  {
337  $this->item_id = $a_item_id;
338  }
+ Here is the caller graph for this function:

◆ setLinkType()

ilMapArea::setLinkType (   $a_link_type)

set link type

Parameters
string$a_linktypelink type (IL_INT_LINK, IL_EXT_LINK)

Definition at line 445 of file class.ilMapArea.php.

Referenced by read(), and ilImageMapEditorGUI\saveArea().

446  {
447  $this->linktype = $a_link_type;
448  }
+ Here is the caller graph for this function:

◆ setNr()

ilMapArea::setNr (   $a_nr)

set area number

Parameters
int$a_nrnumber (of area within parent media object)

Definition at line 355 of file class.ilMapArea.php.

Referenced by __construct(), and read().

356  {
357  $this->nr = $a_nr;
358  }
+ Here is the caller graph for this function:

◆ setShape()

ilMapArea::setShape (   $a_shape)

set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)

Parameters
string$a_shapeshape of map area

Definition at line 375 of file class.ilMapArea.php.

Referenced by read(), and ilImageMapEditorGUI\saveArea().

376  {
377  $this->shape = $a_shape;
378  }
+ Here is the caller graph for this function:

◆ setTarget()

ilMapArea::setTarget (   $a_target)

set link target (internal link only)

Parameters
string$a_targetlink target (e.g. "il__pg_23")

Definition at line 505 of file class.ilMapArea.php.

Referenced by read().

506  {
507  $this->il_target = $a_target;
508  }
+ Here is the caller graph for this function:

◆ setTargetFrame()

ilMapArea::setTargetFrame (   $a_target_frame)

set link target frame (internal link only)

Parameters
string$a_target_frametarget frame (IL_TF_MEDIA | IL_TF_FAQ | IL_TF_GLOSSARY | IL_TF_NEW)

Definition at line 554 of file class.ilMapArea.php.

Referenced by read().

555  {
556  $this->il_target_frame = $a_target_frame;
557  }
+ Here is the caller graph for this function:

◆ setTitle()

ilMapArea::setTitle (   $a_title)

set (tooltip)title of area

Parameters
string$a_titletitle

Definition at line 415 of file class.ilMapArea.php.

Referenced by read(), and ilImageMapEditorGUI\updateAreas().

416  {
417  $this->title = $a_title;
418  }
+ Here is the caller graph for this function:

◆ setType()

ilMapArea::setType (   $a_type)

set link type (internal link only)

Parameters
string$a_typelink type (IL_LT_STRUCTURE | IL_LT_PAGE | IL_LT_MEDIA | IL_LT_GLITEM)

Definition at line 533 of file class.ilMapArea.php.

References $a_type.

Referenced by read().

534  {
535  $this->il_type = $a_type;
536  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ update()

ilMapArea::update ( )

update map area

Definition at line 150 of file class.ilMapArea.php.

References $ilDB, getCoords(), getHighlightClass(), getHighlightMode(), getHref(), getItemId(), getLinkType(), getNr(), getShape(), getTarget(), getTargetFrame(), getTitle(), and getType().

151  {
152  global $ilDB;
153 
154  $q = "UPDATE map_area SET shape = ".$ilDB->quote($this->getShape(), "text").
155  ", coords = ".$ilDB->quote($this->getCoords(), "text").
156  ", link_type = ".$ilDB->quote($this->getLinkType(), "text").
157  ", title = ".$ilDB->quote($this->getTitle(), "text").
158  ", href = ".$ilDB->quote($this->getHref(), "text").
159  ", target = ".$ilDB->quote($this->getTarget(), "text").
160  ", type = ".$ilDB->quote($this->getType(), "text").
161  ", highlight_mode = ".$ilDB->quote($this->getHighlightMode(), "text").
162  ", highlight_class = ".$ilDB->quote($this->getHighlightClass(), "text").
163  ", target_frame = ".$ilDB->quote($this->getTargetFrame(), "text").
164  " WHERE item_id = ".$ilDB->quote($this->getItemId(), "integer").
165  " AND nr = ".$ilDB->quote($this->getNr(), "integer");
166  $ilDB->manipulate($q);
167  }
getTargetFrame()
get link target frame (internal link only)
getItemId()
get item id
getTitle()
get (tooltip) title
getHref()
get hyper reference url (external link only)
getCoords()
get coords
getNr()
get area number
getHighlightMode()
Get highlight mode.
getLinkType()
get link type
getShape()
get shape
global $ilDB
getHighlightClass()
Get highlight class.
getTarget($a_insert_inst=false)
get link target (internal link only)
getType()
get link type (internal link only)
+ Here is the call graph for this function:

Field Documentation

◆ $coords

ilMapArea::$coords

Definition at line 48 of file class.ilMapArea.php.

Referenced by getCoords().

◆ $il_target

ilMapArea::$il_target

Definition at line 53 of file class.ilMapArea.php.

Referenced by getTarget().

◆ $il_target_frame

ilMapArea::$il_target_frame

Definition at line 55 of file class.ilMapArea.php.

Referenced by getTargetFrame().

◆ $il_type

ilMapArea::$il_type

Definition at line 54 of file class.ilMapArea.php.

Referenced by getType().

◆ $item_id

ilMapArea::$item_id

Definition at line 45 of file class.ilMapArea.php.

Referenced by getItemId().

◆ $linktype

ilMapArea::$linktype

Definition at line 50 of file class.ilMapArea.php.

Referenced by getLinkType().

◆ $nr

ilMapArea::$nr

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

Referenced by getNr().

◆ $shape

ilMapArea::$shape

Definition at line 47 of file class.ilMapArea.php.

Referenced by getShape().

◆ $title

ilMapArea::$title

Definition at line 49 of file class.ilMapArea.php.

Referenced by getTitle().

◆ $xl_href

ilMapArea::$xl_href

Definition at line 52 of file class.ilMapArea.php.

Referenced by getHref().

◆ $xl_title

ilMapArea::$xl_title

Definition at line 51 of file class.ilMapArea.php.

Referenced by getExtTitle().

◆ HL_ALWAYS

const ilMapArea::HL_ALWAYS = "Always"

Definition at line 40 of file class.ilMapArea.php.

◆ HL_HOVER

const ilMapArea::HL_HOVER = "Hover"

Definition at line 39 of file class.ilMapArea.php.

◆ HL_NONE

const ilMapArea::HL_NONE = ""

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

◆ HLCL_ACCENTED

const ilMapArea::HLCL_ACCENTED = ""

Definition at line 41 of file class.ilMapArea.php.

◆ HLCL_DARK

const ilMapArea::HLCL_DARK = "Dark"

Definition at line 43 of file class.ilMapArea.php.

◆ HLCL_LIGHT

const ilMapArea::HLCL_LIGHT = "Light"

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


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