@@ -25,7 +25,7 @@ |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function setDisabled($disable=true) { |
| 28 | - if($disable) |
|
| 28 | + if ($disable) |
|
| 29 | 29 | $this->addState(State::DISABLED); |
| 30 | 30 | return $this; |
| 31 | 31 | } |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function setActive($value) { |
| 32 | - if(\is_array($this->content)){ |
|
| 33 | - foreach ($this->content as $pb){ |
|
| 32 | + if (\is_array($this->content)) { |
|
| 33 | + foreach ($this->content as $pb) { |
|
| 34 | 34 | $pb->setActive($value); |
| 35 | 35 | } |
| 36 | - }else{ |
|
| 36 | + } else { |
|
| 37 | 37 | if ($value===true) |
| 38 | 38 | $this->active="active"; |
| 39 | 39 | else |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function setStriped($value) { |
| 46 | - if(\is_array($this->content)){ |
|
| 47 | - foreach ($this->content as $pb){ |
|
| 46 | + if (\is_array($this->content)) { |
|
| 47 | + foreach ($this->content as $pb) { |
|
| 48 | 48 | $pb->setStriped($value); |
| 49 | 49 | } |
| 50 | - }else{ |
|
| 50 | + } else { |
|
| 51 | 51 | if ($value===true) |
| 52 | 52 | $this->striped="progress-bar-striped"; |
| 53 | 53 | else |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function showCaption($value) { |
| 60 | - if(\is_array($this->content)){ |
|
| 61 | - foreach ($this->content as $pb){ |
|
| 60 | + if (\is_array($this->content)) { |
|
| 61 | + foreach ($this->content as $pb) { |
|
| 62 | 62 | $pb->showCaption($value); |
| 63 | 63 | } |
| 64 | - }else{ |
|
| 64 | + } else { |
|
| 65 | 65 | if ($value===true) |
| 66 | 66 | $this->caption="%value%%"; |
| 67 | 67 | else |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $progressBar->setStriped($this->striped!=="" || $progressBar->isStriped()); |
| 82 | 82 | $progressBar->setActive($this->active==="active" || $progressBar->isActive()); |
| 83 | 83 | if (!is_array($this->content)) { |
| 84 | - $this->content=array (); |
|
| 84 | + $this->content=array(); |
|
| 85 | 85 | } |
| 86 | 86 | $this->content []=$progressBar; |
| 87 | 87 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return \Ajax\bootstrap\html\HtmlProgressbar default : "" |
| 126 | 126 | */ |
| 127 | 127 | public function setStyle($cssStyle) { |
| 128 | - return $this->setMemberCtrl($this->style,CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar")); |
|
| 128 | + return $this->setMemberCtrl($this->style, CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar")); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /* |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 136 | 136 | $actualStyle=$this->style; |
| 137 | - if(isset($this->styleLimits)&& JArray::isAssociative($this->styleLimits)){ |
|
| 138 | - foreach ($this->styleLimits as $k=>$v){ |
|
| 137 | + if (isset($this->styleLimits) && JArray::isAssociative($this->styleLimits)) { |
|
| 138 | + foreach ($this->styleLimits as $k=>$v) { |
|
| 139 | 139 | $actualStyle=$k; |
| 140 | - if($v>$this->value) |
|
| 140 | + if ($v>$this->value) |
|
| 141 | 141 | break; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | * @version 1.001 |
| 17 | 17 | */ |
| 18 | 18 | class HtmlCarousel extends BaseHtml { |
| 19 | - protected $indicators=array (); |
|
| 20 | - protected $slides=array (); |
|
| 19 | + protected $indicators=array(); |
|
| 20 | + protected $slides=array(); |
|
| 21 | 21 | protected $leftControl=""; |
| 22 | 22 | protected $rightControl=""; |
| 23 | 23 | protected $_base=""; |
| 24 | - protected $_glyphs=array (); |
|
| 24 | + protected $_glyphs=array(); |
|
| 25 | 25 | |
| 26 | 26 | public function __construct($identifier, $images=NULL) { |
| 27 | 27 | parent::__construct($identifier); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function setBase($_base) { |
| 41 | - foreach ($this->slides as $slide){ |
|
| 41 | + foreach ($this->slides as $slide) { |
|
| 42 | 42 | $imgSrc=$slide->getImageSrc(); |
| 43 | 43 | $slide->setImageSrc(str_replace($this->_base.$imgSrc, $_base.$imgSrc, $imgSrc)); |
| 44 | 44 | } |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL) { |
| 96 | - if(\is_array($imageSrc)){ |
|
| 97 | - $this->addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]); |
|
| 98 | - }else{ |
|
| 96 | + if (\is_array($imageSrc)) { |
|
| 97 | + $this->addImage($imageSrc[0], @$imageSrc[1], @$imageSrc[2], @$imageSrc[3]); |
|
| 98 | + } else { |
|
| 99 | 99 | $image=new HtmlCarouselItem("item-".$this->identifier); |
| 100 | 100 | $image->setImageSrc($this->_base.$imageSrc); |
| 101 | 101 | $image->setImageAlt($imageAlt); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function fromArray($array) { |
| 120 | 120 | if (\is_array($array) && sizeof($array)>0) { |
| 121 | - foreach ( $array as $value ) { |
|
| 121 | + foreach ($array as $value) { |
|
| 122 | 122 | if (\is_array($value)) { |
| 123 | 123 | $this->addImage($value ["src"], @$value ["alt"], @$value ["caption"], @$value ["description"]); |
| 124 | 124 | } else { |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | private $elements; |
| 9 | 9 | |
| 10 | 10 | public function __construct($objects=NULL) { |
| 11 | - $this->elements=array (); |
|
| 11 | + $this->elements=array(); |
|
| 12 | 12 | if (isset($objects)) { |
| 13 | 13 | if (\is_array($objects)) { |
| 14 | 14 | $this->addResults($objects); |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | $this->elements[]=$object; |
| 24 | 24 | return $this; |
| 25 | 25 | } |
| 26 | - if (\is_array($object) === false) { |
|
| 27 | - $object=[ "title" => $object ]; |
|
| 26 | + if (\is_array($object)===false) { |
|
| 27 | + $object=["title" => $object]; |
|
| 28 | 28 | } |
| 29 | 29 | $this->elements[]=new SearchResult($object); |
| 30 | 30 | return $this; |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | if (!\is_array($objects)) { |
| 35 | 35 | return $this->addResult($objects); |
| 36 | 36 | } |
| 37 | - if (JArray::dimension($objects) === 1) { |
|
| 38 | - foreach ( $objects as $object ) { |
|
| 39 | - $this->addResult([ "title" => $object ]); |
|
| 37 | + if (JArray::dimension($objects)===1) { |
|
| 38 | + foreach ($objects as $object) { |
|
| 39 | + $this->addResult(["title" => $object]); |
|
| 40 | 40 | } |
| 41 | 41 | } else |
| 42 | 42 | $this->elements=\array_merge($this->elements, $objects); |
@@ -44,21 +44,21 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function _search($query, $field="title") { |
| 47 | - $result=array (); |
|
| 48 | - foreach ( $this->elements as $element ) { |
|
| 47 | + $result=array(); |
|
| 48 | + foreach ($this->elements as $element) { |
|
| 49 | 49 | if ($element instanceof SearchResult) { |
| 50 | - if ($element->search($query, $field) !== false) |
|
| 50 | + if ($element->search($query, $field)!==false) |
|
| 51 | 51 | $result[]=$element->asArray(); |
| 52 | 52 | } else { |
| 53 | 53 | if (\array_key_exists($field, $element)) { |
| 54 | 54 | $value=$element[$field]; |
| 55 | - if (\stripos($value, $query) !== false) { |
|
| 55 | + if (\stripos($value, $query)!==false) { |
|
| 56 | 56 | $result[]=$element; |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | - if (\sizeof($result) > 0) { |
|
| 61 | + if (\sizeof($result)>0) { |
|
| 62 | 62 | return $result; |
| 63 | 63 | } |
| 64 | 64 | return false; |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function search($query, $field="title") { |
| 68 | 68 | $result=$this->_search($query, $field); |
| 69 | - if ($result === false) |
|
| 69 | + if ($result===false) |
|
| 70 | 70 | $result=NULL; |
| 71 | 71 | return new SearchResults($result); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function __toString() { |
| 75 | - $result="\"results\": " . \json_encode($this->elements); |
|
| 75 | + $result="\"results\": ".\json_encode($this->elements); |
|
| 76 | 76 | return $result; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function getResponse() { |
| 84 | - return "{" . $this . "}"; |
|
| 84 | + return "{".$this."}"; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | protected $class="dropdown-toggle"; |
| 18 | 18 | protected $mClass="dropdown"; |
| 19 | 19 | protected $mTagName="div"; |
| 20 | - protected $items=array (); |
|
| 20 | + protected $items=array(); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | * @return HtmlDropdownItem |
| 88 | 88 | */ |
| 89 | 89 | public function addItem($caption, $href="#") { |
| 90 | - if($caption instanceof HtmlDropdownItem){ |
|
| 90 | + if ($caption instanceof HtmlDropdownItem) { |
|
| 91 | 91 | $item=$caption; |
| 92 | - }else{ |
|
| 92 | + } else { |
|
| 93 | 93 | $iid=$this->getItemsCount()+1; |
| 94 | 94 | $item=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid); |
| 95 | 95 | $item->setCaption($caption)->setHref($href); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | public function addItems($items) { |
| 110 | 110 | $iid=$this->getItemsCount()+1; |
| 111 | 111 | if (\is_array($items)) { |
| 112 | - foreach ( $items as $item ) { |
|
| 112 | + foreach ($items as $item) { |
|
| 113 | 113 | if (is_string($item)) { |
| 114 | 114 | $this->addItem($item); |
| 115 | 115 | } else if (\is_array($item)) { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | public function setItems($items) { |
| 139 | - $this->items=array (); |
|
| 139 | + $this->items=array(); |
|
| 140 | 140 | $this->addItems($items); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function run(JsUtils $js) { |
| 173 | 173 | if ($this->getProperty("role")==="nav") { |
| 174 | - foreach ( $this->items as $dropdownItem ) { |
|
| 174 | + foreach ($this->items as $dropdownItem) { |
|
| 175 | 175 | $dropdownItem->runNav($js); |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -263,9 +263,9 @@ discard block |
||
| 263 | 263 | /* (non-PHPdoc) |
| 264 | 264 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
| 265 | 265 | */ |
| 266 | - public function on($event, $jsCode, $stopPropagation = false, $preventDefault = false) { |
|
| 267 | - foreach ($this->items as $item){ |
|
| 268 | - $item->on($event, $jsCode,$stopPropagation,$preventDefault); |
|
| 266 | + public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
|
| 267 | + foreach ($this->items as $item) { |
|
| 268 | + $item->on($event, $jsCode, $stopPropagation, $preventDefault); |
|
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | use Ajax\semantic\traits\SemanticWidgetsTrait; |
| 12 | 12 | |
| 13 | 13 | class Semantic extends BaseGui { |
| 14 | - use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait, |
|
| 15 | - SemanticHtmlModulesTrait,SemanticHtmlViewsTrait,SemanticWidgetsTrait; |
|
| 14 | + use SemanticComponentsTrait, SemanticHtmlElementsTrait, SemanticHtmlCollectionsTrait, |
|
| 15 | + SemanticHtmlModulesTrait, SemanticHtmlViewsTrait, SemanticWidgetsTrait; |
|
| 16 | 16 | |
| 17 | 17 | private $language; |
| 18 | 18 | |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | - public function setLanguage($language){ |
|
| 25 | - if($language!==$this->language){ |
|
| 24 | + public function setLanguage($language) { |
|
| 25 | + if ($language!==$this->language) { |
|
| 26 | 26 | $file=\realpath(dirname(__FILE__)."/semantic/components/validation/languages/".$language.".js"); |
| 27 | - if(\file_exists($file)){ |
|
| 27 | + if (\file_exists($file)) { |
|
| 28 | 28 | $script=\file_get_contents($file); |
| 29 | - $this->js->exec($script,true); |
|
| 29 | + $this->js->exec($script, true); |
|
| 30 | 30 | $this->language=$language; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -7,20 +7,20 @@ discard block |
||
| 7 | 7 | use Ajax\semantic\html\base\constants\Sens; |
| 8 | 8 | use Ajax\JsUtils; |
| 9 | 9 | |
| 10 | -class HtmlSegmentGroups extends HtmlSemCollection{ |
|
| 10 | +class HtmlSegmentGroups extends HtmlSemCollection { |
|
| 11 | 11 | |
| 12 | 12 | |
| 13 | - public function __construct( $identifier, $items=array()){ |
|
| 14 | - parent::__construct( $identifier, "div","ui segments"); |
|
| 13 | + public function __construct($identifier, $items=array()) { |
|
| 14 | + parent::__construct($identifier, "div", "ui segments"); |
|
| 15 | 15 | $this->addItems($items); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | - protected function createItem($value){ |
|
| 20 | - return new HtmlSegment("segment-".$this->count(),$value); |
|
| 19 | + protected function createItem($value) { |
|
| 20 | + return new HtmlSegment("segment-".$this->count(), $value); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - protected function createCondition($value){ |
|
| 23 | + protected function createCondition($value) { |
|
| 24 | 24 | return !($value instanceof HtmlSegment); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -29,21 +29,21 @@ discard block |
||
| 29 | 29 | * @param string $type one of "raised","stacked","piled" default : "" |
| 30 | 30 | * @return \Ajax\semantic\html\elements\HtmlSegmentGroups |
| 31 | 31 | */ |
| 32 | - public function setType($type){ |
|
| 32 | + public function setType($type) { |
|
| 33 | 33 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function setSens($sens=Sens::VERTICAL){ |
|
| 36 | + public function setSens($sens=Sens::VERTICAL) { |
|
| 37 | 37 | return $this->addToPropertyCtrl("class", $sens, Sens::getConstants()); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function run(JsUtils $js){ |
|
| 41 | - $result= parent::run($js); |
|
| 40 | + public function run(JsUtils $js) { |
|
| 41 | + $result=parent::run($js); |
|
| 42 | 42 | return $result->setItemSelector(".ui.segment"); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){ |
|
| 46 | - $group=new HtmlSegmentGroups($identifier,$items); |
|
| 45 | + public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) { |
|
| 46 | + $group=new HtmlSegmentGroups($identifier, $items); |
|
| 47 | 47 | $group->setSens($sens); |
| 48 | 48 | return $group->setType($type); |
| 49 | 49 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * @return HtmlButtongroups default : "" |
| 40 | 40 | */ |
| 41 | 41 | public function setSize($size) { |
| 42 | - foreach ( $this->elements as $element ) { |
|
| 42 | + foreach ($this->elements as $element) { |
|
| 43 | 43 | $element->setSize($size); |
| 44 | 44 | } |
| 45 | 45 | if (is_int($size)) { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function setStyle($value) { |
| 52 | - foreach ( $this->elements as $element ) |
|
| 52 | + foreach ($this->elements as $element) |
|
| 53 | 53 | $element->setStyle($value); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -69,29 +69,29 @@ discard block |
||
| 69 | 69 | public function addElement($element) { |
| 70 | 70 | $result=$element; |
| 71 | 71 | $iid=sizeof($this->elements)+1; |
| 72 | - if (($element instanceof HtmlDropdown)||($element instanceof HtmlSplitbutton)) { |
|
| 72 | + if (($element instanceof HtmlDropdown) || ($element instanceof HtmlSplitbutton)) { |
|
| 73 | 73 | $this->addExistingDropDown($element); |
| 74 | 74 | } elseif (\is_array($element)) { |
| 75 | - $result=$this->_addArrayElement($element,$iid); |
|
| 75 | + $result=$this->_addArrayElement($element, $iid); |
|
| 76 | 76 | } elseif (is_string($element)) { |
| 77 | - $result=new HtmlButton($this->identifier."-button-".$iid,$element); |
|
| 77 | + $result=new HtmlButton($this->identifier."-button-".$iid, $element); |
|
| 78 | 78 | } |
| 79 | - if($result instanceof HtmlButton) |
|
| 79 | + if ($result instanceof HtmlButton) |
|
| 80 | 80 | $this->elements[]=$result; |
| 81 | 81 | return $result; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - private function _addArrayElement(array $element,$iid){ |
|
| 84 | + private function _addArrayElement(array $element, $iid) { |
|
| 85 | 85 | if (array_key_exists("glyph", $element)) |
| 86 | 86 | $bt=new HtmlGlyphButton($this->identifier."-button-".$iid); |
| 87 | 87 | elseif (array_key_exists("btnCaption", $element)) { |
| 88 | 88 | if (array_key_exists("split", $element)) |
| 89 | 89 | $bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid); |
| 90 | - else{ |
|
| 90 | + else { |
|
| 91 | 91 | $bt=new HtmlDropdown($this->identifier."-dropdown-".$iid); |
| 92 | 92 | $this->dropdownAsButton($bt); |
| 93 | 93 | } |
| 94 | - } else{ |
|
| 94 | + } else { |
|
| 95 | 95 | $bt=new HtmlButton($this->identifier."-button-".$iid); |
| 96 | 96 | $bt->fromArray($element); |
| 97 | 97 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function addElements($elements) { |
| 102 | - foreach ( $elements as $element ) { |
|
| 102 | + foreach ($elements as $element) { |
|
| 103 | 103 | $this->addElement($element); |
| 104 | 104 | } |
| 105 | 105 | return $this; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } else |
| 120 | 120 | $value="btn-group-".$value; |
| 121 | 121 | if (strstr($value, "justified")) { |
| 122 | - foreach ( $this->elements as $element ) { |
|
| 122 | + foreach ($this->elements as $element) { |
|
| 123 | 123 | $element->wrap('<div class="btn-group" role="group">', '</div>'); |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
| 151 | 151 | */ |
| 152 | 152 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
| 153 | - foreach ( $this->elements as $element ) { |
|
| 153 | + foreach ($this->elements as $element) { |
|
| 154 | 154 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
| 155 | 155 | } |
| 156 | 156 | return $this; |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | parent::__construct($identifier, $instance, $captions); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - public function getValue($index){ |
|
| 15 | + public function getValue($index) { |
|
| 16 | 16 | $result=parent::getValue($index); |
| 17 | - if($result instanceof HtmlFormField){ |
|
| 18 | - $lbl=new HtmlSemDoubleElement("lbl-".$this->widgetIdentifier."-".$index,"label","",$this->getCaption($index)); |
|
| 17 | + if ($result instanceof HtmlFormField) { |
|
| 18 | + $lbl=new HtmlSemDoubleElement("lbl-".$this->widgetIdentifier."-".$index, "label", "", $this->getCaption($index)); |
|
| 19 | 19 | $lbl->setProperty("for", $result->getDataField()->getIdentifier()); |
| 20 | 20 | $this->captions[$index]=$lbl; |
| 21 | 21 | } |