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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilLinkButton:
+ Collaboration diagram for ilLinkButton:

Public Member Functions

 setUrl (string $a_value)
 
 getUrl ()
 
 setTarget (string $a_value)
 
 getTarget ()
 
 render ()
 
- Public Member Functions inherited from ilButtonBase
 __clone ()
 
 getType ()
 
 setId (?string $a_value)
 
 getId ()
 
 setCaption (string $a_value, bool $a_is_lng_id=true)
 
 getCaption (bool $a_translate=true)
 
 setPrimary (bool $a_value)
 
 isPrimary ()
 
 setOmitPreventDoubleSubmission (bool $a_value)
 Toggle double submission prevention status. More...
 
 getOmitPreventDoubleSubmission ()
 
 setOnClick (string $a_value)
 
 getOnClick ()
 
 setDisabled (bool $a_value)
 
 isDisabled ()
 
 addCSSClass (string $a_value)
 
 getCSSClasses ()
 
 applyDefaultCss (?bool $apply_default_css=null)
 
 render ()
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Static Public Member Functions

static getInstance ()
 
static getInstance ()
 

Protected Member Functions

 renderCaption ()
 
 renderAttributes (?array $a_additional_attr=null)
 Render current HTML attributes. More...
 
- Protected Member Functions inherited from ilButtonBase
 __construct (int $a_type)
 
 setType (int $a_value)
 
 gatherCssClasses ()
 
 renderAttributesHelper (array $a_attr)
 
 renderAttributes (?array $a_additional_attr=null)
 Render current HTML attributes. More...
 
 prepareRender ()
 

Protected Attributes

string $url = ""
 
string $target = ""
 
- Protected Attributes inherited from ilButtonBase
ilLanguage $lng
 
int $type = 0
 
string $id = ""
 
string $caption = ""
 
bool $caption_is_lng_id = false
 
bool $primary = false
 
bool $omit_prevent_double_submission = false
 
string $onclick = ""
 
int $acc_key = 0
 
bool $disabled = false
 
array $css = array()
 
bool $apply_default_css = true
 

Additional Inherited Members

- Data Fields inherited from ilButtonBase
const TYPE_SUBMIT = 1
 
const TYPE_LINK = 2
 
const TYPE_SPLIT = 3
 
const TYPE_BUTTON = 4
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Link Button GUI

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Deprecated:
with ILIAS 12. Use KS Buttons instead

Definition at line 25 of file class.ilLinkButton.php.

Member Function Documentation

◆ getInstance()

static ilLinkButton::getInstance ( )
static

Reimplemented from ilButtonBase.

Reimplemented in ilImageLinkButton.

Definition at line 30 of file class.ilLinkButton.php.

30 : self
31 {
32 return new self(self::TYPE_LINK);
33 }

References ilButtonBase\TYPE_LINK.

Referenced by ilToolbarGUI\applyAutoStickyToSingleElement(), ilObjSAHSLearningModule\getViewButton(), and ilExplorerSelectInputGUI\render().

+ Here is the caller graph for this function:

◆ getTarget()

ilLinkButton::getTarget ( )

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

55 : string
56 {
57 return $this->target;
58 }

References $target.

Referenced by render(), and renderAttributes().

+ Here is the caller graph for this function:

◆ getUrl()

ilLinkButton::getUrl ( )

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

45 : string
46 {
47 return $this->url;
48 }

References $url.

Referenced by render().

+ Here is the caller graph for this function:

◆ render()

ilLinkButton::render ( )

Reimplemented from ilButtonBase.

Definition at line 87 of file class.ilLinkButton.php.

87 : string
88 {
89 $this->prepareRender();
90
91 $attr = array();
92 $attr["href"] = $this->getUrl() ?: "#";
93 $attr["target"] = $this->getTarget();
94
95 return '<a' . $this->renderAttributes($attr) . '>' .
96 $this->renderCaption() . '</a>';
97 }
renderAttributes(?array $a_additional_attr=null)
Render current HTML attributes.

References getTarget(), getUrl(), ilButtonBase\prepareRender(), renderAttributes(), and renderCaption().

+ Here is the call graph for this function:

◆ renderAttributes()

ilLinkButton::renderAttributes ( ?array  $a_additional_attr = null)
protected

Render current HTML attributes.

Reimplemented from ilButtonBase.

Definition at line 70 of file class.ilLinkButton.php.

70 : string
71 {
72 if ('_blank' === $this->getTarget()) {
73 $relAttrVal = 'noopener';
74
75 if (isset($a_additional_attr['rel'])) {
76 if (strpos($a_additional_attr['rel'], $relAttrVal) === false) {
77 $a_additional_attr['rel'] .= ' ' . $relAttrVal;
78 }
79 } else {
80 $a_additional_attr['rel'] = $relAttrVal;
81 }
82 }
83
84 return parent::renderAttributes($a_additional_attr);
85 }

References getTarget().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderCaption()

ilLinkButton::renderCaption ( )
protected

Reimplemented in ilImageLinkButton.

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

65 : string
66 {
67 return '&nbsp;' . $this->getCaption() . '&nbsp;';
68 }
getCaption(bool $a_translate=true)

References ilButtonBase\getCaption().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTarget()

ilLinkButton::setTarget ( string  $a_value)

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

50 : void
51 {
52 $this->target = trim($a_value);
53 }

◆ setUrl()

ilLinkButton::setUrl ( string  $a_value)

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

40 : void
41 {
42 $this->url = trim($a_value);
43 }

Field Documentation

◆ $target

string ilLinkButton::$target = ""
protected

Definition at line 28 of file class.ilLinkButton.php.

Referenced by getTarget().

◆ $url

string ilLinkButton::$url = ""
protected

Definition at line 27 of file class.ilLinkButton.php.

Referenced by getUrl().


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