@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(JsUtils $js) { |
| 18 | 18 | parent::__construct($js); |
| 19 | - $this->params = array( |
|
| 19 | + $this->params=array( |
|
| 20 | 20 | "active" => 0 |
| 21 | 21 | ); |
| 22 | - $this->uiName = "accordion"; |
|
| 22 | + $this->uiName="accordion"; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function setAnimate($value) { |
| 56 | 56 | if ($value instanceof Animation) |
| 57 | - $value = $value->getParams(); |
|
| 57 | + $value=$value->getParams(); |
|
| 58 | 58 | else if (is_string($value)) { |
| 59 | - $animation = new Animation(); |
|
| 59 | + $animation=new Animation(); |
|
| 60 | 60 | $animation->setEasing($value); |
| 61 | 61 | } |
| 62 | 62 | $this->setParam("animate", $value); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function setIcons($value) { |
| 147 | 147 | if (is_string($value)) { |
| 148 | 148 | if (JString::startsWith($value, "{")); |
| 149 | - $value = "%" . $value . "%"; |
|
| 149 | + $value="%".$value."%"; |
|
| 150 | 150 | } |
| 151 | 151 | $this->setParam("icons", $value); |
| 152 | 152 | return $this; |
@@ -53,9 +53,9 @@ |
||
| 53 | 53 | * @return $this |
| 54 | 54 | */ |
| 55 | 55 | public function setAnimate($value) { |
| 56 | - if ($value instanceof Animation) |
|
| 57 | - $value = $value->getParams(); |
|
| 58 | - else if (is_string($value)) { |
|
| 56 | + if ($value instanceof Animation) { |
|
| 57 | + $value = $value->getParams(); |
|
| 58 | + } else if (is_string($value)) { |
|
| 59 | 59 | $animation = new Animation(); |
| 60 | 60 | $animation->setEasing($value); |
| 61 | 61 | } |
@@ -14,6 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function __construct(JsUtils $js) { |
| 16 | 16 | parent::__construct($js); |
| 17 | - $this->uiName = "selectmenu"; |
|
| 17 | + $this->uiName="selectmenu"; |
|
| 18 | 18 | } |
| 19 | 19 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function __construct(JsUtils $js) { |
| 16 | 16 | parent::__construct($js); |
| 17 | - $this->uiName = "slider"; |
|
| 17 | + $this->uiName="slider"; |
|
| 18 | 18 | $this->setParam("value", 0); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function __construct(JsUtils $js) { |
| 16 | 16 | parent::__construct($js); |
| 17 | - $this->params = array( |
|
| 17 | + $this->params=array( |
|
| 18 | 18 | "value" => 50 |
| 19 | 19 | ); |
| 20 | - $this->uiName = "progressbar"; |
|
| 20 | + $this->uiName="progressbar"; |
|
| 21 | 21 | } |
| 22 | 22 | } |
@@ -14,15 +14,15 @@ discard block |
||
| 14 | 14 | class DialogButton extends BaseComponent { |
| 15 | 15 | |
| 16 | 16 | private function addFunction($jsCode) { |
| 17 | - if (! JString::startsWith($jsCode, "function")) |
|
| 18 | - $jsCode = "%function(){" . $jsCode . "}%"; |
|
| 17 | + if (!JString::startsWith($jsCode, "function")) |
|
| 18 | + $jsCode="%function(){".$jsCode."}%"; |
|
| 19 | 19 | return $jsCode; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - public function __construct($caption, $jsCode, $event = "click") { |
|
| 22 | + public function __construct($caption, $jsCode, $event="click") { |
|
| 23 | 23 | parent::__construct(NULL); |
| 24 | - $this->params["text"] = $caption; |
|
| 25 | - $this->params[$event] = $this->addFunction($jsCode); |
|
| 24 | + $this->params["text"]=$caption; |
|
| 25 | + $this->params[$event]=$this->addFunction($jsCode); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function __toString() { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | return json_encode($this->params, JSON_UNESCAPED_SLASHES); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public static function cancelButton($caption = "Annuler") { |
|
| 40 | + public static function cancelButton($caption="Annuler") { |
|
| 41 | 41 | return new DialogButton($caption, "$( this ).dialog( 'close' );"); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null) |
| 53 | 53 | * @return DialogButton |
| 54 | 54 | */ |
| 55 | - public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption = "Okay", $parameters = []) { |
|
| 56 | - return new DialogButton($caption, $js->postFormDeferred($url, $form, $responseElement, $parameters) . ";$( this ).dialog( 'close' );"); |
|
| 55 | + public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption="Okay", $parameters=[]) { |
|
| 56 | + return new DialogButton($caption, $js->postFormDeferred($url, $form, $responseElement, $parameters).";$( this ).dialog( 'close' );"); |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -14,8 +14,9 @@ |
||
| 14 | 14 | class DialogButton extends BaseComponent { |
| 15 | 15 | |
| 16 | 16 | private function addFunction($jsCode) { |
| 17 | - if (! JString::startsWith($jsCode, "function")) |
|
| 18 | - $jsCode = "%function(){" . $jsCode . "}%"; |
|
| 17 | + if (! JString::startsWith($jsCode, "function")) { |
|
| 18 | + $jsCode = "%function(){" . $jsCode . "}%"; |
|
| 19 | + } |
|
| 19 | 20 | return $jsCode; |
| 20 | 21 | } |
| 21 | 22 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function __construct(JsUtils $js) { |
| 16 | 16 | parent::__construct($js); |
| 17 | - $this->uiName = "buttonset"; |
|
| 17 | + $this->uiName="buttonset"; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | class Position extends BaseComponent { |
| 13 | 13 | |
| 14 | - public function __construct($my = "left top", $at = "left bottom", $collision = "none", $within = "window") { |
|
| 14 | + public function __construct($my="left top", $at="left bottom", $collision="none", $within="window") { |
|
| 15 | 15 | $this->setParam("my", $my); |
| 16 | 16 | $this->setParam("at", $at); |
| 17 | 17 | $this->setParam("collision", $collision); |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | protected function setParamCtrl($key, $value, $typeCtrl) { |
| 85 | - if (! $typeCtrl($value)) { |
|
| 86 | - throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $key . " à la position"); |
|
| 85 | + if (!$typeCtrl($value)) { |
|
| 86 | + throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." à la position"); |
|
| 87 | 87 | } else |
| 88 | 88 | $this->setParam($key, $value); |
| 89 | 89 | } |
@@ -84,8 +84,9 @@ |
||
| 84 | 84 | protected function setParamCtrl($key, $value, $typeCtrl) { |
| 85 | 85 | if (! $typeCtrl($value)) { |
| 86 | 86 | throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $key . " à la position"); |
| 87 | - } else |
|
| 88 | - $this->setParam($key, $value); |
|
| 87 | + } else { |
|
| 88 | + $this->setParam($key, $value); |
|
| 89 | + } |
|
| 89 | 90 | } |
| 90 | 91 | |
| 91 | 92 | /* |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class Animation extends BaseComponent { |
| 13 | 13 | |
| 14 | - public function __construct($duration = 400, $easing = "swing", $queue = false) { |
|
| 14 | + public function __construct($duration=400, $easing="swing", $queue=false) { |
|
| 15 | 15 | $this->setDuration($duration); |
| 16 | 16 | $this->setEasing($easing); |
| 17 | 17 | $this->setQueue($queue); |
@@ -23,22 +23,22 @@ discard block |
||
| 23 | 23 | class HtmlSemDoubleElement extends HtmlDoubleElement { |
| 24 | 24 | use BaseTrait; |
| 25 | 25 | |
| 26 | - protected $_popup = NULL; |
|
| 26 | + protected $_popup=NULL; |
|
| 27 | 27 | |
| 28 | - protected $_dimmer = NULL; |
|
| 28 | + protected $_dimmer=NULL; |
|
| 29 | 29 | |
| 30 | - protected $_toast = NULL; |
|
| 30 | + protected $_toast=NULL; |
|
| 31 | 31 | |
| 32 | - protected $_sidebar = NULL; |
|
| 32 | + protected $_sidebar=NULL; |
|
| 33 | 33 | |
| 34 | - protected $_params = array(); |
|
| 34 | + protected $_params=array(); |
|
| 35 | 35 | |
| 36 | - public function __construct($identifier, $tagName = "p", $baseClass = "ui", $content = NULL) { |
|
| 36 | + public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) { |
|
| 37 | 37 | parent::__construct($identifier, $tagName); |
| 38 | - $this->_baseClass = $baseClass; |
|
| 38 | + $this->_baseClass=$baseClass; |
|
| 39 | 39 | $this->setClass($baseClass); |
| 40 | 40 | if (isset($content)) { |
| 41 | - $this->content = $content; |
|
| 41 | + $this->content=$content; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param string $variation |
| 49 | 49 | * @param string $popupEvent |
| 50 | 50 | */ |
| 51 | - public function setPopupAttributes($variation = NULL, $popupEvent = NULL) { |
|
| 51 | + public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
|
| 52 | 52 | if (isset($this->_popup)) |
| 53 | 53 | $this->_popup->setAttributes($variation, $popupEvent); |
| 54 | 54 | } |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | * @param array $params |
| 63 | 63 | * @return HtmlSemDoubleElement |
| 64 | 64 | */ |
| 65 | - public function addPopup($title = "", $content = "", $variation = NULL, $params = array()) { |
|
| 66 | - $this->_popup = new InternalPopup($this, $title, $content, $variation, $params); |
|
| 65 | + public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
|
| 66 | + $this->_popup=new InternalPopup($this, $title, $content, $variation, $params); |
|
| 67 | 67 | return $this; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | * @param array $params |
| 76 | 76 | * @return HtmlSemDoubleElement |
| 77 | 77 | */ |
| 78 | - public function addPopupHtml($html = "", $variation = NULL, $params = array()) { |
|
| 79 | - $this->_popup = new InternalPopup($this); |
|
| 78 | + public function addPopupHtml($html="", $variation=NULL, $params=array()) { |
|
| 79 | + $this->_popup=new InternalPopup($this); |
|
| 80 | 80 | $this->_popup->setHtml($html); |
| 81 | 81 | $this->_popup->setAttributes($variation, $params); |
| 82 | 82 | return $this; |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | * @param mixed $content |
| 90 | 90 | * @return HtmlDimmer |
| 91 | 91 | */ |
| 92 | - public function addDimmer($params = array(), $content = NULL) { |
|
| 93 | - $dimmer = new HtmlDimmer("dimmer-" . $this->identifier, $content); |
|
| 92 | + public function addDimmer($params=array(), $content=NULL) { |
|
| 93 | + $dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content); |
|
| 94 | 94 | $dimmer->setParams($params); |
| 95 | 95 | $dimmer->setContainer($this); |
| 96 | 96 | $this->addContent($dimmer); |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | * @param string $icon |
| 106 | 106 | * @return mixed|HtmlLabel |
| 107 | 107 | */ |
| 108 | - public function addLabel($label, $before = false, $icon = NULL) { |
|
| 109 | - $labelO = $label; |
|
| 110 | - if (\is_object($label) === false) { |
|
| 111 | - $labelO = new HtmlLabel("label-" . $this->identifier, $label); |
|
| 108 | + public function addLabel($label, $before=false, $icon=NULL) { |
|
| 109 | + $labelO=$label; |
|
| 110 | + if (\is_object($label)===false) { |
|
| 111 | + $labelO=new HtmlLabel("label-".$this->identifier, $label); |
|
| 112 | 112 | if (isset($icon)) |
| 113 | 113 | $labelO->addIcon($icon); |
| 114 | 114 | } else { |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | * @param string $icon |
| 130 | 130 | * @return HtmlSemDoubleElement |
| 131 | 131 | */ |
| 132 | - public function attachLabel($label, $side = Side::TOP, $direction = Direction::NONE, $icon = NULL) { |
|
| 133 | - $label = $this->addLabel($label, true, $icon); |
|
| 132 | + public function attachLabel($label, $side=Side::TOP, $direction=Direction::NONE, $icon=NULL) { |
|
| 133 | + $label=$this->addLabel($label, true, $icon); |
|
| 134 | 134 | $label->setAttached($side, $direction); |
| 135 | 135 | return $this; |
| 136 | 136 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * |
| 141 | 141 | * @return HtmlSemDoubleElement |
| 142 | 142 | */ |
| 143 | - public function asLink($href = NULL, $target = NULL) { |
|
| 143 | + public function asLink($href=NULL, $target=NULL) { |
|
| 144 | 144 | if (isset($href)) |
| 145 | 145 | $this->setProperty("href", $href); |
| 146 | 146 | if (isset($target)) |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | * @param boolean $show |
| 155 | 155 | * @return string |
| 156 | 156 | */ |
| 157 | - public function jsShowDimmer($show = true) { |
|
| 158 | - $status = "hide"; |
|
| 159 | - if ($show === true) |
|
| 160 | - $status = "show"; |
|
| 161 | - return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
|
| 157 | + public function jsShowDimmer($show=true) { |
|
| 158 | + $status="hide"; |
|
| 159 | + if ($show===true) |
|
| 160 | + $status="show"; |
|
| 161 | + return '$("#.'.$this->identifier.').dimmer("'.$status.'");'; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * {@inheritdoc} |
| 167 | 167 | * @see BaseHtml::compile() |
| 168 | 168 | */ |
| 169 | - public function compile(JsUtils $js = NULL, &$view = NULL) { |
|
| 169 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
| 170 | 170 | if (isset($this->_popup)) { |
| 171 | 171 | $this->_popup->compile($js); |
| 172 | 172 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * @see HtmlDoubleElement::run() |
| 180 | 180 | */ |
| 181 | 181 | public function run(JsUtils $js) { |
| 182 | - $this->_bsComponent = $js->semantic()->generic("#" . $this->identifier); |
|
| 182 | + $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); |
|
| 183 | 183 | parent::run($js); |
| 184 | 184 | $this->addEventsOnRun($js); |
| 185 | 185 | if (isset($this->_popup)) { |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | * @param boolean $ordered |
| 198 | 198 | * @return \Ajax\common\html\html5\HtmlList |
| 199 | 199 | */ |
| 200 | - public function addList($items, $ordered = false) { |
|
| 201 | - $list = new HtmlList("list-" . $this->identifier, $items); |
|
| 200 | + public function addList($items, $ordered=false) { |
|
| 201 | + $list=new HtmlList("list-".$this->identifier, $items); |
|
| 202 | 202 | $list->setOrdered($ordered); |
| 203 | 203 | $list->setClass("ui list"); |
| 204 | 204 | $this->addContent($list); |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | * @param ?array $params |
| 211 | 211 | * @return \Ajax\semantic\components\Toast |
| 212 | 212 | */ |
| 213 | - public function asToast($params = NULL) { |
|
| 214 | - $this->_toast = new Toast(); |
|
| 215 | - $this->_toast->attach('#' . $this->_identifier); |
|
| 213 | + public function asToast($params=NULL) { |
|
| 214 | + $this->_toast=new Toast(); |
|
| 215 | + $this->_toast->attach('#'.$this->_identifier); |
|
| 216 | 216 | $this->setProperty('style', 'display:none;'); |
| 217 | 217 | if (isset($params)) { |
| 218 | 218 | $this->_toast->setParams($params); |
@@ -226,8 +226,8 @@ discard block |
||
| 226 | 226 | * @param string $classes |
| 227 | 227 | * @return \Ajax\semantic\components\Sidebar |
| 228 | 228 | */ |
| 229 | - public function asSideBar($classes = '') { |
|
| 230 | - $this->_sidebar = new Sidebar(); |
|
| 229 | + public function asSideBar($classes='') { |
|
| 230 | + $this->_sidebar=new Sidebar(); |
|
| 231 | 231 | $this->addToProperty('class', 'sidebar'); |
| 232 | 232 | return $this->_sidebar; |
| 233 | 233 | } |
@@ -49,8 +49,9 @@ discard block |
||
| 49 | 49 | * @param string $popupEvent |
| 50 | 50 | */ |
| 51 | 51 | public function setPopupAttributes($variation = NULL, $popupEvent = NULL) { |
| 52 | - if (isset($this->_popup)) |
|
| 53 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
| 52 | + if (isset($this->_popup)) { |
|
| 53 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
| 54 | + } |
|
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | /** |
@@ -109,8 +110,9 @@ discard block |
||
| 109 | 110 | $labelO = $label; |
| 110 | 111 | if (\is_object($label) === false) { |
| 111 | 112 | $labelO = new HtmlLabel("label-" . $this->identifier, $label); |
| 112 | - if (isset($icon)) |
|
| 113 | - $labelO->addIcon($icon); |
|
| 113 | + if (isset($icon)) { |
|
| 114 | + $labelO->addIcon($icon); |
|
| 115 | + } |
|
| 114 | 116 | } else { |
| 115 | 117 | $labelO->addToPropertyCtrl("class", "label", array( |
| 116 | 118 | "label" |
@@ -141,10 +143,12 @@ discard block |
||
| 141 | 143 | * @return HtmlSemDoubleElement |
| 142 | 144 | */ |
| 143 | 145 | public function asLink($href = NULL, $target = NULL) { |
| 144 | - if (isset($href)) |
|
| 145 | - $this->setProperty("href", $href); |
|
| 146 | - if (isset($target)) |
|
| 147 | - $this->setProperty("target", $target); |
|
| 146 | + if (isset($href)) { |
|
| 147 | + $this->setProperty("href", $href); |
|
| 148 | + } |
|
| 149 | + if (isset($target)) { |
|
| 150 | + $this->setProperty("target", $target); |
|
| 151 | + } |
|
| 148 | 152 | return $this->setTagName("a"); |
| 149 | 153 | } |
| 150 | 154 | |
@@ -156,8 +160,9 @@ discard block |
||
| 156 | 160 | */ |
| 157 | 161 | public function jsShowDimmer($show = true) { |
| 158 | 162 | $status = "hide"; |
| 159 | - if ($show === true) |
|
| 160 | - $status = "show"; |
|
| 163 | + if ($show === true) { |
|
| 164 | + $status = "show"; |
|
| 165 | + } |
|
| 161 | 166 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
| 162 | 167 | } |
| 163 | 168 | |