Completed
Push — master ( 541276...03d1b2 )
by Jean-Christophe
03:16
created
Ajax/common/components/SimpleExtComponent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 use Ajax\common\JsCode;
7 7
 
8 8
 class SimpleBsComponent extends SimpleComponent {
9
-	protected $events=array ();
10
-	protected $jsCodes=array ();
9
+	protected $events=array();
10
+	protected $jsCodes=array();
11 11
 
12 12
 	public function addEvent($event, $jsCode) {
13 13
 		$this->events [$event]=$jsCode;
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 	public function getScript() {
17 17
 		parent::getScript();
18
-		foreach ( $this->jsCodes as $jsCode ) {
19
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
18
+		foreach ($this->jsCodes as $jsCode) {
19
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
20 20
 					"identifier" => $this->attachTo 
21 21
 			));
22 22
 		}
Please login to merge, or discard this patch.
Ajax/common/components/BaseComponent.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  * @version 1.001
11 11
  */
12 12
 abstract class BaseComponent {
13
-	public $jquery_code_for_compile=array ();
14
-	protected $params=array ();
13
+	public $jquery_code_for_compile=array();
14
+	protected $params=array();
15 15
 	
16 16
 	/**
17 17
 	 *
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		if (is_array($typeCtrl)) {
60 60
 			if (array_search($value, $typeCtrl)===false)
61 61
 				throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
62
-		} else {
62
+		}else {
63 63
 			if (!$typeCtrl($value)) {
64 64
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key);
65 65
 			}
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	public function setParams($params) {
71
-		foreach ( $params as $k => $v ) {
71
+		foreach ($params as $k => $v) {
72 72
 			$method="set".ucfirst($k);
73 73
 			if (method_exists($this, $method))
74 74
 				$this->$method($v);
Please login to merge, or discard this patch.
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function getParam($key) {
41 41
 		$value=null;
42
-		if (array_key_exists($key, $this->params))
43
-			$value=$this->params [$key];
42
+		if (array_key_exists($key, $this->params)) {
43
+					$value=$this->params [$key];
44
+		}
44 45
 		return $value;
45 46
 	}
46 47
 
@@ -49,16 +50,18 @@  discard block
 block discarded – undo
49 50
 	}
50 51
 
51 52
 	public function compile(JsUtils $js=NULL) {
52
-		if ($js==NULL)
53
-			$js=$this->js;
53
+		if ($js==NULL) {
54
+					$js=$this->js;
55
+		}
54 56
 		$script=$this->getScript();
55 57
 		$js->addToCompile($script);
56 58
 	}
57 59
 
58 60
 	protected function setParamCtrl($key, $value, $typeCtrl) {
59 61
 		if (is_array($typeCtrl)) {
60
-			if (array_search($value, $typeCtrl)===false)
61
-				throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
62
+			if (array_search($value, $typeCtrl)===false) {
63
+							throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
64
+			}
62 65
 		} else {
63 66
 			if (!$typeCtrl($value)) {
64 67
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key);
@@ -70,9 +73,9 @@  discard block
 block discarded – undo
70 73
 	public function setParams($params) {
71 74
 		foreach ( $params as $k => $v ) {
72 75
 			$method="set".ucfirst($k);
73
-			if (method_exists($this, $method))
74
-				$this->$method($v);
75
-			else {
76
+			if (method_exists($this, $method)) {
77
+							$this->$method($v);
78
+			} else {
76 79
 				$this->setParam($k, $v);
77 80
 				trigger_error("`".$k."` property n'existe pas", E_USER_NOTICE);
78 81
 			}
Please login to merge, or discard this patch.
Ajax/common/components/GenericComponent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 	 * @see \Ajax\bootstrap\components\SimpleBsComponent::getScript()
10 10
 	 */
11 11
 	public function getScript() {
12
-		$this->jquery_code_for_compile=array ();
13
-		foreach ( $this->jsCodes as $jsCode ) {
14
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
12
+		$this->jquery_code_for_compile=array();
13
+		foreach ($this->jsCodes as $jsCode) {
14
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
15 15
 					"identifier" => $this->attachTo 
16 16
 			));
17 17
 		}
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 
17 17
 	public function __construct(JsUtils $js) {
18 18
 		parent::__construct($js);
19
-		$this->events=array ();
19
+		$this->events=array();
20 20
 	}
21 21
 
22 22
 	protected function compileEvents() {
23
-		foreach ( $this->events as $event => $jsCode ) {
23
+		foreach ($this->events as $event => $jsCode) {
24 24
 			$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
25 25
 		}
26 26
 	}
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		$result=implode("\n", $this->jquery_code_for_compile);
30 30
 		$result=str_ireplace("\"%", "", $result);
31 31
 		$result=str_ireplace("%\"", "", $result);
32
-		$result=str_replace(array (
32
+		$result=str_replace(array(
33 33
 				"\\n",
34 34
 				"\\r",
35 35
 				"\\t" 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function getScript() {
41 41
 		$allParams=$this->params;
42
-		$this->jquery_code_for_compile=array ();
42
+		$this->jquery_code_for_compile=array();
43 43
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
44 44
 		$this->compileEvents();
45 45
 		return $this->compileJQueryCode();
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		if (is_array($typeCtrl)) {
67 67
 			if (array_search($value, $typeCtrl)===false)
68 68
 				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
69
-		} else {
69
+		}else {
70 70
 			if (!$typeCtrl($value)) {
71 71
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
72 72
 			}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@
 block discarded – undo
64 64
 
65 65
 	protected function setParamCtrl($key, $value, $typeCtrl) {
66 66
 		if (is_array($typeCtrl)) {
67
-			if (array_search($value, $typeCtrl)===false)
68
-				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
67
+			if (array_search($value, $typeCtrl)===false) {
68
+							throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
69
+			}
69 70
 		} else {
70 71
 			if (!$typeCtrl($value)) {
71 72
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIconGroups.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@
 block discarded – undo
11 11
  */
12 12
 class HtmlIconGroups extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier,$size="") {
14
+	public function __construct($identifier, $size="") {
15 15
 		parent::__construct($identifier, "i");
16 16
 		$this->setProperty("class", "icons");
17 17
 		$this->setSize($size);
18 18
 	}
19 19
 
20
-	public function add($icon,$size=""){
20
+	public function add($icon, $size="") {
21 21
 		$iconO=$icon;
22
-		if(\is_string($icon)){
22
+		if (\is_string($icon)) {
23 23
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
24 24
 			$iconO->setSize($size);
25 25
 		}
26 26
 		$this->addContent($iconO);
27 27
 	}
28 28
 
29
-	public function getIcon($index){
29
+	public function getIcon($index) {
30 30
 		return $this->content[$index];
31 31
 	}
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/InternalPopup.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 	protected $variation;
12 12
 	protected $params;
13 13
 	protected $semElement;
14
-	public function __construct($semElement,$title="",$content="",$variation=NULL,$params=array()){
14
+	public function __construct($semElement, $title="", $content="", $variation=NULL, $params=array()) {
15 15
 		$this->semElement=$semElement;
16 16
 		$this->title=$title;
17 17
 		$this->content=$content;
18
-		$this->setAttributes($variation,$params);
18
+		$this->setAttributes($variation, $params);
19 19
 	}
20 20
 
21 21
 	public function setHtml($html) {
@@ -23,32 +23,32 @@  discard block
 block discarded – undo
23 23
 		return $this;
24 24
 	}
25 25
 
26
-	public function setAttributes($variation=NULL,$params=array()){
26
+	public function setAttributes($variation=NULL, $params=array()) {
27 27
 		$this->variation=$variation;
28 28
 		$this->params=$params;
29 29
 	}
30 30
 
31
-	public function onShow($jsCode){
31
+	public function onShow($jsCode) {
32 32
 		$this->params["onShow"]=$jsCode;
33 33
 	}
34 34
 
35
-	public function compile(){
36
-		if(JString::isNotNull($this->title)){
35
+	public function compile() {
36
+		if (JString::isNotNull($this->title)) {
37 37
 			$this->semElement->addToProperty("data-title", $this->title);
38 38
 		}
39
-		if(JString::isNotNull($this->content)){
39
+		if (JString::isNotNull($this->content)) {
40 40
 			$this->semElement->addToProperty("data-content", $this->content);
41 41
 		}
42
-		if(JString::isNotNull($this->html)){
42
+		if (JString::isNotNull($this->html)) {
43 43
 			$this->semElement->addToProperty("data-html", $this->html);
44 44
 		}
45
-		if(JString::isNotNull($this->variation)){
45
+		if (JString::isNotNull($this->variation)) {
46 46
 			$this->semElement->addToProperty("data-variation", $this->variation);
47 47
 		}
48 48
 	}
49 49
 
50
-	public function run(JsUtils $js){
51
-		$js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params);
50
+	public function run(JsUtils $js) {
51
+		$js->semantic()->popup("#".$this->semElement->getIdentifier(), $this->params);
52 52
 	}
53 53
 
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/components/Dropdown.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 	 * @param string $action one of "select","auto","activate","combo","nothing","hide"
18 18
 	 * @return \Ajax\semantic\components\Dropdown
19 19
 	 */
20
-	public function setAction($action){
21
-		return $this->setParamCtrl("action", $action,array("select","auto","activate","combo","nothing","hide"));
20
+	public function setAction($action) {
21
+		return $this->setParamCtrl("action", $action, array("select", "auto", "activate", "combo", "nothing", "hide"));
22 22
 	}
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlDropdownItem.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlDropdownItem extends HtmlSemDoubleElement {
12 12
 
13
+	/**
14
+	 * @param string $identifier
15
+	 */
13 16
 	public function __construct($identifier, $content="",$value=NULL,$image=NULL) {
14 17
 		parent::__construct($identifier, "div");
15 18
 		$this->setClass("item");
@@ -60,6 +63,9 @@  discard block
 block discarded – undo
60 63
 		return $this;
61 64
 	}
62 65
 
66
+	/**
67
+	 * @param string $content
68
+	 */
63 69
 	public function setContent($content){
64 70
 		if($content==="-"){
65 71
 			$this->asDivider();
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -10,30 +10,30 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlDropdownItem extends HtmlSemDoubleElement {
12 12
 
13
-	public function __construct($identifier, $content="",$value=NULL,$image=NULL) {
13
+	public function __construct($identifier, $content="", $value=NULL, $image=NULL) {
14 14
 		parent::__construct($identifier, "div");
15 15
 		$this->setClass("item");
16 16
 		$this->setContent($content);
17
-		if($value!==NULL)
17
+		if ($value!==NULL)
18 18
 			$this->setData($value);
19
-		if($image!==NULL)
19
+		if ($image!==NULL)
20 20
 			$this->asMiniAvatar($image);
21 21
 	}
22 22
 
23
-	public function setDescription($description){
24
-		$descO=new HtmlDoubleElement("desc-".$this->identifier,"span");
23
+	public function setDescription($description) {
24
+		$descO=new HtmlDoubleElement("desc-".$this->identifier, "span");
25 25
 		$descO->setClass("description");
26 26
 		$descO->setContent($description);
27
-		return $this->addContent($descO,true);
27
+		return $this->addContent($descO, true);
28 28
 	}
29 29
 
30
-	public function setData($value){
30
+	public function setData($value) {
31 31
 		$this->setProperty("data-value", $value);
32 32
 	}
33 33
 
34
-	public function asOption(){
34
+	public function asOption() {
35 35
 		$this->tagName="option";
36
-		if($this->getProperty("data-value")!==null)
36
+		if ($this->getProperty("data-value")!==null)
37 37
 			$this->setProperty("value", $this->getProperty("data-value"));
38 38
 	}
39 39
 
@@ -41,58 +41,58 @@  discard block
 block discarded – undo
41 41
 	 * @param string $image the image src
42 42
 	 * @return \Ajax\common\html\html5\HtmlImg
43 43
 	 */
44
-	public function asMiniAvatar($image){
44
+	public function asMiniAvatar($image) {
45 45
 		$this->tagName="div";
46
-		$img=new HtmlImg("image-".$this->identifier,$image);
46
+		$img=new HtmlImg("image-".$this->identifier, $image);
47 47
 		$img->setClass("ui mini avatar image");
48
-		$this->addContent($img,true);
48
+		$this->addContent($img, true);
49 49
 		return $img;
50 50
 	}
51 51
 
52
-	public function asSearchInput($placeholder=NULL,$icon=NULL){
52
+	public function asSearchInput($placeholder=NULL, $icon=NULL) {
53 53
 		$this->setClass("ui icon search input");
54 54
 		$input=new HtmlInput("search-".$this->identifier);
55
-		if(isset($placeholder))
55
+		if (isset($placeholder))
56 56
 			$input->setProperty("placeholder", $placeholder);
57 57
 		$this->content=$input;
58
-		if(isset($icon))
58
+		if (isset($icon))
59 59
 			$this->addIcon($icon);
60 60
 		return $this;
61 61
 	}
62 62
 
63
-	public function setContent($content){
64
-		if($content==="-"){
63
+	public function setContent($content) {
64
+		if ($content==="-") {
65 65
 			$this->asDivider();
66
-		}elseif($content==="-search-"){
67
-			$values=\explode(",",$content,-1);
68
-			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search"));
66
+		}elseif ($content==="-search-") {
67
+			$values=\explode(",", $content, -1);
68
+			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."), JArray::getDefaultValue($values, 1, "search"));
69 69
 		}else
70 70
 			parent::setContent($content);
71 71
 		return $this;
72 72
 	}
73 73
 
74
-	public function asDivider(){
74
+	public function asDivider() {
75 75
 		$this->content=NULL;
76 76
 		$this->setClass("divider");
77 77
 	}
78 78
 
79
-	public function asHeader($caption=NULL,$icon=NULL){
79
+	public function asHeader($caption=NULL, $icon=NULL) {
80 80
 		$this->setClass("header");
81 81
 		$this->content=$caption;
82
-		if(isset($icon))
83
-			$this->addIcon($icon,true);
82
+		if (isset($icon))
83
+			$this->addIcon($icon, true);
84 84
 		return $this;
85 85
 	}
86 86
 
87
-	public static function searchInput($placeholder=NULL,$icon=NULL){
88
-		return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon);
87
+	public static function searchInput($placeholder=NULL, $icon=NULL) {
88
+		return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon);
89 89
 	}
90 90
 
91
-	public static function divider($placeholder=NULL,$icon=NULL){
91
+	public static function divider($placeholder=NULL, $icon=NULL) {
92 92
 		return (new HtmlDropdownItem(""))->asDivider();
93 93
 	}
94 94
 
95
-	public static function header($caption=NULL,$icon=NULL){
96
-		return (new HtmlDropdownItem(""))->asHeader($caption,$icon);
95
+	public static function header($caption=NULL, $icon=NULL) {
96
+		return (new HtmlDropdownItem(""))->asHeader($caption, $icon);
97 97
 	}
98 98
 }
99 99
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +22 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,10 +14,12 @@  discard block
 block discarded – undo
14 14
 		parent::__construct($identifier, "div");
15 15
 		$this->setClass("item");
16 16
 		$this->setContent($content);
17
-		if($value!==NULL)
18
-			$this->setData($value);
19
-		if($image!==NULL)
20
-			$this->asMiniAvatar($image);
17
+		if($value!==NULL) {
18
+					$this->setData($value);
19
+		}
20
+		if($image!==NULL) {
21
+					$this->asMiniAvatar($image);
22
+		}
21 23
 	}
22 24
 
23 25
 	public function setDescription($description){
@@ -33,8 +35,9 @@  discard block
 block discarded – undo
33 35
 
34 36
 	public function asOption(){
35 37
 		$this->tagName="option";
36
-		if($this->getProperty("data-value")!==null)
37
-			$this->setProperty("value", $this->getProperty("data-value"));
38
+		if($this->getProperty("data-value")!==null) {
39
+					$this->setProperty("value", $this->getProperty("data-value"));
40
+		}
38 41
 	}
39 42
 
40 43
 	/**
@@ -52,22 +55,25 @@  discard block
 block discarded – undo
52 55
 	public function asSearchInput($placeholder=NULL,$icon=NULL){
53 56
 		$this->setClass("ui icon search input");
54 57
 		$input=new HtmlInput("search-".$this->identifier);
55
-		if(isset($placeholder))
56
-			$input->setProperty("placeholder", $placeholder);
58
+		if(isset($placeholder)) {
59
+					$input->setProperty("placeholder", $placeholder);
60
+		}
57 61
 		$this->content=$input;
58
-		if(isset($icon))
59
-			$this->addIcon($icon);
62
+		if(isset($icon)) {
63
+					$this->addIcon($icon);
64
+		}
60 65
 		return $this;
61 66
 	}
62 67
 
63 68
 	public function setContent($content){
64 69
 		if($content==="-"){
65 70
 			$this->asDivider();
66
-		}elseif($content==="-search-"){
71
+		} elseif($content==="-search-"){
67 72
 			$values=\explode(",",$content,-1);
68 73
 			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search"));
69
-		}else
70
-			parent::setContent($content);
74
+		} else {
75
+					parent::setContent($content);
76
+		}
71 77
 		return $this;
72 78
 	}
73 79
 
@@ -79,8 +85,9 @@  discard block
 block discarded – undo
79 85
 	public function asHeader($caption=NULL,$icon=NULL){
80 86
 		$this->setClass("header");
81 87
 		$this->content=$caption;
82
-		if(isset($icon))
83
-			$this->addIcon($icon,true);
88
+		if(isset($icon)) {
89
+					$this->addIcon($icon,true);
90
+		}
84 91
 		return $this;
85 92
 	}
86 93
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 class HtmlDropdown extends HtmlSemDoubleElement {
14 14
 	protected $mClass="menu";
15 15
 	protected $mTagName="div";
16
-	protected $items=array ();
16
+	protected $items=array();
17 17
 	protected $params=array("action"=>"select");
18 18
 	protected $input;
19 19
 
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		parent::__construct($identifier, "div");
22 22
 		$this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php';
23 23
 		$this->setProperty("class", "ui dropdown");
24
-		$content=new HtmlSemDoubleElement("","div");
24
+		$content=new HtmlSemDoubleElement("", "div");
25 25
 		$content->setClass("text");
26 26
 		$content->setContent($value);
27
-		$content->wrap("",new HtmlIcon("", "dropdown"));
27
+		$content->wrap("", new HtmlIcon("", "dropdown"));
28 28
 		$this->content=array($content);
29 29
 		$this->tagName="div";
30 30
 		$this->addItems($items);
31 31
 	}
32 32
 
33
-	public function addItem($item,$value=NULL,$image=NULL){
33
+	public function addItem($item, $value=NULL, $image=NULL) {
34 34
 		$itemO=$item;
35
-		if(\is_object($item)===false){
36
-			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image);
37
-		}elseif($itemO instanceof HtmlDropdownItem){
35
+		if (\is_object($item)===false) {
36
+			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image);
37
+		}elseif ($itemO instanceof HtmlDropdownItem) {
38 38
 			$this->addToProperty("class", "vertical");
39 39
 		}
40 40
 		$this->items[]=$itemO;
41 41
 		return $itemO;
42 42
 	}
43 43
 
44
-	public function addInput($name){
45
-		if(!isset($name))
44
+	public function addInput($name) {
45
+		if (!isset($name))
46 46
 			$name="input-".$this->identifier;
47 47
 		$this->setAction("activate");
48
-		$this->input=new HtmlInput($name,"hidden");
48
+		$this->input=new HtmlInput($name, "hidden");
49 49
 	}
50 50
 
51
-	public function addItems($items){
52
-		if(JArray::isAssociative($items)){
53
-			foreach ($items as $k=>$v){
51
+	public function addItems($items) {
52
+		if (JArray::isAssociative($items)) {
53
+			foreach ($items as $k=>$v) {
54 54
 				$this->addItem($v)->setData($k);
55 55
 			}
56
-		}else{
57
-			foreach ($items as $item){
56
+		}else {
57
+			foreach ($items as $item) {
58 58
 				$this->addItem($item);
59 59
 			}
60 60
 		}
@@ -63,51 +63,51 @@  discard block
 block discarded – undo
63 63
 	/**
64 64
 	 * @param boolean $dropdown
65 65
 	 */
66
-	public function asDropdown($dropdown){
67
-		if($dropdown===false){
66
+	public function asDropdown($dropdown) {
67
+		if ($dropdown===false) {
68 68
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
69 69
 			$dropdown="menu";
70
-		}else{
70
+		}else {
71 71
 			$dropdown="dropdown";
72 72
 			$this->mClass="menu";
73 73
 		}
74
-		return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown"));
74
+		return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown"));
75 75
 	}
76 76
 
77
-	public function setVertical(){
78
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
77
+	public function setVertical() {
78
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
79 79
 	}
80 80
 
81
-	public function setSimple(){
82
-		return $this->addToPropertyCtrl("class", "simple",array("simple"));
81
+	public function setSimple() {
82
+		return $this->addToPropertyCtrl("class", "simple", array("simple"));
83 83
 	}
84 84
 
85
-	public function asButton($floating=false){
86
-		if($floating)
85
+	public function asButton($floating=false) {
86
+		if ($floating)
87 87
 			$this->addToProperty("class", "floating");
88 88
 		return $this->addToProperty("class", "button");
89 89
 	}
90 90
 
91
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
92
-		if(isset($name))
91
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
92
+		if (isset($name))
93 93
 			$this->addInput($name);
94
-		if($multiple)
94
+		if ($multiple)
95 95
 			$this->addToProperty("class", "multiple");
96 96
 		if ($selection)
97
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
97
+			$this->addToPropertyCtrl("class", "selection", array("selection"));
98 98
 		return $this;
99 99
 	}
100 100
 
101
-	public function asSearch($name=NULL,$multiple=false,$selection=false){
102
-		$this->asSelect($name,$multiple,$selection);
101
+	public function asSearch($name=NULL, $multiple=false, $selection=false) {
102
+		$this->asSelect($name, $multiple, $selection);
103 103
 		return $this->addToProperty("class", "search");
104 104
 	}
105 105
 
106
-	public function setSelect($name=NULL,$multiple=false){
107
-		if(!isset($name))
106
+	public function setSelect($name=NULL, $multiple=false) {
107
+		if (!isset($name))
108 108
 			$name="select-".$this->identifier;
109 109
 		$this->input=null;
110
-		if($multiple){
110
+		if ($multiple) {
111 111
 			$this->setProperty("multiple", true);
112 112
 			$this->addToProperty("class", "multiple");
113 113
 		}
@@ -115,31 +115,31 @@  discard block
 block discarded – undo
115 115
 		$this->tagName="select";
116 116
 		$this->setProperty("name", $name);
117 117
 		$this->content=null;
118
-		foreach ($this->items as $item){
118
+		foreach ($this->items as $item) {
119 119
 			$item->asOption();
120 120
 		}
121 121
 		return $this;
122 122
 	}
123 123
 
124
-	public function asSubmenu($pointing=false,$sens=""){
124
+	public function asSubmenu($pointing=false, $sens="") {
125 125
 		$this->setClass("ui dropdown link item");
126
-		if($pointing===true){
126
+		if ($pointing===true) {
127 127
 			$this->setPointing($sens);
128 128
 		}
129 129
 		return $this;
130 130
 	}
131 131
 
132
-	public function setPointing($sens=""){
132
+	public function setPointing($sens="") {
133 133
 		$this->addToProperty("class", "pointing");
134
-		if(JString::isNotNull($sens))
135
-			$this->addToPropertyCtrl("class", $sens, array("left","right"));
134
+		if (JString::isNotNull($sens))
135
+			$this->addToPropertyCtrl("class", $sens, array("left", "right"));
136 136
 		return $this;
137 137
 	}
138 138
 
139
-	public function setValue($value){
140
-		if(isset($this->input)){
139
+	public function setValue($value) {
140
+		if (isset($this->input)) {
141 141
 			$this->input->setProperty("value", $value);
142
-		}else{
142
+		}else {
143 143
 			$this->setProperty("value", $value);
144 144
 		}
145 145
 		return $this;
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
 	 * @see BaseHtml::run()
151 151
 	 */
152 152
 	public function run(JsUtils $js) {
153
-		if($this->propertyContains("class", "simple")===false){
154
-			$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params);
153
+		if ($this->propertyContains("class", "simple")===false) {
154
+			$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->params);
155 155
 			$this->addEventsOnRun($js);
156 156
 			return $this->_bsComponent;
157 157
 		}
158 158
 	}
159 159
 
160
-	public function setAction($action){
160
+	public function setAction($action) {
161 161
 		$this->params["action"]=$action;
162 162
 	}
163 163
 }
164 164
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +25 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		$itemO=$item;
35 35
 		if(\is_object($item)===false){
36 36
 			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image);
37
-		}elseif($itemO instanceof HtmlDropdownItem){
37
+		} elseif($itemO instanceof HtmlDropdownItem){
38 38
 			$this->addToProperty("class", "vertical");
39 39
 		}
40 40
 		$this->items[]=$itemO;
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function addInput($name){
45
-		if(!isset($name))
46
-			$name="input-".$this->identifier;
45
+		if(!isset($name)) {
46
+					$name="input-".$this->identifier;
47
+		}
47 48
 		$this->setAction("activate");
48 49
 		$this->input=new HtmlInput($name,"hidden");
49 50
 	}
@@ -53,7 +54,7 @@  discard block
 block discarded – undo
53 54
 			foreach ($items as $k=>$v){
54 55
 				$this->addItem($v)->setData($k);
55 56
 			}
56
-		}else{
57
+		} else{
57 58
 			foreach ($items as $item){
58 59
 				$this->addItem($item);
59 60
 			}
@@ -67,7 +68,7 @@  discard block
 block discarded – undo
67 68
 		if($dropdown===false){
68 69
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
69 70
 			$dropdown="menu";
70
-		}else{
71
+		} else{
71 72
 			$dropdown="dropdown";
72 73
 			$this->mClass="menu";
73 74
 		}
@@ -83,18 +84,22 @@  discard block
 block discarded – undo
83 84
 	}
84 85
 
85 86
 	public function asButton($floating=false){
86
-		if($floating)
87
-			$this->addToProperty("class", "floating");
87
+		if($floating) {
88
+					$this->addToProperty("class", "floating");
89
+		}
88 90
 		return $this->addToProperty("class", "button");
89 91
 	}
90 92
 
91 93
 	public function asSelect($name=NULL,$multiple=false,$selection=true){
92
-		if(isset($name))
93
-			$this->addInput($name);
94
-		if($multiple)
95
-			$this->addToProperty("class", "multiple");
96
-		if ($selection)
97
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
94
+		if(isset($name)) {
95
+					$this->addInput($name);
96
+		}
97
+		if($multiple) {
98
+					$this->addToProperty("class", "multiple");
99
+		}
100
+		if ($selection) {
101
+					$this->addToPropertyCtrl("class", "selection",array("selection"));
102
+		}
98 103
 		return $this;
99 104
 	}
100 105
 
@@ -104,8 +109,9 @@  discard block
 block discarded – undo
104 109
 	}
105 110
 
106 111
 	public function setSelect($name=NULL,$multiple=false){
107
-		if(!isset($name))
108
-			$name="select-".$this->identifier;
112
+		if(!isset($name)) {
113
+					$name="select-".$this->identifier;
114
+		}
109 115
 		$this->input=null;
110 116
 		if($multiple){
111 117
 			$this->setProperty("multiple", true);
@@ -131,15 +137,16 @@  discard block
 block discarded – undo
131 137
 
132 138
 	public function setPointing($sens=""){
133 139
 		$this->addToProperty("class", "pointing");
134
-		if(JString::isNotNull($sens))
135
-			$this->addToPropertyCtrl("class", $sens, array("left","right"));
140
+		if(JString::isNotNull($sens)) {
141
+					$this->addToPropertyCtrl("class", $sens, array("left","right"));
142
+		}
136 143
 		return $this;
137 144
 	}
138 145
 
139 146
 	public function setValue($value){
140 147
 		if(isset($this->input)){
141 148
 			$this->input->setProperty("value", $value);
142
-		}else{
149
+		} else{
143 150
 			$this->setProperty("value", $value);
144 151
 		}
145 152
 		return $this;
Please login to merge, or discard this patch.