ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMapArea Class Reference

Class ilMapArea. More...

+ Collaboration diagram for ilMapArea:

Public Member Functions

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

Static Public Member Functions

static _getMaxNr (int $a_item_id)
 get maximum nr of media item (static) More...
 
static _resolveIntLinks (int $a_item_id)
 resolve internal links of an item id More...
 
static _getIntLinks (int $a_item_id)
 get all internal links of a media items map areas More...
 
static _getMobsForTarget (string $a_type, string $a_target)
 Get areas for a certain target. More...
 
static getAllHighlightModes ()
 
static getAllHighlightClasses ()
 
static countCoords (string $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"
 
int $item_id = 0
 
int $nr = 0
 
string $shape = ""
 
string $coords = ""
 
string $title = ""
 
string $linktype = ""
 
string $xl_title = ""
 
string $xl_href = ""
 
string $il_target = ""
 
string $il_type = ""
 
string $il_target_frame = ""
 

Protected Attributes

string $highlight_mode = ""
 
string $highlight_class = ""
 
ilDBInterface $db
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilMapArea::__construct ( int  $a_item_id = 0,
int  $a_nr = 0 
)
Parameters
int$a_item_idparent media item id
int$a_nrmap area number within media item

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

77 {
78 global $DIC;
79
80 $this->db = $DIC->database();
81 $this->title = "";
82 if ($a_item_id != 0 && $a_nr != 0) {
83 $this->setItemId($a_item_id);
84 $this->setNr($a_nr);
85 $this->read();
86 }
87 }
setItemId(int $a_item_id)
setNr(int $a_nr)
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _getIntLinks()

static ilMapArea::_getIntLinks ( int  $a_item_id)
static

get all internal links of a media items map areas

Parameters
int$a_item_idmedia item id

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

214 : array {
215 global $DIC;
216
217 $ilDB = $DIC->database();
218
219 $q = "SELECT * FROM map_area WHERE item_id = " .
220 $ilDB->quote($a_item_id, "integer");
221 $area_set = $ilDB->query($q);
222
223 $links = array();
224
225 while ($area_rec = $ilDB->fetchAssoc($area_set)) {
226 $target = $area_rec["target"];
227 $type = $area_rec["type"];
228 $targetframe = $area_rec["target_frame"];
229
230 if (($area_rec["link_type"] == IL_INT_LINK) && (is_int(strpos($target, "__")))) {
231 $links[$target . ":" . $type . ":" . $targetframe] =
232 array("Target" => $target, "Type" => $type,
233 "TargetFrame" => $targetframe);
234 }
235 }
236 return $links;
237 }
const IL_INT_LINK
$q
Definition: shib_logout.php:23

◆ _getMaxNr()

static ilMapArea::_getMaxNr ( int  $a_item_id)
static

get maximum nr of media item (static)

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

119 : int {
120 global $DIC;
121
122 $ilDB = $DIC->database();
123
124 $q = "SELECT max(nr) AS max_nr FROM map_area WHERE item_id = " .
125 $ilDB->quote($a_item_id, "integer");
126 $max_set = $ilDB->query($q);
127 $max_rec = $ilDB->fetchAssoc($max_set);
128
129 return (int) $max_rec["max_nr"];
130 }

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 ( string  $a_type,
string  $a_target 
)
static

Get areas for a certain target.

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

245 : array {
246 global $DIC;
247
248 $ilDB = $DIC->database();
249
250 $q = "SELECT * FROM map_area WHERE " .
251 " link_type = " . $ilDB->quote($a_type, "text") .
252 " AND target = " . $ilDB->quote($a_target, "text");
253 $set = $ilDB->query($q);
254
255 $mobs = array();
256 while ($rec = $ilDB->fetchAssoc($set)) {
257 $mob_id = ilMediaItem::_lookupMobId($rec["item_id"]);
258 $mobs[$mob_id] = $mob_id;
259 }
260
261 return $mobs;
262 }
static _lookupMobId(int $a_med_id)

Referenced by ilLMObject\updateInternalLinks().

+ Here is the caller graph for this function:

◆ _resolveIntLinks()

static ilMapArea::_resolveIntLinks ( int  $a_item_id)
static

resolve internal links of an item id

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

179 : void {
180 global $DIC;
181
182 $ilDB = $DIC->database();
183
184 //echo "maparea::resolve<br>";
185 $q = "SELECT * FROM map_area WHERE item_id = " .
186 $ilDB->quote($a_item_id, "integer");
187 $area_set = $ilDB->query($q);
188 while ($area_rec = $ilDB->fetchAssoc($area_set)) {
189 $target = (string) $area_rec["target"];
190 $type = $area_rec["type"];
191 $item_id = $area_rec["item_id"];
192 $nr = $area_rec["nr"];
193
194 if (($area_rec["link_type"] == IL_INT_LINK) && (!is_int(strpos($target, "__")))) {
195 $new_target = ilInternalLink::_getIdForImportId($type, $target);
196 if ($new_target !== false) {
197 $query = "UPDATE map_area SET " .
198 "target = " . $ilDB->quote($new_target, "text") . " " .
199 "WHERE item_id = " . $ilDB->quote($item_id, "integer") .
200 " AND nr = " . $ilDB->quote($nr, "integer");
201 $ilDB->manipulate($query);
202 }
203 }
204 }
205 }

References $ilDB, 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 ( string  $a_title_str)

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

366 : void
367 {
368 $this->title .= $a_title_str;
369 }

◆ countCoords()

static ilMapArea::countCoords ( string  $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 702 of file class.ilMapArea.php.

702 : float
703 {
704 if ($c == "") {
705 return 0;
706 } else {
707 $coord_array = explode(",", $c);
708 return (count($coord_array) / 2);
709 }
710 }
$c
Definition: deliver.php:25

References $c.

◆ create()

ilMapArea::create ( )

create persistent map area object in db

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

92 : void
93 {
95
96 $q = "INSERT INTO map_area (item_id, nr, shape, " .
97 "coords, link_type, title, href, target, type, highlight_mode, highlight_class, target_frame) " .
98 " VALUES (" .
99 $ilDB->quote($this->getItemId(), "integer") . "," .
100 $ilDB->quote($this->getNr(), "integer") . "," .
101 $ilDB->quote($this->getShape(), "text") . "," .
102 $ilDB->quote($this->getCoords(), "text") . "," .
103 $ilDB->quote($this->getLinkType(), "text") . "," .
104 $ilDB->quote($this->getTitle(), "text") . "," .
105 $ilDB->quote($this->getHref(), "text") . "," .
106 $ilDB->quote($this->getTarget(), "text") . "," .
107 $ilDB->quote($this->getType(), "text") . "," .
108 $ilDB->quote($this->getHighlightMode(), "text") . "," .
109 $ilDB->quote($this->getHighlightClass(), "text") . "," .
110 $ilDB->quote($this->getTargetFrame(), "text") . ")";
111 $ilDB->manipulate($q);
112 }
ilDBInterface $db
getTarget(bool $a_insert_inst=false)
get link target (internal link only)

References $db, $ilDB, $q, 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,
int  $a_col1,
int  $a_col2,
bool  $a_close_poly = true,
float  $a_x_ratio = 1,
float  $a_y_ratio = 1 
)
Parameters
resource | GdImage$a_image(GdImage comes with 8.0)

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

481 : void {
482 switch ($this->getShape()) {
483 case "Rect":
484 $this->drawRect(
485 $a_image,
486 $this->getCoords(),
487 $a_col1,
488 $a_col2,
489 $a_x_ratio,
490 $a_y_ratio
491 );
492 break;
493
494 case "Circle":
495 $this->drawCircle(
496 $a_image,
497 $this->getCoords(),
498 $a_col1,
499 $a_col2,
500 $a_x_ratio,
501 $a_y_ratio
502 );
503 break;
504
505 case "Poly":
506 $this->drawPoly(
507 $a_image,
508 $this->getCoords(),
509 $a_col1,
510 $a_col2,
511 $a_close_poly,
512 $a_x_ratio,
513 $a_y_ratio
514 );
515 break;
516 }
517 }
drawPoly( $im, string $coords, int $c1, int $c2, bool $closed, float $a_x_ratio=1, float $a_y_ratio=1)
draws an outlined two color polygon
drawCircle( $im, string $coords, int $c1, int $c2, float $a_x_ratio=1, float $a_y_ratio=1)
draws an outlined two colored circle
drawRect( $im, string $coords, int $c1, int $c2, float $a_x_ratio=1, float $a_y_ratio=1)
draws an outlined two color rectangle

◆ drawCircle()

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

draws an outlined two colored circle

Parameters
resource | GdImage$im(GdImage comes with 8.0)
string$coordscoordinate string, format : "x,y,r" with (x,y) as center point and r as radius
int$c1color identifier 1
int$c2color identifier 2

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

663 : void {
664 $c = explode(",", $coords);
665 imagearc(
666 $im,
667 $c[0] / $a_x_ratio,
668 $c[1] / $a_y_ratio,
669 ($c[2] + 1) * 2 / $a_x_ratio,
670 ($c[2] + 1) * 2 / $a_y_ratio,
671 1,
672 360,
673 $c1
674 );
675 imagearc(
676 $im,
677 $c[0] / $a_x_ratio,
678 $c[1] / $a_y_ratio,
679 ($c[2] - 1) * 2 / $a_x_ratio,
680 ($c[2] - 1) * 2 / $a_y_ratio,
681 1,
682 360,
683 $c1
684 );
685 imagearc(
686 $im,
687 $c[0] / $a_x_ratio,
688 $c[1] / $a_y_ratio,
689 $c[2] * 2 / $a_x_ratio,
690 $c[2] * 2 / $a_y_ratio,
691 1,
692 360,
693 $c2
694 );
695 }
string $coords

◆ drawLine()

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

draws an outlined two color line in an image

Parameters
resource | GdImage$im(GdImage comes with 8.0)
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 529 of file class.ilMapArea.php.

537 : void {
538 imageline($im, $x1 + 1, $y1, $x2 + 1, $y2, $c1);
539 imageline($im, $x1 - 1, $y1, $x2 - 1, $y2, $c1);
540 imageline($im, $x1, $y1 + 1, $x2, $y2 + 1, $c1);
541 imageline($im, $x1, $y1 - 1, $x2, $y2 - 1, $c1);
542 imageline($im, $x1, $y1, $x2, $y2, $c2);
543 }

◆ drawPoly()

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

draws an outlined two color polygon

Parameters
resource | GdImage$im(GdImage comes with 8.0)
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$c2color identifier 2
bool$closedtrue: the first and the last point will be connected with a line

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

619 : void {
620 if ($closed) {
621 $p = 0;
622 } else {
623 $p = 1;
624 }
625
627
628 if ($anz < (3 - $p)) {
629 return;
630 }
631
632 $c = explode(",", $coords);
633
634 for ($i = 0; $i < $anz - $p; $i++) {
635 $this->drawLine(
636 $im,
637 $c[$i * 2] / $a_x_ratio,
638 $c[$i * 2 + 1] / $a_y_ratio,
639 $c[($i * 2 + 2) % (2 * $anz)] / $a_x_ratio,
640 $c[($i * 2 + 3) % (2 * $anz)] / $a_y_ratio,
641 $c1,
642 $c2
643 );
644 }
645 }
drawLine( $im, int $x1, int $y1, int $x2, int $y2, int $c1, int $c2)
draws an outlined two color line in an image
static countCoords(string $c)
count the number of coordinates (x,y) in a coordinate string (format: "x1,y1,x2,y2,...

◆ drawRect()

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

draws an outlined two color rectangle

Parameters
resource | GdImage$im(GdImage comes with 8.0)
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 553 of file class.ilMapArea.php.

560 : void {
561 $coord = explode(",", $coords);
562
563 $this->drawLine(
564 $im,
565 $coord[0] / $a_x_ratio,
566 $coord[1] / $a_y_ratio,
567 $coord[0] / $a_x_ratio,
568 $coord[3] / $a_y_ratio,
569 $c1,
570 $c2
571 );
572 $this->drawLine(
573 $im,
574 $coord[0] / $a_x_ratio,
575 $coord[3] / $a_y_ratio,
576 $coord[2] / $a_x_ratio,
577 $coord[3] / $a_y_ratio,
578 $c1,
579 $c2
580 );
581 $this->drawLine(
582 $im,
583 $coord[2] / $a_x_ratio,
584 $coord[3] / $a_y_ratio,
585 $coord[2] / $a_x_ratio,
586 $coord[1] / $a_y_ratio,
587 $c1,
588 $c2
589 );
590 $this->drawLine(
591 $im,
592 $coord[2] / $a_x_ratio,
593 $coord[1] / $a_y_ratio,
594 $coord[0] / $a_x_ratio,
595 $coord[1] / $a_y_ratio,
596 $c1,
597 $c2
598 );
599 }

◆ getAllHighlightClasses()

static ilMapArea::getAllHighlightClasses ( )
static

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

288 : array
289 {
290 global $DIC;
291
292 $lng = $DIC->language();
293
294 return array(
295 self::HLCL_ACCENTED => $lng->txt("cont_accented"),
296 self::HLCL_LIGHT => $lng->txt("cont_light"),
297 self::HLCL_DARK => $lng->txt("cont_dark"),
298 );
299 }
global $lng
Definition: privfeed.php:31

References $DIC, and $lng.

Referenced by ilImageMapTableGUI\__construct(), and ILIAS\COPage\PC\InteractiveImage\InteractiveImageQueryActionHandler\getTriggerPropertiesFormAdapter().

+ Here is the caller graph for this function:

◆ getAllHighlightModes()

static ilMapArea::getAllHighlightModes ( )
static

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

264 : array
265 {
266 global $DIC;
267
268 $lng = $DIC->language();
269
270 return array(
271 self::HL_NONE => $lng->txt("cont_none"),
272 self::HL_HOVER => $lng->txt("cont_hover"),
273 self::HL_ALWAYS => $lng->txt("cont_always")
274 );
275 }

References $DIC, and $lng.

Referenced by ilImageMapTableGUI\__construct(), and ILIAS\COPage\PC\InteractiveImage\InteractiveImageQueryActionHandler\getTriggerPropertiesFormAdapter().

+ Here is the caller graph for this function:

◆ getCoords()

ilMapArea::getCoords ( )

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

353 : string
354 {
355 return $this->coords;
356 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getExtTitle()

ilMapArea::getExtTitle ( )

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

412 : string
413 {
414 return $this->xl_title;
415 }
string $xl_title

◆ getHighlightClass()

ilMapArea::getHighlightClass ( )

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

306 : string
307 {
309 }
string $highlight_class

Referenced by create().

+ Here is the caller graph for this function:

◆ getHighlightMode()

ilMapArea::getHighlightMode ( )

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

283 : string
284 {
286 }
string $highlight_mode

Referenced by create().

+ Here is the caller graph for this function:

◆ getHref()

ilMapArea::getHref ( )

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

398 : string
399 {
400 return $this->xl_href;
401 }
string $xl_href

Referenced by create().

+ Here is the caller graph for this function:

◆ getItemId()

ilMapArea::getItemId ( )

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

316 : int
317 {
318 return $this->item_id;
319 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getLinkType()

ilMapArea::getLinkType ( )

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

385 : string
386 {
387 return $this->linktype;
388 }
string $linktype

Referenced by create().

+ Here is the caller graph for this function:

◆ getNr()

ilMapArea::getNr ( )

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

326 : int
327 {
328 return $this->nr;
329 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getShape()

ilMapArea::getShape ( )

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

339 : string
340 {
341 return $this->shape;
342 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getTarget()

ilMapArea::getTarget ( bool  $a_insert_inst = false)

get link target (internal link only)

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

429 : string
430 {
431 $target = $this->il_target;
432
433 if ((substr($target, 0, 4) == "il__") && $a_insert_inst) {
434 $target = "il_" . IL_INST_ID . "_" . substr($target, 4, strlen($target) - 4);
435 }
436
437 return $target;
438 }
string $il_target
const IL_INST_ID
Definition: constants.php:40

References IL_INST_ID.

Referenced by create().

+ Here is the caller graph for this function:

◆ getTargetFrame()

ilMapArea::getTargetFrame ( )

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

466 : string
467 {
469 }
string $il_target_frame

Referenced by create().

+ Here is the caller graph for this function:

◆ getTitle()

ilMapArea::getTitle ( )

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

371 : string
372 {
373 return $this->title;
374 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getType()

ilMapArea::getType ( )

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

450 : string
451 {
452 return $this->il_type;
453 }
string $il_type

Referenced by create().

+ Here is the caller graph for this function:

◆ read()

ilMapArea::read ( )

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

132 : void
133 {
135
136 $q = "SELECT * FROM map_area WHERE item_id = " .
137 $ilDB->quote($this->getItemId(), "integer") .
138 " AND nr = " . $ilDB->quote($this->getNr(), "integer");
139 $area_set = $ilDB->query($q);
140 $area_rec = $ilDB->fetchAssoc($area_set);
141 $this->setShape((string) $area_rec["shape"]);
142 //echo $area_rec["Shape"];
143 $this->setNr((int) $area_rec["nr"]);
144 $this->setCoords((string) $area_rec["coords"]);
145 $this->setLinkType((string) $area_rec["link_type"]);
146 $this->setTitle((string) $area_rec["title"]);
147 $this->setHref((string) $area_rec["href"]);
148 $this->setTarget((string) $area_rec["target"]);
149 $this->setType((string) $area_rec["type"]);
150 $this->setTargetFrame((string) $area_rec["target_frame"]);
151 $this->setHighlightMode((string) $area_rec["highlight_mode"]);
152 $this->setHighlightClass((string) $area_rec["highlight_class"]);
153 }
setHref(string $a_href)
set hyper reference (external link only)
setShape(string $a_shape)
set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)
setCoords(string $a_coords)
set coords of area
setTitle(string $a_title)
set (tooltip)title of area
setType(string $a_type)
set link type (internal link only)
setTarget(string $a_target)
set link target (internal link only)
setHighlightClass(string $a_val)
setHighlightMode(string $a_val)
setTargetFrame(string $a_target_frame)
set link target frame (internal link only)
setLinkType(string $a_link_type)
set link type

References $ilDB, and $q.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setCoords()

ilMapArea::setCoords ( string  $a_coords)

set coords of area

Parameters
string$a_coordscoords (comma separated integers)

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

348 : void
349 {
350 $this->coords = $a_coords;
351 }

◆ setExtTitle()

ilMapArea::setExtTitle ( string  $a_title)

set link text (external link only)

Parameters
string$a_titlelink text

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

407 : void
408 {
409 $this->xl_title = $a_title;
410 }

◆ setHighlightClass()

ilMapArea::setHighlightClass ( string  $a_val)

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

301 : void
302 {
303 $this->highlight_class = $a_val;
304 }

◆ setHighlightMode()

ilMapArea::setHighlightMode ( string  $a_val)

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

279 : void {
280 $this->highlight_mode = $a_val;
281 }

◆ setHref()

ilMapArea::setHref ( string  $a_href)

set hyper reference (external link only)

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

393 : void
394 {
395 $this->xl_href = $a_href;
396 }

◆ setItemId()

ilMapArea::setItemId ( int  $a_item_id)

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

311 : void
312 {
313 $this->item_id = $a_item_id;
314 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setLinkType()

ilMapArea::setLinkType ( string  $a_link_type)

set link type

Parameters
string$a_link_typelink type (IL_INT_LINK, IL_EXT_LINK)

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

380 : void
381 {
382 $this->linktype = $a_link_type;
383 }

◆ setNr()

ilMapArea::setNr ( int  $a_nr)

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

321 : void
322 {
323 $this->nr = $a_nr;
324 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setShape()

ilMapArea::setShape ( string  $a_shape)

set shape (IL_AREA_RECT, IL_AREA_CIRCLE, IL_AREA_POLY, IL_AREA_WHOLE_PICTURE)

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

334 : void
335 {
336 $this->shape = $a_shape;
337 }

◆ setTarget()

ilMapArea::setTarget ( string  $a_target)

set link target (internal link only)

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

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

421 : void
422 {
423 $this->il_target = $a_target;
424 }

◆ setTargetFrame()

ilMapArea::setTargetFrame ( string  $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 461 of file class.ilMapArea.php.

461 : void
462 {
463 $this->il_target_frame = $a_target_frame;
464 }

◆ setTitle()

ilMapArea::setTitle ( string  $a_title)

set (tooltip)title of area

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

361 : void
362 {
363 $this->title = $a_title;
364 }

◆ setType()

ilMapArea::setType ( string  $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 445 of file class.ilMapArea.php.

445 : void
446 {
447 $this->il_type = $a_type;
448 }

◆ update()

ilMapArea::update ( )

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

155 : void
156 {
158
159 $q = "UPDATE map_area SET shape = " . $ilDB->quote($this->getShape(), "text") .
160 ", coords = " . $ilDB->quote($this->getCoords(), "text") .
161 ", link_type = " . $ilDB->quote($this->getLinkType(), "text") .
162 ", title = " . $ilDB->quote($this->getTitle(), "text") .
163 ", href = " . $ilDB->quote($this->getHref(), "text") .
164 ", target = " . $ilDB->quote($this->getTarget(), "text") .
165 ", type = " . $ilDB->quote($this->getType(), "text") .
166 ", highlight_mode = " . $ilDB->quote($this->getHighlightMode(), "text") .
167 ", highlight_class = " . $ilDB->quote($this->getHighlightClass(), "text") .
168 ", target_frame = " . $ilDB->quote($this->getTargetFrame(), "text") .
169 " WHERE item_id = " . $ilDB->quote($this->getItemId(), "integer") .
170 " AND nr = " . $ilDB->quote($this->getNr(), "integer");
171 $ilDB->manipulate($q);
172 }

References $ilDB, $q, and ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $coords

string ilMapArea::$coords = ""

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

◆ $db

ilDBInterface ilMapArea::$db
protected

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

Referenced by create().

◆ $highlight_class

string ilMapArea::$highlight_class = ""
protected

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

◆ $highlight_mode

string ilMapArea::$highlight_mode = ""
protected

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

◆ $il_target

string ilMapArea::$il_target = ""

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

◆ $il_target_frame

string ilMapArea::$il_target_frame = ""

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

◆ $il_type

string ilMapArea::$il_type = ""

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

◆ $item_id

int ilMapArea::$item_id = 0

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

◆ $linktype

string ilMapArea::$linktype = ""

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

◆ $nr

int ilMapArea::$nr = 0

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

◆ $shape

string ilMapArea::$shape = ""

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

◆ $title

string ilMapArea::$title = ""

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

◆ $xl_href

string ilMapArea::$xl_href = ""

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

◆ $xl_title

string ilMapArea::$xl_title = ""

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

◆ HL_ALWAYS

const ilMapArea::HL_ALWAYS = "Always"

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

◆ HL_HOVER

const ilMapArea::HL_HOVER = "Hover"

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

◆ HL_NONE

const ilMapArea::HL_NONE = ""

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

◆ HLCL_ACCENTED

const ilMapArea::HLCL_ACCENTED = ""

◆ HLCL_DARK

const ilMapArea::HLCL_DARK = "Dark"

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

◆ HLCL_LIGHT

const ilMapArea::HLCL_LIGHT = "Light"

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


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