@@ -8,52 +8,52 @@ |
||
| 8 | 8 | class HtmlStepItem extends HtmlAbsractItem { |
| 9 | 9 | |
| 10 | 10 | public function __construct($identifier, $content) { |
| 11 | - parent::__construct($identifier,"step",$content); |
|
| 11 | + parent::__construct($identifier, "step", $content); |
|
| 12 | 12 | } |
| 13 | - protected function initContent($content){ |
|
| 14 | - if(\is_array($content)){ |
|
| 15 | - if(JArray::isAssociative($content)===false){ |
|
| 13 | + protected function initContent($content) { |
|
| 14 | + if (\is_array($content)) { |
|
| 15 | + if (JArray::isAssociative($content)===false) { |
|
| 16 | 16 | $icon=@$content[0]; |
| 17 | 17 | $title=@$content[1]; |
| 18 | 18 | $desc=@$content[2]; |
| 19 | 19 | $status=@$content[3]; |
| 20 | - }else{ |
|
| 20 | + } else { |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $title=@$content["title"]; |
| 23 | 23 | $desc=@$content["description"]; |
| 24 | 24 | $status=@$content["status"]; |
| 25 | 25 | } |
| 26 | - if(isset($icon)){ |
|
| 26 | + if (isset($icon)) { |
|
| 27 | 27 | $this->setIcon($icon); |
| 28 | 28 | } |
| 29 | - if(isset($status)){ |
|
| 29 | + if (isset($status)) { |
|
| 30 | 30 | $this->setStatus($status); |
| 31 | 31 | } |
| 32 | - if(isset($title)){ |
|
| 33 | - $this->setTitle($title,$desc); |
|
| 32 | + if (isset($title)) { |
|
| 33 | + $this->setTitle($title, $desc); |
|
| 34 | 34 | } |
| 35 | - }else{ |
|
| 35 | + } else { |
|
| 36 | 36 | $this->setContent($content); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function setActive($value=true){ |
|
| 41 | - if($value) |
|
| 40 | + public function setActive($value=true) { |
|
| 41 | + if ($value) |
|
| 42 | 42 | $this->setStatus(StepStatus::ACTIVE); |
| 43 | 43 | else |
| 44 | 44 | $this->setStatus(StepStatus::NONE); |
| 45 | 45 | return $this; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function setCompleted(){ |
|
| 48 | + public function setCompleted() { |
|
| 49 | 49 | return $this->setStatus(StepStatus::COMPLETED); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - public function setStatus($status){ |
|
| 52 | + public function setStatus($status) { |
|
| 53 | 53 | return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants()); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function removeStatus(){ |
|
| 56 | + public function removeStatus() { |
|
| 57 | 57 | $this->removePropertyValues("class", StepStatus::getConstants()); |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $title=@$content[1]; |
| 18 | 18 | $desc=@$content[2]; |
| 19 | 19 | $status=@$content[3]; |
| 20 | - }else{ |
|
| 20 | + } else{ |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $title=@$content["title"]; |
| 23 | 23 | $desc=@$content["description"]; |
@@ -32,16 +32,17 @@ discard block |
||
| 32 | 32 | if(isset($title)){ |
| 33 | 33 | $this->setTitle($title,$desc); |
| 34 | 34 | } |
| 35 | - }else{ |
|
| 35 | + } else{ |
|
| 36 | 36 | $this->setContent($content); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function setActive($value=true){ |
| 41 | - if($value) |
|
| 42 | - $this->setStatus(StepStatus::ACTIVE); |
|
| 43 | - else |
|
| 44 | - $this->setStatus(StepStatus::NONE); |
|
| 41 | + if($value) { |
|
| 42 | + $this->setStatus(StepStatus::ACTIVE); |
|
| 43 | + } else { |
|
| 44 | + $this->setStatus(StepStatus::NONE); |
|
| 45 | + } |
|
| 45 | 46 | return $this; |
| 46 | 47 | } |
| 47 | 48 | |
@@ -9,27 +9,27 @@ |
||
| 9 | 9 | class HtmlMenuItem extends HtmlSemDoubleElement { |
| 10 | 10 | use MenuItemTrait; |
| 11 | 11 | public function __construct($identifier, $content) { |
| 12 | - parent::__construct($identifier,"div","item",$content); |
|
| 12 | + parent::__construct($identifier, "div", "item", $content); |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - protected function initContent($content){ |
|
| 16 | - if(\is_array($content)){ |
|
| 17 | - if(JArray::isAssociative($content)===false){ |
|
| 15 | + protected function initContent($content) { |
|
| 16 | + if (\is_array($content)) { |
|
| 17 | + if (JArray::isAssociative($content)===false) { |
|
| 18 | 18 | $icon=@$content[0]; |
| 19 | 19 | $title=@$content[1]; |
| 20 | 20 | $desc=@$content[2]; |
| 21 | - }else{ |
|
| 21 | + } else { |
|
| 22 | 22 | $icon=@$content["icon"]; |
| 23 | 23 | $title=@$content["title"]; |
| 24 | 24 | $desc=@$content["description"]; |
| 25 | 25 | } |
| 26 | - if(isset($icon)){ |
|
| 26 | + if (isset($icon)) { |
|
| 27 | 27 | $this->addIcon($icon); |
| 28 | 28 | } |
| 29 | - if(isset($title)){ |
|
| 30 | - $this->setTitle($title,$desc); |
|
| 29 | + if (isset($title)) { |
|
| 30 | + $this->setTitle($title, $desc); |
|
| 31 | 31 | } |
| 32 | - }else{ |
|
| 32 | + } else { |
|
| 33 | 33 | $this->setContent($content); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $icon=@$content[0]; |
| 19 | 19 | $title=@$content[1]; |
| 20 | 20 | $desc=@$content[2]; |
| 21 | - }else{ |
|
| 21 | + } else{ |
|
| 22 | 22 | $icon=@$content["icon"]; |
| 23 | 23 | $title=@$content["title"]; |
| 24 | 24 | $desc=@$content["description"]; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | if(isset($title)){ |
| 30 | 30 | $this->setTitle($title,$desc); |
| 31 | 31 | } |
| 32 | - }else{ |
|
| 32 | + } else{ |
|
| 33 | 33 | $this->setContent($content); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function onCreate($jsCode){ |
| 53 | 53 | if(isset($this->_events["_create"])){ |
| 54 | 54 | $this->_events["_create"][]=$jsCode; |
| 55 | - }else{ |
|
| 55 | + } else{ |
|
| 56 | 56 | $this->_events["_create"]=[$jsCode]; |
| 57 | 57 | } |
| 58 | 58 | return $this; |
@@ -87,8 +87,9 @@ discard block |
||
| 87 | 87 | if(\is_array($create)){ |
| 88 | 88 | $create=\implode("", $create); |
| 89 | 89 | } |
| 90 | - if(isset($js) && $create!=="") |
|
| 91 | - $js->exec($create,true); |
|
| 90 | + if(isset($js) && $create!=="") { |
|
| 91 | + $js->exec($create,true); |
|
| 92 | + } |
|
| 92 | 93 | unset($this->_events["_create"]); |
| 93 | 94 | } |
| 94 | 95 | } |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | * @property SimpleExtComponent $_bsComponent |
| 12 | 12 | * @property string identifier |
| 13 | 13 | */ |
| 14 | -trait BaseHtmlEventsTrait{ |
|
| 14 | +trait BaseHtmlEventsTrait { |
|
| 15 | 15 | |
| 16 | - protected $_events=array (); |
|
| 16 | + protected $_events=array(); |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param string $event |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | * @return \Ajax\common\html\BaseHtml |
| 24 | 24 | */ |
| 25 | 25 | public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
| 26 | - if ($stopPropagation === true) { |
|
| 27 | - $jsCode=Javascript::$stopPropagation . $jsCode; |
|
| 26 | + if ($stopPropagation===true) { |
|
| 27 | + $jsCode=Javascript::$stopPropagation.$jsCode; |
|
| 28 | 28 | } |
| 29 | - if ($preventDefault === true) { |
|
| 30 | - $jsCode=Javascript::$preventDefault . $jsCode; |
|
| 29 | + if ($preventDefault===true) { |
|
| 30 | + $jsCode=Javascript::$preventDefault.$jsCode; |
|
| 31 | 31 | } |
| 32 | 32 | return $this->_addEvent($event, $jsCode); |
| 33 | 33 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | if (\is_array($this->_events[$event])) { |
| 43 | 43 | $this->_events[$event][]=$jsCode; |
| 44 | 44 | } else { |
| 45 | - $this->_events[$event]=array ($this->_events[$event],$jsCode ); |
|
| 45 | + $this->_events[$event]=array($this->_events[$event], $jsCode); |
|
| 46 | 46 | } |
| 47 | 47 | } else { |
| 48 | 48 | $this->_events[$event]=$jsCode; |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | return $this->onClick($jsCode); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function onCreate($jsCode){ |
|
| 73 | - if(isset($this->_events["_create"])){ |
|
| 72 | + public function onCreate($jsCode) { |
|
| 73 | + if (isset($this->_events["_create"])) { |
|
| 74 | 74 | $this->_events["_create"][]=$jsCode; |
| 75 | - }else{ |
|
| 75 | + } else { |
|
| 76 | 76 | $this->_events["_create"]=[$jsCode]; |
| 77 | 77 | } |
| 78 | 78 | return $this; |
@@ -81,15 +81,15 @@ discard block |
||
| 81 | 81 | public function addEventsOnRun(JsUtils $js=NULL) { |
| 82 | 82 | $this->_eventsOnCreate($js); |
| 83 | 83 | if (isset($this->_bsComponent)) { |
| 84 | - foreach ( $this->_events as $event => $jsCode ) { |
|
| 84 | + foreach ($this->_events as $event => $jsCode) { |
|
| 85 | 85 | $code=$jsCode; |
| 86 | 86 | if (\is_array($jsCode)) { |
| 87 | 87 | $code=""; |
| 88 | - foreach ( $jsCode as $jsC ) { |
|
| 88 | + foreach ($jsCode as $jsC) { |
|
| 89 | 89 | if ($jsC instanceof AjaxCall) { |
| 90 | - $code.="\n" . $jsC->compile($js); |
|
| 90 | + $code.="\n".$jsC->compile($js); |
|
| 91 | 91 | } else { |
| 92 | - $code.="\n" . $jsC; |
|
| 92 | + $code.="\n".$jsC; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } elseif ($jsCode instanceof AjaxCall) { |
@@ -97,18 +97,18 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | $this->_bsComponent->addEvent($event, $code); |
| 99 | 99 | } |
| 100 | - $this->_events=array (); |
|
| 100 | + $this->_events=array(); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - protected function _eventsOnCreate(JsUtils $js=NULL){ |
|
| 105 | - if(isset($this->_events["_create"])){ |
|
| 104 | + protected function _eventsOnCreate(JsUtils $js=NULL) { |
|
| 105 | + if (isset($this->_events["_create"])) { |
|
| 106 | 106 | $create=$this->_events["_create"]; |
| 107 | - if(\is_array($create)){ |
|
| 107 | + if (\is_array($create)) { |
|
| 108 | 108 | $create=\implode("", $create); |
| 109 | 109 | } |
| 110 | - if(isset($js) && $create!=="") |
|
| 111 | - $js->exec($create,true); |
|
| 110 | + if (isset($js) && $create!=="") |
|
| 111 | + $js->exec($create, true); |
|
| 112 | 112 | unset($this->_events["_create"]); |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @return BaseHtml |
| 123 | 123 | */ |
| 124 | 124 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
| 125 | - $params=array ("url" => $url,"responseElement" => $responseElement ); |
|
| 125 | + $params=array("url" => $url, "responseElement" => $responseElement); |
|
| 126 | 126 | $params=array_merge($params, $parameters); |
| 127 | 127 | $this->_addEvent($event, new AjaxCall($operation, $params)); |
| 128 | 128 | return $this; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | public function jsDoJquery($jqueryCall, $param="") { |
| 158 | - return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . Javascript::prep_value($param) . ");"; |
|
| 158 | + return "$('#".$this->identifier."').".$jqueryCall."(".Javascript::prep_value($param).");"; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | public function executeOnRun($jsCode) { |
@@ -175,6 +175,6 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | public function jsToggle($value) { |
| 178 | - return $this->jsDoJquery("toggle",$value); |
|
| 178 | + return $this->jsDoJquery("toggle", $value); |
|
| 179 | 179 | } |
| 180 | 180 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | trait HtmlLinkTrait { |
| 6 | 6 | |
| 7 | - abstract public function setProperty($name,$value); |
|
| 7 | + abstract public function setProperty($name, $value); |
|
| 8 | 8 | abstract public function getProperty($name); |
| 9 | 9 | |
| 10 | 10 | public function setHref($value) { |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | trait LabeledIconTrait { |
| 14 | 14 | |
| 15 | 15 | abstract public function addToProperty($name, $value, $separator=" "); |
| 16 | - abstract public function addContent($content,$before=false); |
|
| 16 | + abstract public function addContent($content, $before=false); |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Adds an icon before or after |
@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | * @param boolean $labeled |
| 23 | 23 | * @return \Ajax\semantic\html\elements\HtmlIcon |
| 24 | 24 | */ |
| 25 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
| 25 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
| 26 | 26 | $iconO=$icon; |
| 27 | - if(\is_string($icon)){ |
|
| 27 | + if (\is_string($icon)) { |
|
| 28 | 28 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
| 29 | 29 | } |
| 30 | - if($labeled!==false){ |
|
| 31 | - $direction=($before===true)?Direction::LEFT:Direction::RIGHT; |
|
| 30 | + if ($labeled!==false) { |
|
| 31 | + $direction=($before===true) ? Direction::LEFT : Direction::RIGHT; |
|
| 32 | 32 | $this->addToProperty("class", $direction." labeled icon"); |
| 33 | 33 | $this->tagName="div"; |
| 34 | 34 | } |
| 35 | - $this->addContent($iconO,$before); |
|
| 35 | + $this->addContent($iconO, $before); |
|
| 36 | 36 | return $iconO; |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | \ No newline at end of file |
@@ -14,8 +14,9 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function asAvatar($caption=NULL) { |
| 17 | - if (isset($caption)) |
|
| 18 | - $this->wrap("", $caption); |
|
| 17 | + if (isset($caption)) { |
|
| 18 | + $this->wrap("", $caption); |
|
| 19 | + } |
|
| 19 | 20 | return $this->addToProperty("class", "avatar"); |
| 20 | 21 | } |
| 21 | 22 | |
@@ -7,6 +7,9 @@ |
||
| 7 | 7 | class HtmlImg extends \Ajax\common\html\html5\HtmlImg { |
| 8 | 8 | use BaseTrait; |
| 9 | 9 | |
| 10 | + /** |
|
| 11 | + * @param string $identifier |
|
| 12 | + */ |
|
| 10 | 13 | public function __construct($identifier, $src="", $alt="") { |
| 11 | 14 | parent::__construct($identifier, $src, $alt); |
| 12 | 15 | $this->_baseClass="ui image"; |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function setContent($content) { |
| 21 | - $this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
| 21 | + $this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
| 22 | 22 | return $this; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function asIcon($icon, $title, $subHeader=NULL) { |
| 26 | - $header=new HtmlHeader("header-" . $this->identifier); |
|
| 26 | + $header=new HtmlHeader("header-".$this->identifier); |
|
| 27 | 27 | $header->asIcon($icon, $title, $subHeader); |
| 28 | - if ($this->_inverted === false) |
|
| 28 | + if ($this->_inverted===false) |
|
| 29 | 29 | $header->setInverted(); |
| 30 | 30 | return $this->setContent($header); |
| 31 | 31 | } |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function run(JsUtils $js) { |
| 44 | 44 | if ($this->_container instanceof HtmlSingleElement) |
| 45 | - $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
| 45 | + $this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params); |
|
| 46 | 46 | return parent::run($js); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function jsShow() { |
| 50 | 50 | if (isset($this->_container)) |
| 51 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 51 | + return '$("#.'.$this->_container->getIdentifier().').dimmer("show");'; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function setBlurring() { |
@@ -25,8 +25,9 @@ discard block |
||
| 25 | 25 | public function asIcon($icon, $title, $subHeader=NULL) { |
| 26 | 26 | $header=new HtmlHeader("header-" . $this->identifier); |
| 27 | 27 | $header->asIcon($icon, $title, $subHeader); |
| 28 | - if ($this->_inverted === false) |
|
| 29 | - $header->setInverted(); |
|
| 28 | + if ($this->_inverted === false) { |
|
| 29 | + $header->setInverted(); |
|
| 30 | + } |
|
| 30 | 31 | return $this->setContent($header); |
| 31 | 32 | } |
| 32 | 33 | |
@@ -41,14 +42,16 @@ discard block |
||
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | public function run(JsUtils $js) { |
| 44 | - if ($this->_container instanceof HtmlSingleElement) |
|
| 45 | - $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
| 45 | + if ($this->_container instanceof HtmlSingleElement) { |
|
| 46 | + $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
| 47 | + } |
|
| 46 | 48 | return parent::run($js); |
| 47 | 49 | } |
| 48 | 50 | |
| 49 | 51 | public function jsShow() { |
| 50 | - if (isset($this->_container)) |
|
| 51 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 52 | + if (isset($this->_container)) { |
|
| 53 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 54 | + } |
|
| 52 | 55 | } |
| 53 | 56 | |
| 54 | 57 | public function setBlurring() { |
@@ -21,10 +21,12 @@ |
||
| 21 | 21 | |
| 22 | 22 | private function createField($placeholder=NULL, $icon=NULL) { |
| 23 | 23 | $field=new HtmlInput($this->identifier); |
| 24 | - if (isset($placeholder)) |
|
| 25 | - $field->setPlaceholder($placeholder); |
|
| 26 | - if (isset($icon)) |
|
| 27 | - $field->addIcon($icon, Direction::RIGHT); |
|
| 24 | + if (isset($placeholder)) { |
|
| 25 | + $field->setPlaceholder($placeholder); |
|
| 26 | + } |
|
| 27 | + if (isset($icon)) { |
|
| 28 | + $field->addIcon($icon, Direction::RIGHT); |
|
| 29 | + } |
|
| 28 | 30 | //TODO check getField |
| 29 | 31 | $field->getDataField()->setClass("prompt"); |
| 30 | 32 | $this->content["field"]=$field; |
@@ -8,12 +8,12 @@ discard block |
||
| 8 | 8 | use Ajax\semantic\html\base\constants\Direction; |
| 9 | 9 | |
| 10 | 10 | class HtmlSearch extends HtmlSemDoubleElement { |
| 11 | - private $_elements=array (); |
|
| 12 | - private $_searchFields=array ("title" ); |
|
| 11 | + private $_elements=array(); |
|
| 12 | + private $_searchFields=array("title"); |
|
| 13 | 13 | private $_local=false; |
| 14 | 14 | |
| 15 | 15 | public function __construct($identifier, $placeholder=NULL, $icon=NULL) { |
| 16 | - parent::__construct("search-" . $identifier, "div", "ui search", array ()); |
|
| 16 | + parent::__construct("search-".$identifier, "div", "ui search", array()); |
|
| 17 | 17 | $this->_identifier=$identifier; |
| 18 | 18 | $this->createField($placeholder, $icon); |
| 19 | 19 | $this->createResult(); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | private function createResult() { |
| 36 | - $this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results"); |
|
| 36 | + $this->content["result"]=new HtmlSemDoubleElement("results-".$this->identifier, "div", "results"); |
|
| 37 | 37 | return $this->content["result"]; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function setUrl($url) { |
| 53 | - $this->_params["apiSettings"]="%{url: %quote%" . $url . "%quote%}%"; |
|
| 53 | + $this->_params["apiSettings"]="%{url: %quote%".$url."%quote%}%"; |
|
| 54 | 54 | return $this; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -73,16 +73,16 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function run(JsUtils $js) { |
| 76 | - $this->_params["onSelect"]='%function(result,response){$(%quote%#' . $this->identifier . '%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%'; |
|
| 76 | + $this->_params["onSelect"]='%function(result,response){$(%quote%#'.$this->identifier.'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%'; |
|
| 77 | 77 | $searchFields=\json_encode($this->_searchFields); |
| 78 | 78 | $searchFields=str_ireplace("\"", "%quote%", $searchFields); |
| 79 | - $this->_params["searchFields"]="%" . $searchFields . "%"; |
|
| 80 | - if ($this->_local === true) { |
|
| 79 | + $this->_params["searchFields"]="%".$searchFields."%"; |
|
| 80 | + if ($this->_local===true) { |
|
| 81 | 81 | $this->_params["source"]="%content%"; |
| 82 | - $this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";"); |
|
| 82 | + $this->addEvent("beforeExecute", "var content=".$this->resultsToJson().";"); |
|
| 83 | 83 | } |
| 84 | - if (isset($this->_bsComponent) === false) { |
|
| 85 | - $this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params); |
|
| 84 | + if (isset($this->_bsComponent)===false) { |
|
| 85 | + $this->_bsComponent=$js->semantic()->search("#".$this->identifier, $this->_params); |
|
| 86 | 86 | } |
| 87 | 87 | $this->addEventsOnRun($js); |
| 88 | 88 | return $this->_bsComponent; |
@@ -12,11 +12,13 @@ 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)) |
|
| 16 | - $this->setProperty("data-percent", $value); |
|
| 15 | + if (isset($value)) { |
|
| 16 | + $this->setProperty("data-percent", $value); |
|
| 17 | + } |
|
| 17 | 18 | $this->createBar(); |
| 18 | - if (isset($label)) |
|
| 19 | - $this->setLabel($label); |
|
| 19 | + if (isset($label)) { |
|
| 20 | + $this->setLabel($label); |
|
| 21 | + } |
|
| 20 | 22 | $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
| 21 | 23 | $this->addToProperty("class", $attributes); |
| 22 | 24 | } |
@@ -111,8 +113,9 @@ discard block |
||
| 111 | 113 | * @see BaseHtml::run() |
| 112 | 114 | */ |
| 113 | 115 | public function run(JsUtils $js) { |
| 114 | - if (isset($this->_bsComponent) === false) |
|
| 115 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
| 116 | + if (isset($this->_bsComponent) === false) { |
|
| 117 | + $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
| 118 | + } |
|
| 116 | 119 | $this->addEventsOnRun($js); |
| 117 | 120 | return $this->_bsComponent; |
| 118 | 121 | } |
@@ -17,17 +17,17 @@ discard block |
||
| 17 | 17 | $this->createBar(); |
| 18 | 18 | if (isset($label)) |
| 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 | /** |
@@ -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 | - $this->addBehavior($this->_params, "onChange", $jsCode,"%function(percent, value, total){","}%"); |
|
| 106 | + $this->addBehavior($this->_params, "onChange", $jsCode, "%function(percent, value, total){", "}%"); |
|
| 107 | 107 | return $this; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @see BaseHtml::run() |
| 113 | 113 | */ |
| 114 | 114 | public function run(JsUtils $js) { |
| 115 | - if (isset($this->_bsComponent) === false) |
|
| 116 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
| 115 | + if (isset($this->_bsComponent)===false) |
|
| 116 | + $this->_bsComponent=$js->semantic()->progress("#".$this->identifier, $this->_params); |
|
| 117 | 117 | $this->addEventsOnRun($js); |
| 118 | 118 | return $this->_bsComponent; |
| 119 | 119 | } |