@@ -94,10 +94,11 @@ |
||
| 94 | 94 | |
| 95 | 95 | protected function setDivider($divider,$index){ |
| 96 | 96 | if(isset($index)){ |
| 97 | - if(\is_array($this->_contentSeparator)===false) |
|
| 98 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
| 97 | + if(\is_array($this->_contentSeparator)===false) { |
|
| 98 | + $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
| 99 | + } |
|
| 99 | 100 | $this->_contentSeparator[$index]=$divider; |
| 100 | - }else{ |
|
| 101 | + } else{ |
|
| 101 | 102 | $this->_contentSeparator=$divider; |
| 102 | 103 | } |
| 103 | 104 | return $this; |
@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) { |
| 15 | 15 | parent::__construct($identifier, "div", "ui progress"); |
| 16 | - if (isset($value) === true) |
|
| 17 | - $this->setProperty("data-percent", $value); |
|
| 16 | + if (isset($value) === true) { |
|
| 17 | + $this->setProperty("data-percent", $value); |
|
| 18 | + } |
|
| 18 | 19 | $this->createBar(); |
| 19 | - if (isset($label) === true) |
|
| 20 | - $this->setLabel($label); |
|
| 20 | + if (isset($label) === true) { |
|
| 21 | + $this->setLabel($label); |
|
| 22 | + } |
|
| 21 | 23 | $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
| 22 | 24 | $this->addToProperty("class", $attributes); |
| 23 | 25 | } |
@@ -116,8 +118,9 @@ discard block |
||
| 116 | 118 | * @see BaseHtml::run() |
| 117 | 119 | */ |
| 118 | 120 | public function run(JsUtils $js) { |
| 119 | - if (isset($this->_bsComponent) === false) |
|
| 120 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
| 121 | + if (isset($this->_bsComponent) === false) { |
|
| 122 | + $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
| 123 | + } |
|
| 121 | 124 | $this->addEventsOnRun($js); |
| 122 | 125 | return $this->_bsComponent; |
| 123 | 126 | } |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | foreach ($actions as $action){ |
| 44 | 44 | $this->addAction($action); |
| 45 | 45 | } |
| 46 | - } |
|
| 47 | - else{ |
|
| 46 | + } else{ |
|
| 48 | 47 | $this->addAction($actions); |
| 49 | 48 | } |
| 50 | 49 | return $this; |
@@ -60,8 +59,9 @@ discard block |
||
| 60 | 59 | $class="cancel"; |
| 61 | 60 | } |
| 62 | 61 | $action=new HtmlButton("action-".$this->identifier,$action); |
| 63 | - if($class!=="") |
|
| 64 | - $action->addToProperty("class", $class); |
|
| 62 | + if($class!=="") { |
|
| 63 | + $action->addToProperty("class", $class); |
|
| 64 | + } |
|
| 65 | 65 | } |
| 66 | 66 | return $this->addElementInPart($action, "actions"); |
| 67 | 67 | } |
@@ -169,8 +169,9 @@ discard block |
||
| 169 | 169 | * @see BaseHtml::run() |
| 170 | 170 | */ |
| 171 | 171 | public function run(JsUtils $js) { |
| 172 | - if(isset($this->_bsComponent)===false) |
|
| 173 | - $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
| 172 | + if(isset($this->_bsComponent)===false) { |
|
| 173 | + $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
| 174 | + } |
|
| 174 | 175 | $this->addEventsOnRun($js); |
| 175 | 176 | return $this->_bsComponent; |
| 176 | 177 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | if(!$item instanceof HtmlDropdownItem){ |
| 70 | 70 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
| 71 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
| 71 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
| 72 | 72 | $this->addToProperty("class", "vertical"); |
| 73 | 73 | } |
| 74 | 74 | return $itemO; |
@@ -82,8 +82,9 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function addInput($name){ |
| 85 | - if(!isset($name)) |
|
| 86 | - $name="input-".$this->identifier; |
|
| 85 | + if(!isset($name)) { |
|
| 86 | + $name="input-".$this->identifier; |
|
| 87 | + } |
|
| 87 | 88 | $this->setAction("activate"); |
| 88 | 89 | $this->input=new HtmlInput($name,"hidden"); |
| 89 | 90 | } |
@@ -93,7 +94,7 @@ discard block |
||
| 93 | 94 | foreach ($items as $k=>$v){ |
| 94 | 95 | $this->addItem($v)->setData($k); |
| 95 | 96 | } |
| 96 | - }else{ |
|
| 97 | + } else{ |
|
| 97 | 98 | foreach ($items as $item){ |
| 98 | 99 | $this->addItem($item); |
| 99 | 100 | } |
@@ -110,7 +111,7 @@ discard block |
||
| 110 | 111 | if($dropdown===false){ |
| 111 | 112 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
| 112 | 113 | $dropdown="menu"; |
| 113 | - }else{ |
|
| 114 | + } else{ |
|
| 114 | 115 | $dropdown="dropdown"; |
| 115 | 116 | $this->mClass="menu"; |
| 116 | 117 | } |
@@ -126,18 +127,22 @@ discard block |
||
| 126 | 127 | } |
| 127 | 128 | |
| 128 | 129 | public function asButton($floating=false){ |
| 129 | - if($floating) |
|
| 130 | - $this->addToProperty("class", "floating"); |
|
| 130 | + if($floating) { |
|
| 131 | + $this->addToProperty("class", "floating"); |
|
| 132 | + } |
|
| 131 | 133 | return $this->addToProperty("class", "button"); |
| 132 | 134 | } |
| 133 | 135 | |
| 134 | 136 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
| 135 | - if(isset($name)) |
|
| 136 | - $this->addInput($name); |
|
| 137 | - if($multiple) |
|
| 138 | - $this->addToProperty("class", "multiple"); |
|
| 139 | - if ($selection) |
|
| 140 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
| 137 | + if(isset($name)) { |
|
| 138 | + $this->addInput($name); |
|
| 139 | + } |
|
| 140 | + if($multiple) { |
|
| 141 | + $this->addToProperty("class", "multiple"); |
|
| 142 | + } |
|
| 143 | + if ($selection) { |
|
| 144 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
| 145 | + } |
|
| 141 | 146 | return $this; |
| 142 | 147 | } |
| 143 | 148 | |
@@ -147,8 +152,9 @@ discard block |
||
| 147 | 152 | } |
| 148 | 153 | |
| 149 | 154 | public function setSelect($name=NULL,$multiple=false){ |
| 150 | - if(!isset($name)) |
|
| 151 | - $name="select-".$this->identifier; |
|
| 155 | + if(!isset($name)) { |
|
| 156 | + $name="select-".$this->identifier; |
|
| 157 | + } |
|
| 152 | 158 | $this->input=null; |
| 153 | 159 | if($multiple){ |
| 154 | 160 | $this->setProperty("multiple", true); |
@@ -179,12 +185,13 @@ discard block |
||
| 179 | 185 | public function setValue($value){ |
| 180 | 186 | if(isset($this->input)){ |
| 181 | 187 | $this->input->setProperty("value", $value); |
| 182 | - }else{ |
|
| 188 | + } else{ |
|
| 183 | 189 | $this->setProperty("value", $value); |
| 184 | 190 | } |
| 185 | 191 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
| 186 | - if(isset($textElement)) |
|
| 187 | - $textElement->setContent($value); |
|
| 192 | + if(isset($textElement)) { |
|
| 193 | + $textElement->setContent($value); |
|
| 194 | + } |
|
| 188 | 195 | return $this; |
| 189 | 196 | } |
| 190 | 197 | |
@@ -194,8 +201,9 @@ discard block |
||
| 194 | 201 | */ |
| 195 | 202 | public function run(JsUtils $js) { |
| 196 | 203 | if($this->propertyContains("class", "simple")===false){ |
| 197 | - if(isset($this->_bsComponent)===false) |
|
| 198 | - $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
| 204 | + if(isset($this->_bsComponent)===false) { |
|
| 205 | + $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
| 206 | + } |
|
| 199 | 207 | $this->addEventsOnRun($js); |
| 200 | 208 | return $this->_bsComponent; |
| 201 | 209 | } |
@@ -13,8 +13,9 @@ discard block |
||
| 13 | 13 | $field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value); |
| 14 | 14 | $field->setProperty("name", $name); |
| 15 | 15 | $this->setField($field); |
| 16 | - if (isset($label)) |
|
| 17 | - $this->setLabel($label); |
|
| 16 | + if (isset($label)) { |
|
| 17 | + $this->setLabel($label); |
|
| 18 | + } |
|
| 18 | 19 | } |
| 19 | 20 | |
| 20 | 21 | public function setType($checkboxType) { |
@@ -40,8 +41,9 @@ discard block |
||
| 40 | 41 | * @return mixed |
| 41 | 42 | */ |
| 42 | 43 | public function getLabel() { |
| 43 | - if (\array_key_exists("label", $this->content)) |
|
| 44 | - return $this->content["label"]; |
|
| 44 | + if (\array_key_exists("label", $this->content)) { |
|
| 45 | + return $this->content["label"]; |
|
| 46 | + } |
|
| 45 | 47 | } |
| 46 | 48 | |
| 47 | 49 | /** |
@@ -26,8 +26,9 @@ discard block |
||
| 26 | 26 | public function asIcon($icon, $title, $subHeader=NULL) { |
| 27 | 27 | $header=new HtmlHeader("header-" . $this->identifier); |
| 28 | 28 | $header->asIcon($icon, $title, $subHeader); |
| 29 | - if ($this->_inverted === false) |
|
| 30 | - $header->setInverted(); |
|
| 29 | + if ($this->_inverted === false) { |
|
| 30 | + $header->setInverted(); |
|
| 31 | + } |
|
| 31 | 32 | return $this->setContent($header); |
| 32 | 33 | } |
| 33 | 34 | |
@@ -42,14 +43,16 @@ discard block |
||
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | public function run(JsUtils $js) { |
| 45 | - if ($this->_container instanceof HtmlSingleElement) |
|
| 46 | - $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
| 46 | + if ($this->_container instanceof HtmlSingleElement) { |
|
| 47 | + $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
| 48 | + } |
|
| 47 | 49 | return parent::run($js); |
| 48 | 50 | } |
| 49 | 51 | |
| 50 | 52 | public function jsShow() { |
| 51 | - if (isset($this->_container) === true) |
|
| 52 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 53 | + if (isset($this->_container) === true) { |
|
| 54 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 55 | + } |
|
| 53 | 56 | } |
| 54 | 57 | |
| 55 | 58 | public function setBlurring() { |
@@ -10,8 +10,9 @@ |
||
| 10 | 10 | |
| 11 | 11 | public function __construct($identifier,$context=NULL,$content=NULL) { |
| 12 | 12 | parent::__construct($identifier, "div", "ui sticky", $content); |
| 13 | - if(isset($content)) |
|
| 14 | - $this->setContext($context); |
|
| 13 | + if(isset($content)) { |
|
| 14 | + $this->setContext($context); |
|
| 15 | + } |
|
| 15 | 16 | } |
| 16 | 17 | |
| 17 | 18 | public function setContext($context){ |
@@ -22,10 +22,12 @@ |
||
| 22 | 22 | |
| 23 | 23 | private function createField($placeholder=NULL, $icon=NULL) { |
| 24 | 24 | $field=new HtmlInput($this->identifier); |
| 25 | - if (isset($placeholder) === true) |
|
| 26 | - $field->setPlaceholder($placeholder); |
|
| 27 | - if (isset($icon) === true) |
|
| 28 | - $field->addIcon($icon, Direction::RIGHT); |
|
| 25 | + if (isset($placeholder) === true) { |
|
| 26 | + $field->setPlaceholder($placeholder); |
|
| 27 | + } |
|
| 28 | + if (isset($icon) === true) { |
|
| 29 | + $field->addIcon($icon, Direction::RIGHT); |
|
| 30 | + } |
|
| 29 | 31 | $field->getField()->setClass("prompt"); |
| 30 | 32 | $this->content["field"]=$field; |
| 31 | 33 | return $field; |
@@ -62,8 +62,9 @@ |
||
| 62 | 62 | * @see BaseHtml::run() |
| 63 | 63 | */ |
| 64 | 64 | public function run(JsUtils $js) { |
| 65 | - if(isset($this->_bsComponent)===false) |
|
| 66 | - $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
| 65 | + if(isset($this->_bsComponent)===false) { |
|
| 66 | + $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
| 67 | + } |
|
| 67 | 68 | $this->addEventsOnRun($js); |
| 68 | 69 | return $this->_bsComponent; |
| 69 | 70 | } |