ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
◀ ilDoc Overview
class.ilImageLinkButton.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
require_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php"
;
5
13
class
ilImageLinkButton
extends
ilLinkButton
14
{
15
protected
$src
;
// [string]
16
protected
$force_title
;
// [bool]
17
18
public
static
function
getInstance
()
19
{
20
return
new
self
(self::TYPE_LINK);
21
}
22
23
24
//
25
// properties
26
//
27
34
public
function
setImage
($a_value, $a_is_internal =
true
)
35
{
36
if
((
bool
)$a_is_internal)
37
{
38
$a_value =
ilUtil::getImagePath
($a_value);
39
}
40
$this->src = trim($a_value);
41
}
42
48
public
function
getImage
()
49
{
50
return
$this->src
;
51
}
52
53
public
function
forceTitle
($a_value)
54
{
55
$this->force_title = (bool)$a_value;
56
}
57
58
public
function
hasForceTitle
()
59
{
60
return
$this->force_title
;
61
}
62
63
64
//
65
// render
66
//
67
68
protected
function
prepareRender
()
69
{
70
// get rid of parent "submit" css class...
71
}
72
73
protected
function
renderCaption
()
74
{
75
$attr = array();
76
$attr[
"src"
] = $this->
getImage
();
77
$attr[
"alt"
] = $this->
getCaption
();
78
if
($this->
hasForceTitle
())
79
{
80
$attr[
"title"
] = $this->
getCaption
();
81
}
82
return
'<img'
.$this->renderAttributesHelper($attr).
' />'
;
83
}
84
}
ilImageLinkButton
Definition:
class.ilImageLinkButton.php:13
ilImageLinkButton\forceTitle
forceTitle($a_value)
Definition:
class.ilImageLinkButton.php:53
ilImageLinkButton\getImage
getImage()
Get image.
Definition:
class.ilImageLinkButton.php:48
ilImageLinkButton\$src
$src
Definition:
class.ilImageLinkButton.php:15
ilButtonBase\getCaption
getCaption($a_translate=true)
Get caption.
Definition:
class.ilButtonBase.php:125
ilUtil\getImagePath
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Definition:
class.ilUtil.php:71
ilImageLinkButton\prepareRender
prepareRender()
Definition:
class.ilImageLinkButton.php:68
ilImageLinkButton\hasForceTitle
hasForceTitle()
Definition:
class.ilImageLinkButton.php:58
ilImageLinkButton\$force_title
$force_title
Definition:
class.ilImageLinkButton.php:16
ilImageLinkButton\renderCaption
renderCaption()
Definition:
class.ilImageLinkButton.php:73
ilImageLinkButton\getInstance
static getInstance()
Definition:
class.ilImageLinkButton.php:18
ilLinkButton
Definition:
class.ilLinkButton.php:13
ilImageLinkButton\setImage
setImage($a_value, $a_is_internal=true)
Set image.
Definition:
class.ilImageLinkButton.php:34
Services
UIComponent
Button
classes
class.ilImageLinkButton.php
Generated on Wed Aug 27 2025 19:01:03 for ILIAS by
1.8.13 (using
Doxyfile
)