ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Bulky.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
5 
6 use ILIAS\UI\Component as C;
7 
11 class Bulky extends Button implements C\Button\Bulky
12 {
13 
17  protected $icon_or_glyph;
18 
22  protected $engaged = false;
23 
25  {
26  $allowed_classes = [C\Icon\Icon::class, C\Glyph\Glyph::class];
27  $graphical_param = array($icon_or_glyph);
28  $this->checkArgListElements("icon_or_glyph", $graphical_param, $allowed_classes);
29  $this->checkStringArg("label", $label);
30  $this->checkStringArg("action", $action);
31  $this->icon_or_glyph = $icon_or_glyph;
32  $this->label = $label;
33  $this->action = $action;
34  }
35 
39  public function getIconOrGlyph()
40  {
41  return $this->icon_or_glyph;
42  }
43 
47  public function withEngagedState($state)
48  {
49  $this->checkBoolArg("state", $state);
50  $clone = clone $this;
51  $clone->engaged = $state;
52  return $clone;
53  }
54 
58  public function isEngaged()
59  {
60  return $this->engaged;
61  }
62 }
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes. ...
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
checkBoolArg($which, $value)
Throw an InvalidArgumentException if $value is not a bool.
__construct($icon_or_glyph, $label, $action)
Definition: Bulky.php:24