ILIAS  release_8 Revision v8.24
ilDclLinkButton 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 ilDclLinkButton:
+ Collaboration diagram for ilDclLinkButton:

Public Member Functions

 isUseWrapper ()
 
 setUseWrapper (bool $useWrapper)
 
 render ()
 
 addAttribute (string $key, string $value, bool $wrapper=false)
 
 removeAttribute (string $key, $wrapper=false)
 
 getAttribute (string $key, bool $wrapper=false)
 
- Public Member Functions inherited from ilLinkButton
 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 ()
 
static getInstance ()
 

Data Fields

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

Protected Member Functions

 prepareRender ()
 
 getGroupKey ($wrapper)
 
- Protected Member Functions inherited from ilLinkButton
 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

array $attributes
 
bool $useWrapper = false
 
- Protected Attributes inherited from ilLinkButton
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
 

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

Definition at line 19 of file class.ilDclLinkButton.php.

Member Function Documentation

◆ addAttribute()

ilDclLinkButton::addAttribute ( string  $key,
string  $value,
bool  $wrapper = false 
)

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

66 : void
67 {
68 $this->attributes[$this->getGroupKey($wrapper)][$key] = $value;
69 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, and getGroupKey().

Referenced by prepareRender().

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

◆ getAttribute()

ilDclLinkButton::getAttribute ( string  $key,
bool  $wrapper = false 
)

Definition at line 82 of file class.ilDclLinkButton.php.

82 : ?string
83 {
84 if (isset($this->attributes[$this->getGroupKey($wrapper)][$key])) {
85 return $this->attributes[$this->getGroupKey($wrapper)][$key];
86 }
87
88 return null;
89 }

References ILIAS\LTI\ToolProvider\$key, and getGroupKey().

+ Here is the call graph for this function:

◆ getGroupKey()

ilDclLinkButton::getGroupKey (   $wrapper)
protected

Definition at line 91 of file class.ilDclLinkButton.php.

91 : string
92 {
93 return ($wrapper) ? 'wrapper' : 'default';
94 }

Referenced by addAttribute(), getAttribute(), and removeAttribute().

+ Here is the caller graph for this function:

◆ getInstance()

static ilDclLinkButton::getInstance ( )
static

Reimplemented from ilLinkButton.

Definition at line 35 of file class.ilDclLinkButton.php.

35 : self
36 {
37 return new self(self::TYPE_DATACOLLECTION_LINK);
38 }

References TYPE_DATACOLLECTION_LINK.

Referenced by ilDclTableViewTableGUI\buildAction().

+ Here is the caller graph for this function:

◆ isUseWrapper()

ilDclLinkButton::isUseWrapper ( )

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

25 : bool
26 {
27 return $this->useWrapper;
28 }

References $useWrapper.

◆ prepareRender()

ilDclLinkButton::prepareRender ( )
protected

Reimplemented from ilButtonBase.

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

40 : void
41 {
42 parent::prepareRender();
43
44 $this->addAttribute('href', ($this->getUrl() ?: "#"));
45 $this->addAttribute('target', $this->getTarget());
46 }
addAttribute(string $key, string $value, bool $wrapper=false)

References addAttribute(), ilLinkButton\getTarget(), and ilLinkButton\getUrl().

Referenced by render().

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

◆ removeAttribute()

ilDclLinkButton::removeAttribute ( string  $key,
  $wrapper = false 
)

Definition at line 71 of file class.ilDclLinkButton.php.

71 : bool
72 {
73 if (isset($this->attributes[$this->getGroupKey($wrapper)][$key])) {
74 unset($this->attributes[$this->getGroupKey($wrapper)][$key]);
75
76 return true;
77 }
78
79 return false;
80 }

References ILIAS\LTI\ToolProvider\$key, and getGroupKey().

+ Here is the call graph for this function:

◆ render()

ilDclLinkButton::render ( )

Reimplemented from ilLinkButton.

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

48 : string
49 {
50 $this->prepareRender();
51
52 $output = '';
53 if ($this->useWrapper) {
54 $output .= '<div' . $this->renderAttributesHelper($this->attributes['wrapper']) . '>';
55 }
56
57 $output .= '<a' . $this->renderAttributes($this->attributes['default']) . '>' . $this->renderCaption() . '</a>';
58
59 if ($this->useWrapper) {
60 $output .= '</div>';
61 }
62
63 return $output;
64 }
renderAttributesHelper(array $a_attr)
renderAttributes(array $a_additional_attr=null)
Render current HTML attributes.

References prepareRender(), ilLinkButton\renderAttributes(), ilButtonBase\renderAttributesHelper(), and ilLinkButton\renderCaption().

+ Here is the call graph for this function:

◆ setUseWrapper()

ilDclLinkButton::setUseWrapper ( bool  $useWrapper)

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

30 : void
31 {
32 $this->useWrapper = $useWrapper;
33 }

References $useWrapper.

Field Documentation

◆ $attributes

array ilDclLinkButton::$attributes
protected

Definition at line 22 of file class.ilDclLinkButton.php.

◆ $useWrapper

bool ilDclLinkButton::$useWrapper = false
protected

Definition at line 23 of file class.ilDclLinkButton.php.

Referenced by isUseWrapper(), and setUseWrapper().

◆ TYPE_DATACOLLECTION_LINK

const ilDclLinkButton::TYPE_DATACOLLECTION_LINK = 99

Definition at line 21 of file class.ilDclLinkButton.php.

Referenced by getInstance().


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