@@ -10,6 +10,9 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $params=array(); |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param string $identifier |
|
| 15 | + */ |
|
| 13 | 16 | public function __construct( $identifier, $tagName="div", $baseClass="ui"){ |
| 14 | 17 | parent::__construct( $identifier, "div", "ui accordion"); |
| 15 | 18 | } |
@@ -29,6 +32,9 @@ discard block |
||
| 29 | 32 | return ($value instanceof HtmlAccordionItem)===false; |
| 30 | 33 | } |
| 31 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $title |
|
| 37 | + */ |
|
| 32 | 38 | public function addPanel($title,$content){ |
| 33 | 39 | return $this->addItem([$title,$content]); |
| 34 | 40 | } |
@@ -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 | } |
@@ -6,31 +6,31 @@ discard block |
||
| 6 | 6 | use Ajax\semantic\html\content\HtmlAccordionItem; |
| 7 | 7 | use Ajax\JsUtils; |
| 8 | 8 | |
| 9 | -class HtmlAccordion extends HtmlSemCollection{ |
|
| 9 | +class HtmlAccordion extends HtmlSemCollection { |
|
| 10 | 10 | |
| 11 | 11 | protected $params=array(); |
| 12 | 12 | |
| 13 | - public function __construct( $identifier, $tagName="div", $baseClass="ui"){ |
|
| 14 | - parent::__construct( $identifier, "div", "ui accordion"); |
|
| 13 | + public function __construct($identifier, $tagName="div", $baseClass="ui") { |
|
| 14 | + parent::__construct($identifier, "div", "ui accordion"); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - protected function createItem($value){ |
|
| 18 | + protected function createItem($value) { |
|
| 19 | 19 | $count=$this->count(); |
| 20 | 20 | $title=$value; |
| 21 | 21 | $content=NULL; |
| 22 | - if(\is_array($value)){ |
|
| 23 | - $title=@$value[0];$content=@$value[1]; |
|
| 22 | + if (\is_array($value)) { |
|
| 23 | + $title=@$value[0]; $content=@$value[1]; |
|
| 24 | 24 | } |
| 25 | - return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title,$content); |
|
| 25 | + return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title, $content); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - protected function createCondition($value){ |
|
| 28 | + protected function createCondition($value) { |
|
| 29 | 29 | return ($value instanceof HtmlAccordionItem)===false; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public function addPanel($title,$content){ |
|
| 33 | - return $this->addItem([$title,$content]); |
|
| 32 | + public function addPanel($title, $content) { |
|
| 33 | + return $this->addItem([$title, $content]); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | * @param string $action a Phalcon action |
| 43 | 43 | * @param array $params |
| 44 | 44 | */ |
| 45 | - public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){ |
|
| 46 | - return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params)); |
|
| 45 | + public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) { |
|
| 46 | + return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params)); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -54,30 +54,30 @@ discard block |
||
| 54 | 54 | * @param string $viewName |
| 55 | 55 | * @param $params The parameters to pass to the view |
| 56 | 56 | */ |
| 57 | - public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) { |
|
| 58 | - return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params)); |
|
| 57 | + public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) { |
|
| 58 | + return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params)); |
|
| 59 | 59 | } |
| 60 | 60 | /* |
| 61 | 61 | * (non-PHPdoc) |
| 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 | $this->addEventsOnRun($js); |
| 68 | 68 | return $this->_bsComponent; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - public function setStyled(){ |
|
| 71 | + public function setStyled() { |
|
| 72 | 72 | return $this->addToProperty("class", "styled"); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - public function activate($index){ |
|
| 75 | + public function activate($index) { |
|
| 76 | 76 | $this->getItem($index)->setActive(true); |
| 77 | 77 | return $this; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public function setExclusive($value){ |
|
| 80 | + public function setExclusive($value) { |
|
| 81 | 81 | $this->params["exclusive"]=$value; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | \ No newline at end of file |
@@ -14,6 +14,9 @@ discard block |
||
| 14 | 14 | protected $_params=array(); |
| 15 | 15 | protected $_paramParts=array(); |
| 16 | 16 | |
| 17 | + /** |
|
| 18 | + * @param string $identifier |
|
| 19 | + */ |
|
| 17 | 20 | public function __construct($identifier, $header="", $content="", $actions=array()) { |
| 18 | 21 | parent::__construct($identifier, "div","ui modal"); |
| 19 | 22 | if(isset($header)){ |
@@ -27,6 +30,9 @@ discard block |
||
| 27 | 30 | } |
| 28 | 31 | } |
| 29 | 32 | |
| 33 | + /** |
|
| 34 | + * @param string $value |
|
| 35 | + */ |
|
| 30 | 36 | public function setHeader($value) { |
| 31 | 37 | $this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value); |
| 32 | 38 | return $this; |
@@ -103,6 +109,9 @@ discard block |
||
| 103 | 109 | return $this->addElementInPart(new HtmlSemDoubleElement($part."-" . $this->identifier, "div", $uiClass, $content), $part); |
| 104 | 110 | } |
| 105 | 111 | |
| 112 | + /** |
|
| 113 | + * @param BaseHtml $element |
|
| 114 | + */ |
|
| 106 | 115 | private function addElementInPart($element,$part) { |
| 107 | 116 | $this->content[$part]->addContent($element); |
| 108 | 117 | return $element; |
@@ -145,7 +154,6 @@ discard block |
||
| 145 | 154 | /** |
| 146 | 155 | * render the content of $controller::$action and set the response to the modal content |
| 147 | 156 | * @param JsUtils $js |
| 148 | - * @param string $title The panel title |
|
| 149 | 157 | * @param Controller $initialControllerInstance |
| 150 | 158 | * @param string $controllerName the controller name |
| 151 | 159 | * @param string $actionName the action name |
@@ -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 | } |
@@ -15,117 +15,117 @@ discard block |
||
| 15 | 15 | protected $_paramParts=array(); |
| 16 | 16 | |
| 17 | 17 | public function __construct($identifier, $header="", $content="", $actions=array()) { |
| 18 | - parent::__construct($identifier, "div","ui modal"); |
|
| 19 | - if(isset($header)){ |
|
| 18 | + parent::__construct($identifier, "div", "ui modal"); |
|
| 19 | + if (isset($header)) { |
|
| 20 | 20 | $this->setHeader($header); |
| 21 | 21 | } |
| 22 | - if(isset($content)){ |
|
| 22 | + if (isset($content)) { |
|
| 23 | 23 | $this->setContent($content); |
| 24 | 24 | } |
| 25 | - if(isset($actions)){ |
|
| 25 | + if (isset($actions)) { |
|
| 26 | 26 | $this->setActions($actions); |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function setHeader($value) { |
| 31 | - $this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value); |
|
| 31 | + $this->content["header"]=new HtmlSemDoubleElement("header-".$this->identifier, "a", "header", $value); |
|
| 32 | 32 | return $this; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function setContent($value) { |
| 36 | - $this->content["content"]=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", $value); |
|
| 36 | + $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", $value); |
|
| 37 | 37 | return $this; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function setActions($actions) { |
| 41 | - $this->content["actions"]=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "actions"); |
|
| 42 | - if(\is_array($actions)){ |
|
| 43 | - foreach ($actions as $action){ |
|
| 41 | + $this->content["actions"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "actions"); |
|
| 42 | + if (\is_array($actions)) { |
|
| 43 | + foreach ($actions as $action) { |
|
| 44 | 44 | $this->addAction($action); |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | - else{ |
|
| 47 | + else { |
|
| 48 | 48 | $this->addAction($actions); |
| 49 | 49 | } |
| 50 | 50 | return $this; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function addAction($action){ |
|
| 54 | - if(!$action instanceof BaseHtml){ |
|
| 53 | + public function addAction($action) { |
|
| 54 | + if (!$action instanceof BaseHtml) { |
|
| 55 | 55 | $class=""; |
| 56 | - if(\array_search($action, ["Okay","Yes"])!==false){ |
|
| 56 | + if (\array_search($action, ["Okay", "Yes"])!==false) { |
|
| 57 | 57 | $class="approve"; |
| 58 | 58 | } |
| 59 | - if(\array_search($action, ["Cancel","No"])!==false){ |
|
| 59 | + if (\array_search($action, ["Cancel", "No"])!==false) { |
|
| 60 | 60 | $class="cancel"; |
| 61 | 61 | } |
| 62 | - $action=new HtmlButton("action-".$this->identifier,$action); |
|
| 63 | - if($class!=="") |
|
| 62 | + $action=new HtmlButton("action-".$this->identifier, $action); |
|
| 63 | + if ($class!=="") |
|
| 64 | 64 | $action->addToProperty("class", $class); |
| 65 | 65 | } |
| 66 | 66 | return $this->addElementInPart($action, "actions"); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public function addContent($content,$before=false){ |
|
| 70 | - $this->content["content"]->addContent($content,$before); |
|
| 69 | + public function addContent($content, $before=false) { |
|
| 70 | + $this->content["content"]->addContent($content, $before); |
|
| 71 | 71 | return $this; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - public function addImageContent($image,$description=NULL){ |
|
| 74 | + public function addImageContent($image, $description=NULL) { |
|
| 75 | 75 | $content=$this->content["content"]; |
| 76 | - if(isset($description)){ |
|
| 77 | - $description=new HtmlSemDoubleElement("description-".$this->identifier,"div","description",$description); |
|
| 78 | - $content->addContent($description,true); |
|
| 76 | + if (isset($description)) { |
|
| 77 | + $description=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $description); |
|
| 78 | + $content->addContent($description, true); |
|
| 79 | 79 | } |
| 80 | - if($image!==""){ |
|
| 81 | - $img=new HtmlImage("image-".$this->identifier,$image,"","medium"); |
|
| 82 | - $content->addContent($img,true); |
|
| 83 | - $content->addToProperty("class","image"); |
|
| 80 | + if ($image!=="") { |
|
| 81 | + $img=new HtmlImage("image-".$this->identifier, $image, "", "medium"); |
|
| 82 | + $content->addContent($img, true); |
|
| 83 | + $content->addToProperty("class", "image"); |
|
| 84 | 84 | } |
| 85 | 85 | return $this; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - public function addIconContent($icon,$description=NULL){ |
|
| 88 | + public function addIconContent($icon, $description=NULL) { |
|
| 89 | 89 | $content=$this->content["content"]; |
| 90 | - if(isset($description)){ |
|
| 91 | - $description=new HtmlSemDoubleElement("description-".$this->identifier,"div","description",$description); |
|
| 92 | - $content->addContent($description,true); |
|
| 90 | + if (isset($description)) { |
|
| 91 | + $description=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $description); |
|
| 92 | + $content->addContent($description, true); |
|
| 93 | 93 | } |
| 94 | - if($icon!==""){ |
|
| 95 | - $img=new HtmlIcon("image-".$this->identifier,$icon); |
|
| 96 | - $content->addContent($img,true); |
|
| 97 | - $content->addToProperty("class","image"); |
|
| 94 | + if ($icon!=="") { |
|
| 95 | + $img=new HtmlIcon("image-".$this->identifier, $icon); |
|
| 96 | + $content->addContent($img, true); |
|
| 97 | + $content->addToProperty("class", "image"); |
|
| 98 | 98 | } |
| 99 | 99 | return $this; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - private function addContentInPart($content,$uiClass,$part) { |
|
| 103 | - return $this->addElementInPart(new HtmlSemDoubleElement($part."-" . $this->identifier, "div", $uiClass, $content), $part); |
|
| 102 | + private function addContentInPart($content, $uiClass, $part) { |
|
| 103 | + return $this->addElementInPart(new HtmlSemDoubleElement($part."-".$this->identifier, "div", $uiClass, $content), $part); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - private function addElementInPart($element,$part) { |
|
| 106 | + private function addElementInPart($element, $part) { |
|
| 107 | 107 | $this->content[$part]->addContent($element); |
| 108 | 108 | return $element; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - public function showDimmer($value){ |
|
| 112 | - $value=$value?"show":"hide"; |
|
| 111 | + public function showDimmer($value) { |
|
| 112 | + $value=$value ? "show" : "hide"; |
|
| 113 | 113 | $this->_paramParts[]=["'".$value." dimmer'"]; |
| 114 | 114 | return $this; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - public function setInverted(){ |
|
| 117 | + public function setInverted() { |
|
| 118 | 118 | $this->_params["inverted"]=true; |
| 119 | 119 | return $this; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - public function setBasic(){ |
|
| 122 | + public function setBasic() { |
|
| 123 | 123 | return $this->addToProperty("class", "basic"); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | - public function setTransition($value){ |
|
| 128 | - $this->_paramParts[]=["'setting'","'transition'","'".$value."'"]; |
|
| 127 | + public function setTransition($value) { |
|
| 128 | + $this->_paramParts[]=["'setting'", "'transition'", "'".$value."'"]; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | * @param string $viewName |
| 136 | 136 | * @param $params The parameters to pass to the view |
| 137 | 137 | */ |
| 138 | - public function renderView(JsUtils $js,$initialController,$viewName, $params=array()) { |
|
| 139 | - return $this->setContent($js->renderContent($initialController, $viewName,$params)); |
|
| 138 | + public function renderView(JsUtils $js, $initialController, $viewName, $params=array()) { |
|
| 139 | + return $this->setContent($js->renderContent($initialController, $viewName, $params)); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | * @param string $controllerName the controller name |
| 148 | 148 | * @param string $actionName the action name |
| 149 | 149 | */ |
| 150 | - public function forward(JsUtils $js,$initialControllerInstance,$controllerName,$actionName,$params=NULL){ |
|
| 151 | - return $this->setContent($js->forward($initialControllerInstance, $controllerName, $actionName,$params)); |
|
| 150 | + public function forward(JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params=NULL) { |
|
| 151 | + return $this->setContent($js->forward($initialControllerInstance, $controllerName, $actionName, $params)); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 159 | 159 | */ |
| 160 | 160 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 161 | - $this->content=JArray::sortAssociative($this->content, ["header","content","actions" ]); |
|
| 161 | + $this->content=JArray::sortAssociative($this->content, ["header", "content", "actions"]); |
|
| 162 | 162 | return parent::compile($js, $view); |
| 163 | 163 | } |
| 164 | 164 | /* |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | * @see BaseHtml::run() |
| 167 | 167 | */ |
| 168 | 168 | public function run(JsUtils $js) { |
| 169 | - if(isset($this->_bsComponent)===false) |
|
| 170 | - $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
| 169 | + if (isset($this->_bsComponent)===false) |
|
| 170 | + $this->_bsComponent=$js->semantic()->modal("#".$this->identifier, $this->_params, $this->_paramParts); |
|
| 171 | 171 | $this->addEventsOnRun($js); |
| 172 | 172 | return $this->_bsComponent; |
| 173 | 173 | } |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
| 6 | 6 | use Ajax\JsUtils; |
| 7 | 7 | use Ajax\service\JArray; |
| 8 | - |
|
| 9 | 8 | use Ajax\semantic\html\base\constants\State; |
| 10 | 9 | |
| 11 | 10 | class HtmlProgress extends HtmlSemDoubleElement { |
@@ -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 | } |
@@ -12,22 +12,22 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) { |
| 14 | 14 | parent::__construct($identifier, "div", "ui progress"); |
| 15 | - if (isset($value) === true) |
|
| 15 | + if (isset($value)===true) |
|
| 16 | 16 | $this->setProperty("data-percent", $value); |
| 17 | 17 | $this->createBar(); |
| 18 | - if (isset($label) === true) |
|
| 18 | + if (isset($label)===true) |
|
| 19 | 19 | $this->setLabel($label); |
| 20 | - $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
|
| 20 | + $this->_states=[State::SUCCESS, State::WARNING, State::ERROR, State::ACTIVE, State::DISABLED]; |
|
| 21 | 21 | $this->addToProperty("class", $attributes); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function setLabel($label) { |
| 25 | - $this->content["label"]=new HtmlSemDoubleElement("lbl-" . $this->identifier, "div", "label", $label); |
|
| 25 | + $this->content["label"]=new HtmlSemDoubleElement("lbl-".$this->identifier, "div", "label", $label); |
|
| 26 | 26 | return $this; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | private function createBar() { |
| 30 | - $bar=new HtmlSemDoubleElement("bar-" . $this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-" . $this->identifier, "div", "progress")); |
|
| 30 | + $bar=new HtmlSemDoubleElement("bar-".$this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-".$this->identifier, "div", "progress")); |
|
| 31 | 31 | $this->content["bar"]=$bar; |
| 32 | 32 | return $this; |
| 33 | 33 | } |
@@ -63,20 +63,20 @@ discard block |
||
| 63 | 63 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 64 | 64 | */ |
| 65 | 65 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 66 | - $this->content=JArray::sortAssociative($this->content, [ "bar","label" ]); |
|
| 66 | + $this->content=JArray::sortAssociative($this->content, ["bar", "label"]); |
|
| 67 | 67 | return parent::compile($js, $view); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function jsSetValue($value) { |
| 71 | - return '$("#' . $this->identifier . '").progress({value:' . $value . '});'; |
|
| 71 | + return '$("#'.$this->identifier.'").progress({value:'.$value.'});'; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function jsIncValue() { |
| 75 | - return '$("#' . $this->identifier . '").progress("increment");'; |
|
| 75 | + return '$("#'.$this->identifier.'").progress("increment");'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function jsDecValue() { |
| 79 | - return '$("#' . $this->identifier . '").progress("decrement");'; |
|
| 79 | + return '$("#'.$this->identifier.'").progress("decrement");'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @return HtmlProgress |
| 91 | 91 | */ |
| 92 | 92 | public function setTextValues($active=false, $error=false, $success=false, $warning=false, $percent="{percent}%", $ratio="{value} of {total}") { |
| 93 | - if (\is_array($active) == true) { |
|
| 93 | + if (\is_array($active)==true) { |
|
| 94 | 94 | $array=$active; |
| 95 | 95 | $active=JArray::getDefaultValue($array, "active", false); |
| 96 | 96 | $success=JArray::getDefaultValue($array, "success", $success); |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | $percent=JArray::getDefaultValue($array, "percent", $percent); |
| 99 | 99 | $ratio=JArray::getDefaultValue($array, "ratio", $ratio); |
| 100 | 100 | } |
| 101 | - $this->_params["text"]="%{active : " . \var_export($active, true) . ",error: " . \var_export($error, true) . ",success : " . \var_export($success, true) . ",warning : " . \var_export($warning, true) . ",percent : " . \var_export($percent, true) . ",ratio : " . \var_export($ratio, true) . "}%"; |
|
| 101 | + $this->_params["text"]="%{active : ".\var_export($active, true).",error: ".\var_export($error, true).",success : ".\var_export($success, true).",warning : ".\var_export($warning, true).",percent : ".\var_export($percent, true).",ratio : ".\var_export($ratio, true)."}%"; |
|
| 102 | 102 | return $this; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | public function onChange($jsCode) { |
| 106 | - return $this->_params["onChange"]="%function(percent, value, total){" . $jsCode . "}%"; |
|
| 106 | + return $this->_params["onChange"]="%function(percent, value, total){".$jsCode."}%"; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /* |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | * @see BaseHtml::run() |
| 112 | 112 | */ |
| 113 | 113 | public function run(JsUtils $js) { |
| 114 | - if (isset($this->_bsComponent) === false) |
|
| 115 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
| 114 | + if (isset($this->_bsComponent)===false) |
|
| 115 | + $this->_bsComponent=$js->semantic()->progress("#".$this->identifier, $this->_params); |
|
| 116 | 116 | $this->addEventsOnRun($js); |
| 117 | 117 | return $this->_bsComponent; |
| 118 | 118 | } |
@@ -30,8 +30,6 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * |
| 32 | 32 | * @param string $identifier |
| 33 | - * @param int $rowCount |
|
| 34 | - * @param int $colCount |
|
| 35 | 33 | * @return HtmlRating |
| 36 | 34 | */ |
| 37 | 35 | public function htmlRating($identifier, $value, $max, $icon="") { |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | * @return HtmlModal |
| 80 | 80 | */ |
| 81 | 81 | public function htmlModal($identifier, $header="", $content="", $actions=array()) { |
| 82 | - return $this->addHtmlComponent(new HtmlModal($identifier, $header,$content,$actions)); |
|
| 82 | + return $this->addHtmlComponent(new HtmlModal($identifier, $header, $content, $actions)); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * @param string $value default : swing |
| 31 | 31 | */ |
| 32 | 32 | public function setEasing($value) { |
| 33 | - $this->setParamCtrl("easing", $value, array ( |
|
| 33 | + $this->setParamCtrl("easing", $value, array( |
|
| 34 | 34 | "linear", |
| 35 | 35 | "swing", |
| 36 | 36 | "easeInQuad", |
@@ -74,8 +74,9 @@ |
||
| 74 | 74 | protected function setParamCtrl($key, $value, $typeCtrl) { |
| 75 | 75 | if (!$typeCtrl($value)) { |
| 76 | 76 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." à la position"); |
| 77 | - } else |
|
| 78 | - $this->setParam($key, $value); |
|
| 77 | + } else { |
|
| 78 | + $this->setParam($key, $value); |
|
| 79 | + } |
|
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | /* |
@@ -16,7 +16,7 @@ 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 | 22 | $this->uiName="accordion"; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @return $this |
| 113 | 113 | */ |
| 114 | 114 | public function setHeightStyle($value) { |
| 115 | - return $this->setParamCtrl("heightStyle", $value, array ( |
|
| 115 | + return $this->setParamCtrl("heightStyle", $value, array( |
|
| 116 | 116 | "auto", |
| 117 | 117 | "fill", |
| 118 | 118 | "content" |
@@ -49,9 +49,9 @@ |
||
| 49 | 49 | * @return $this |
| 50 | 50 | */ |
| 51 | 51 | public function setAnimate($value) { |
| 52 | - if ($value instanceof Animation) |
|
| 53 | - $value=$value->getParams(); |
|
| 54 | - else if (is_string($value)) { |
|
| 52 | + if ($value instanceof Animation) { |
|
| 53 | + $value=$value->getParams(); |
|
| 54 | + } else if (is_string($value)) { |
|
| 55 | 55 | $animation=new Animation(); |
| 56 | 56 | $animation->setEasing($value); |
| 57 | 57 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | * @return $this |
| 53 | 53 | */ |
| 54 | 54 | public function setSource($source) { |
| 55 | - $source=str_ireplace(array ( |
|
| 55 | + $source=str_ireplace(array( |
|
| 56 | 56 | "\"", |
| 57 | 57 | "'" |
| 58 | 58 | ), "%quote%", $source); |
@@ -14,7 +14,7 @@ |
||
| 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 | 20 | $this->uiName="progressbar"; |