@@ -7,20 +7,20 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class HtmlFormDropdown extends HtmlFormField { |
| 9 | 9 | |
| 10 | - public function __construct($identifier, $items = array(), $label = NULL, $value = "", $multiple = false, $associative = true) { |
|
| 11 | - parent::__construct("field-" . $identifier, (new HtmlDropdown("dropdown-" . $identifier, $value, $items, $associative))->asSelect($identifier, $multiple), $label); |
|
| 12 | - $this->_identifier = $identifier; |
|
| 10 | + public function __construct($identifier, $items=array(), $label=NULL, $value="", $multiple=false, $associative=true) { |
|
| 11 | + parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier, $value, $items, $associative))->asSelect($identifier, $multiple), $label); |
|
| 12 | + $this->_identifier=$identifier; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | public function setItems($items) { |
| 16 | 16 | return $this->getField()->setItems($items); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function addItem($item, $value = NULL, $image = NULL) { |
|
| 19 | + public function addItem($item, $value=NULL, $image=NULL) { |
|
| 20 | 20 | return $this->getField()->addItem($item, $value, $image); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public static function multipleDropdown($identifier, $items = array(), $label = NULL, $value = "", $associative = true) { |
|
| 23 | + public static function multipleDropdown($identifier, $items=array(), $label=NULL, $value="", $associative=true) { |
|
| 24 | 24 | return new HtmlFormDropdown($identifier, $items, $label, $value, true, $associative); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | return $this->getField()->getInput(); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function asSelect($name = NULL, $multiple = false, $selection = true) { |
|
| 35 | + public function asSelect($name=NULL, $multiple=false, $selection=true) { |
|
| 36 | 36 | $this->getField()->asSelect($name, $multiple, $selection); |
| 37 | 37 | return $this; |
| 38 | 38 | } |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | * @param boolean $floating |
| 43 | 43 | * @return HtmlDropdown |
| 44 | 44 | */ |
| 45 | - public function asButton($floating = false) { |
|
| 46 | - $field = $this->content["field"]; |
|
| 47 | - $label = $this->content["label"]; |
|
| 45 | + public function asButton($floating=false) { |
|
| 46 | + $field=$this->content["field"]; |
|
| 47 | + $label=$this->content["label"]; |
|
| 48 | 48 | $field->addContent($label); |
| 49 | - $this->content = [ |
|
| 49 | + $this->content=[ |
|
| 50 | 50 | "field" => $field |
| 51 | 51 | ]; |
| 52 | 52 | $this->content["field"]->asButton($floating); |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | * @param boolean $labeled |
| 62 | 62 | * @return mixed|HtmlButton |
| 63 | 63 | */ |
| 64 | - public function addAction($action, $direction = Direction::RIGHT, $icon = NULL, $labeled = false) { |
|
| 64 | + public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $labeled=false) { |
|
| 65 | 65 | $this->getField()->setStyle('display:inline-block; width: auto'); |
| 66 | - $actionO = $action; |
|
| 67 | - if (\is_object($action) === false) { |
|
| 68 | - $actionO = new HtmlButton("action-" . $this->identifier, $action); |
|
| 66 | + $actionO=$action; |
|
| 67 | + if (\is_object($action)===false) { |
|
| 68 | + $actionO=new HtmlButton("action-".$this->identifier, $action); |
|
| 69 | 69 | if (isset($icon)) |
| 70 | 70 | $actionO->addIcon($icon, true, $labeled); |
| 71 | 71 | } |
| 72 | - $this->addContent($actionO, \strstr($direction, Direction::LEFT) !== false); |
|
| 72 | + $this->addContent($actionO, \strstr($direction, Direction::LEFT)!==false); |
|
| 73 | 73 | return $actionO; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -66,8 +66,9 @@ |
||
| 66 | 66 | $actionO = $action; |
| 67 | 67 | if (\is_object($action) === false) { |
| 68 | 68 | $actionO = new HtmlButton("action-" . $this->identifier, $action); |
| 69 | - if (isset($icon)) |
|
| 70 | - $actionO->addIcon($icon, true, $labeled); |
|
| 69 | + if (isset($icon)) { |
|
| 70 | + $actionO->addIcon($icon, true, $labeled); |
|
| 71 | + } |
|
| 71 | 72 | } |
| 72 | 73 | $this->addContent($actionO, \strstr($direction, Direction::LEFT) !== false); |
| 73 | 74 | return $actionO; |