@@ -8,23 +8,23 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | protected $image; |
| 10 | 10 | |
| 11 | - public function __construct($identifier, $content = NULL) { |
|
| 11 | + public function __construct($identifier, $content=NULL) { |
|
| 12 | 12 | parent::__construct($identifier, "item", $content); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | protected function initContent($content) { |
| 16 | 16 | if (\is_array($content)) { |
| 17 | - if (JArray::isAssociative($content) === false) { |
|
| 18 | - $icon = $content[0] ?? null; |
|
| 19 | - $title = $content[1] ?? null; |
|
| 20 | - $desc = $content[2] ?? null; |
|
| 17 | + if (JArray::isAssociative($content)===false) { |
|
| 18 | + $icon=$content[0] ?? null; |
|
| 19 | + $title=$content[1] ?? null; |
|
| 20 | + $desc=$content[2] ?? null; |
|
| 21 | 21 | } else { |
| 22 | - $icon = $content["icon"] ?? null; |
|
| 23 | - $image = $content["image"] ?? null; |
|
| 24 | - $title = $content["title"] ?? null; |
|
| 25 | - $header = $content["header"] ?? null; |
|
| 26 | - $desc = $content["description"] ?? null; |
|
| 27 | - $items = $content["items"] ?? null; |
|
| 22 | + $icon=$content["icon"] ?? null; |
|
| 23 | + $image=$content["image"] ?? null; |
|
| 24 | + $title=$content["title"] ?? null; |
|
| 25 | + $header=$content["header"] ?? null; |
|
| 26 | + $desc=$content["description"] ?? null; |
|
| 27 | + $items=$content["items"] ?? null; |
|
| 28 | 28 | } |
| 29 | 29 | if (isset($icon)) { |
| 30 | 30 | $this->setIcon($icon); |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function addList($items = array(), $ordered = false) { |
|
| 49 | - $list = new HtmlList("", $items); |
|
| 48 | + public function addList($items=array(), $ordered=false) { |
|
| 49 | + $list=new HtmlList("", $items); |
|
| 50 | 50 | if ($ordered) |
| 51 | 51 | $list->setOrdered(); |
| 52 | 52 | $list->setClass("list"); |
| 53 | - $this->content["list"] = $list; |
|
| 53 | + $this->content["list"]=$list; |
|
| 54 | 54 | return $list; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | |
| 48 | 48 | public function addList($items = array(), $ordered = false) { |
| 49 | 49 | $list = new HtmlList("", $items); |
| 50 | - if ($ordered) |
|
| 51 | - $list->setOrdered(); |
|
| 50 | + if ($ordered) { |
|
| 51 | + $list->setOrdered(); |
|
| 52 | + } |
|
| 52 | 53 | $list->setClass("list"); |
| 53 | 54 | $this->content["list"] = $list; |
| 54 | 55 | return $list; |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | protected $_placeholder; |
| 11 | 11 | |
| 12 | - public function __construct($identifier, $type = "text", $value = NULL, $placeholder = NULL) { |
|
| 12 | + public function __construct($identifier, $type="text", $value=NULL, $placeholder=NULL) { |
|
| 13 | 13 | parent::__construct($identifier, "input"); |
| 14 | 14 | $this->setProperty("name", $identifier); |
| 15 | 15 | $this->setValue($value); |
@@ -27,23 +27,23 @@ discard block |
||
| 27 | 27 | return $this->setProperty("type", $value); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function forceValue($value = 'true') { |
|
| 31 | - $this->wrap('<input type="hidden" value="false" name="' . $this->identifier . '"/>'); |
|
| 30 | + public function forceValue($value='true') { |
|
| 31 | + $this->wrap('<input type="hidden" value="false" name="'.$this->identifier.'"/>'); |
|
| 32 | 32 | $this->setValue($value); |
| 33 | 33 | return $this; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function setPlaceholder($value) { |
| 37 | 37 | if (JString::isNotNull($value)) |
| 38 | - $this->_placeholder = $value; |
|
| 38 | + $this->_placeholder=$value; |
|
| 39 | 39 | return $this; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function compile(JsUtils $js = NULL, &$view = NULL) { |
|
| 43 | - $value = $this->_placeholder; |
|
| 42 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
| 43 | + $value=$this->_placeholder; |
|
| 44 | 44 | if (JString::isNull($value)) { |
| 45 | 45 | if (JString::isNotNull($this->getProperty("name"))) |
| 46 | - $value = \ucfirst($this->getProperty("name")); |
|
| 46 | + $value=\ucfirst($this->getProperty("name")); |
|
| 47 | 47 | } |
| 48 | 48 | $this->setProperty("placeholder", $value); |
| 49 | 49 | return parent::compile($js, $view); |
@@ -18,8 +18,9 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function setValue($value) { |
| 21 | - if (isset($value)) |
|
| 22 | - $this->setProperty("value", $value); |
|
| 21 | + if (isset($value)) { |
|
| 22 | + $this->setProperty("value", $value); |
|
| 23 | + } |
|
| 23 | 24 | return $this; |
| 24 | 25 | } |
| 25 | 26 | |
@@ -34,16 +35,18 @@ discard block |
||
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | public function setPlaceholder($value) { |
| 37 | - if (JString::isNotNull($value)) |
|
| 38 | - $this->_placeholder = $value; |
|
| 38 | + if (JString::isNotNull($value)) { |
|
| 39 | + $this->_placeholder = $value; |
|
| 40 | + } |
|
| 39 | 41 | return $this; |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | public function compile(JsUtils $js = NULL, &$view = NULL) { |
| 43 | 45 | $value = $this->_placeholder; |
| 44 | 46 | if (JString::isNull($value)) { |
| 45 | - if (JString::isNotNull($this->getProperty("name"))) |
|
| 46 | - $value = \ucfirst($this->getProperty("name")); |
|
| 47 | + if (JString::isNotNull($this->getProperty("name"))) { |
|
| 48 | + $value = \ucfirst($this->getProperty("name")); |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | $this->setProperty("placeholder", $value); |
| 49 | 52 | return parent::compile($js, $view); |