@@ -7,17 +7,17 @@ |
||
| 7 | 7 | |
| 8 | 8 | class HtmlFormDropdown extends HtmlFormField { |
| 9 | 9 | |
| 10 | - public function __construct($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false) { |
|
| 11 | - parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier,$value,$items))->asSelect($identifier,$multiple), $label); |
|
| 10 | + public function __construct($identifier, $items=array(), $label=NULL, $value=NULL, $multiple=false) { |
|
| 11 | + parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier, $value, $items))->asSelect($identifier, $multiple), $label); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - public function setItems($items){ |
|
| 14 | + public function setItems($items) { |
|
| 15 | 15 | return $this->getField()->setItems($items); |
| 16 | 16 | } |
| 17 | - public function addItem($item,$value=NULL,$image=NULL){ |
|
| 18 | - return $this->getField()->addItem($item,$value,$image); |
|
| 17 | + public function addItem($item, $value=NULL, $image=NULL) { |
|
| 18 | + return $this->getField()->addItem($item, $value, $image); |
|
| 19 | 19 | } |
| 20 | - public static function multipleDropdown($identifier,$items=array(), $label=NULL,$value=NULL){ |
|
| 21 | - return new HtmlFormDropdown($identifier,$items,$label,$value,true); |
|
| 20 | + public static function multipleDropdown($identifier, $items=array(), $label=NULL, $value=NULL) { |
|
| 21 | + return new HtmlFormDropdown($identifier, $items, $label, $value, true); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -21,8 +21,9 @@ |
||
| 21 | 21 | $label->setProperty("tabindex",0); |
| 22 | 22 | } |
| 23 | 23 | $this->setClass("ui checkbox"); |
| 24 | - if(isset($type)) |
|
| 25 | - $this->setType($type); |
|
| 24 | + if(isset($type)) { |
|
| 25 | + $this->setType($type); |
|
| 26 | + } |
|
| 26 | 27 | $this->wrap("<div class='field'>","</div>"); |
| 27 | 28 | } |
| 28 | 29 | |
@@ -10,14 +10,14 @@ |
||
| 10 | 10 | * @version 1.001 |
| 11 | 11 | */ |
| 12 | 12 | class HtmlFormCheckbox extends AbstractHtmlFormRadioCheckbox { |
| 13 | - public function __construct($identifier, $label=NULL,$value=NULL,$type=NULL) { |
|
| 14 | - parent::__construct($identifier, NULL,$label,$value); |
|
| 13 | + public function __construct($identifier, $label=NULL, $value=NULL, $type=NULL) { |
|
| 14 | + parent::__construct($identifier, NULL, $label, $value); |
|
| 15 | 15 | $this->_input->setClass("ui checkbox"); |
| 16 | - if(isset($type)) |
|
| 16 | + if (isset($type)) |
|
| 17 | 17 | $this->setType($type); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function setType($checkboxType){ |
|
| 20 | + public function setType($checkboxType) { |
|
| 21 | 21 | return $this->_input->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants()); |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | abstract class CheckboxType extends BaseEnum { |
| 8 | - const STANDARD="",TOGGLE="toggle",SLIDER="slider"; |
|
| 8 | + const STANDARD="", TOGGLE="toggle", SLIDER="slider"; |
|
| 9 | 9 | } |
| 10 | 10 | \ No newline at end of file |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | * @author jc |
| 10 | 10 | * @version 1.001 |
| 11 | 11 | */ |
| 12 | -abstract class HtmlSemCollection extends HtmlCollection{ |
|
| 12 | +abstract class HtmlSemCollection extends HtmlCollection { |
|
| 13 | 13 | use BaseTrait; |
| 14 | - public function __construct( $identifier, $tagName="div",$baseClass=""){ |
|
| 15 | - parent::__construct( $identifier, $tagName); |
|
| 14 | + public function __construct($identifier, $tagName="div", $baseClass="") { |
|
| 15 | + parent::__construct($identifier, $tagName); |
|
| 16 | 16 | $this->_baseClass=$baseClass; |
| 17 | 17 | $this->setClass($baseClass); |
| 18 | 18 | } |
@@ -7,26 +7,26 @@ |
||
| 7 | 7 | |
| 8 | 8 | class HtmlTextarea extends HtmlDoubleElement { |
| 9 | 9 | |
| 10 | - public function __construct($identifier,$value=NULL,$placeholder=NULL,$rows=NULL) { |
|
| 10 | + public function __construct($identifier, $value=NULL, $placeholder=NULL, $rows=NULL) { |
|
| 11 | 11 | parent::__construct($identifier, "textarea"); |
| 12 | 12 | $this->setValue($value); |
| 13 | 13 | $this->setPlaceholder($placeholder); |
| 14 | - if(isset($rows)) |
|
| 14 | + if (isset($rows)) |
|
| 15 | 15 | $this->setRows($rows); |
| 16 | 16 | } |
| 17 | 17 | public function setValue($value) { |
| 18 | - if(isset($value)) |
|
| 18 | + if (isset($value)) |
|
| 19 | 19 | $this->setContent($value); |
| 20 | 20 | return $this; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function setPlaceholder($value){ |
|
| 24 | - if(JString::isNotNull($value)) |
|
| 23 | + public function setPlaceholder($value) { |
|
| 24 | + if (JString::isNotNull($value)) |
|
| 25 | 25 | $this->setProperty("placeholder", $value); |
| 26 | 26 | return $this; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function setRows($count){ |
|
| 29 | + public function setRows($count) { |
|
| 30 | 30 | $this->setProperty("rows", $count); |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |
@@ -11,18 +11,21 @@ |
||
| 11 | 11 | parent::__construct($identifier, "textarea"); |
| 12 | 12 | $this->setValue($value); |
| 13 | 13 | $this->setPlaceholder($placeholder); |
| 14 | - if(isset($rows)) |
|
| 15 | - $this->setRows($rows); |
|
| 14 | + if(isset($rows)) { |
|
| 15 | + $this->setRows($rows); |
|
| 16 | + } |
|
| 16 | 17 | } |
| 17 | 18 | public function setValue($value) { |
| 18 | - if(isset($value)) |
|
| 19 | - $this->setContent($value); |
|
| 19 | + if(isset($value)) { |
|
| 20 | + $this->setContent($value); |
|
| 21 | + } |
|
| 20 | 22 | return $this; |
| 21 | 23 | } |
| 22 | 24 | |
| 23 | 25 | public function setPlaceholder($value){ |
| 24 | - if(JString::isNotNull($value)) |
|
| 25 | - $this->setProperty("placeholder", $value); |
|
| 26 | + if(JString::isNotNull($value)) { |
|
| 27 | + $this->setProperty("placeholder", $value); |
|
| 28 | + } |
|
| 26 | 29 | return $this; |
| 27 | 30 | } |
| 28 | 31 | |
@@ -8,17 +8,17 @@ |
||
| 8 | 8 | class HtmlFormTextarea extends HtmlFormField { |
| 9 | 9 | use TextFieldsTrait; |
| 10 | 10 | |
| 11 | - public function __construct($identifier, $label=NULL,$value=NULL,$placeholder=NULL,$rows=NULL) { |
|
| 12 | - if(!isset($placeholder)) |
|
| 11 | + public function __construct($identifier, $label=NULL, $value=NULL, $placeholder=NULL, $rows=NULL) { |
|
| 12 | + if (!isset($placeholder)) |
|
| 13 | 13 | $placeholder=$label; |
| 14 | - parent::__construct("field-".$identifier, new HtmlTextarea($identifier,$value,$placeholder,$rows), $label); |
|
| 14 | + parent::__construct("field-".$identifier, new HtmlTextarea($identifier, $value, $placeholder, $rows), $label); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Defines the textarea row count |
| 19 | 19 | * @param int $count |
| 20 | 20 | */ |
| 21 | - public function setRows($count){ |
|
| 21 | + public function setRows($count) { |
|
| 22 | 22 | $this->getField()->setRows($count); |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | \ No newline at end of file |
@@ -8,8 +8,9 @@ |
||
| 8 | 8 | class HtmlFormInput extends HtmlFormField { |
| 9 | 9 | |
| 10 | 10 | public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
| 11 | - if(!isset($placeholder)) |
|
| 12 | - $placeholder=$label; |
|
| 11 | + if(!isset($placeholder)) { |
|
| 12 | + $placeholder=$label; |
|
| 13 | + } |
|
| 13 | 14 | parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
| 14 | 15 | } |
| 15 | 16 | |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | abstract class State extends BaseEnum { |
| 8 | - const ACTIVE="active",DISABLED="disabled",ERROR="error",FOCUS="focus",LOADING="loading",SUCCESS="success",WARNING="warning"; |
|
| 8 | + const ACTIVE="active", DISABLED="disabled", ERROR="error", FOCUS="focus", LOADING="loading", SUCCESS="success", WARNING="warning"; |
|
| 9 | 9 | } |
| 10 | 10 | \ No newline at end of file |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class HtmlFormRadio extends AbstractHtmlFormRadioCheckbox { |
| 12 | 12 | |
| 13 | - public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL) { |
|
| 14 | - parent::__construct($identifier, $name,$label,$value); |
|
| 13 | + public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL) { |
|
| 14 | + parent::__construct($identifier, $name, $label, $value); |
|
| 15 | 15 | $this->_input->getField()->setProperty("type", "radio"); |
| 16 | 16 | $this->_input->setClass("ui radio checkbox"); |
| 17 | - if(isset($name)) |
|
| 17 | + if (isset($name)) |
|
| 18 | 18 | $this->_input->getField()->setProperty("name", $name); |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -14,7 +14,8 @@ |
||
| 14 | 14 | parent::__construct($identifier, $name,$label,$value); |
| 15 | 15 | $this->_input->getField()->setProperty("type", "radio"); |
| 16 | 16 | $this->_input->setClass("ui radio checkbox"); |
| 17 | - if(isset($name)) |
|
| 18 | - $this->_input->getField()->setProperty("name", $name); |
|
| 17 | + if(isset($name)) { |
|
| 18 | + $this->_input->getField()->setProperty("name", $name); |
|
| 19 | + } |
|
| 19 | 20 | } |
| 20 | 21 | } |
| 21 | 22 | \ No newline at end of file |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | class HtmlFormInput extends HtmlFormField { |
| 8 | 8 | use TextFieldsTrait; |
| 9 | 9 | |
| 10 | - public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
|
| 11 | - if(!isset($placeholder) && $type==="text") |
|
| 10 | + public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) { |
|
| 11 | + if (!isset($placeholder) && $type==="text") |
|
| 12 | 12 | $placeholder=$label; |
| 13 | - parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
|
| 13 | + parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label); |
|
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | \ No newline at end of file |
@@ -8,8 +8,9 @@ |
||
| 8 | 8 | use TextFieldsTrait; |
| 9 | 9 | |
| 10 | 10 | public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
| 11 | - if(!isset($placeholder) && $type==="text") |
|
| 12 | - $placeholder=$label; |
|
| 11 | + if(!isset($placeholder) && $type==="text") { |
|
| 12 | + $placeholder=$label; |
|
| 13 | + } |
|
| 13 | 14 | parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
| 14 | 15 | } |
| 15 | 16 | } |
| 16 | 17 | \ No newline at end of file |