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.

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 }
setNr($a_nr)
set area number
setItemId($a_item_id)
set media item id
read()
read map area data into object (item id and nr must be set)

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

+ 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.

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
global $ilDB

References $ilDB, $target, and IL_INT_LINK.

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

+ 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.

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 }

References $ilDB.

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

+ 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.

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 }
static _lookupMobId($a_med_id)
Lookup Mob ID.
$mobs
$a_type
Definition: workflow.php:93

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

Referenced by ilLMObject\updateInternalLinks().

+ 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.

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 }

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

Referenced by ilMediaItem\_resolveMapAreaLinks().

+ 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.

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 }

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

+ 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.

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 }
getShape()
get shape
getTitle()
get (tooltip) title
getCoords()
get coords
getTarget($a_insert_inst=false)
get link target (internal link only)
getHref()
get hyper reference url (external link only)
getHighlightMode()
Get highlight mode.
getLinkType()
get link type
getTargetFrame()
get link target frame (internal link only)
getItemId()
get item id
getType()
get link type (internal link only)
getNr()
get area number
getHighlightClass()
Get highlight class.

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

+ 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.

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 }
drawRect(&$im, $coords, $c1, $c2, $a_x_ratio=1, $a_y_ratio=1)
draws an outlined two color rectangle
drawCircle(&$im, $coords, $c1, $c2, $a_x_ratio=1, $a_y_ratio=1)
draws an outlined two colored circle
drawPoly(&$im, $coords, $c1, $c2, $closed, $a_x_ratio=1, $a_y_ratio=1)
draws an outlined two color polygon

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

+ 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.

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 }

References $coords.

Referenced by draw().

+ 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.

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 }

Referenced by drawPoly(), and drawRect().

+ 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.

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,...
drawLine(&$im, $x1, $y1, $x2, $y2, $c1, $c2)
draws an outlined two color line in an image

References $coords, countCoords(), and drawLine().

Referenced by draw().

+ 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.

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 }

References $coords, and drawLine().

Referenced by draw().

+ 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.

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 }
global $lng
Definition: privfeed.php:17

References $lng.

Referenced by ilImageMapTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getAllHighlightModes()

static ilMapArea::getAllHighlightModes ( )
static

Get all highlight modes.

Parameters

return

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

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 }

References $lng.

Referenced by ilImageMapTableGUI\__construct().

+ 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.

406 {
407 return $this->coords;
408 }

References $coords.

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

+ 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.

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

References $xl_title.

◆ getHighlightClass()

ilMapArea::getHighlightClass ( )

Get highlight class.

Returns
string highlight class

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

326 {
327 return $this->highlight_class;
328 }

Referenced by create(), and update().

+ 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.

290 {
291 return $this->highlight_mode;
292 }

Referenced by create(), and update().

+ 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.

476 {
477 return $this->xl_href;
478 }

References $xl_href.

Referenced by create(), and update().

+ 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.

346 {
347 return $this->item_id;
348 }

References $item_id.

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

+ 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.

456 {
457 return $this->linktype;
458 }

References $linktype.

Referenced by create(), and update().

+ 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.

366 {
367 return $this->nr;
368 }

References $nr.

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

+ 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.

386 {
387 return $this->shape;
388 }

References $shape.

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

+ 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.

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 }

References $il_target, and $target.

Referenced by create(), and update().

+ 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.

566 {
568 }

References $il_target_frame.

Referenced by create(), and update().

+ 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.

436 {
437 return $this->title;
438 }

References $title.

Referenced by create(), and update().

+ 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.

544 {
545 return $this->il_type;
546 }

References $il_type.

Referenced by create(), and update().

+ 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.

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)
setHighlightMode($a_val)
Set highlight mode.
setTitle($a_title)
set (tooltip)title of area
setHref($a_href)
set hyper reference (external link only)
setShape($a_shape)
set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)
setType($a_type)
set link type (internal link only)
setLinkType($a_link_type)
set link type
setCoords($a_coords)
set coords of area

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

Referenced by __construct().

+ 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.

396 {
397 $this->coords = $a_coords;
398 }

Referenced by read().

+ 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.

316 {
317 $this->highlight_class = $a_val;
318 }

Referenced by read().

+ 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.

280 {
281 $this->highlight_mode = $a_val;
282 }

Referenced by read().

+ 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.

466 {
467 $this->xl_href = $a_href;
468 }

Referenced by read().

+ 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.

336 {
337 $this->item_id = $a_item_id;
338 }

Referenced by __construct().

+ 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.

446 {
447 $this->linktype = $a_link_type;
448 }

Referenced by read().

+ 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.

356 {
357 $this->nr = $a_nr;
358 }

Referenced by __construct(), and read().

+ 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.

376 {
377 $this->shape = $a_shape;
378 }

Referenced by read().

+ 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.

506 {
507 $this->il_target = $a_target;
508 }

Referenced by read().

+ 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.

555 {
556 $this->il_target_frame = $a_target_frame;
557 }

Referenced by read().

+ 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.

416 {
417 $this->title = $a_title;
418 }

Referenced by read().

+ 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.

534 {
535 $this->il_type = $a_type;
536 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilMapArea::update ( )

update map area

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

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 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $coords

ilMapArea::$coords

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

Referenced by drawCircle(), drawPoly(), drawRect(), and 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 _resolveIntLinks(), and 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 _resolveIntLinks(), and 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: