Completed
Push — master ( 98392d...8b7375 )
by Jean-Christophe
04:05
created
Ajax/common/html/HtmlSingleElement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	}
14 14
 
15 15
 	public function setClass($classNames) {
16
-		if(is_array($classNames)){
16
+		if (is_array($classNames)) {
17 17
 			$classNames=implode(" ", $classNames);
18 18
 		}
19 19
 		$this->setProperty("class", $classNames);
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function fromArray($array) {
42 42
 		$array=parent::fromArray($array);
43
-		foreach ( $array as $key => $value ) {
43
+		foreach ($array as $key => $value) {
44 44
 			$this->setProperty($key, $value);
45 45
 		}
46 46
 		return $array;
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlOption.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 class HtmlOption extends HtmlDoubleElement {
11 11
 	protected $value;
12 12
 	protected $selected;
13
-	public function __construct($identifier,$caption,$value="") {
13
+	public function __construct($identifier, $caption, $value="") {
14 14
 		parent::__construct($identifier, "option");
15 15
 		$this->_template='<option id="%identifier%" value="%value%" %selected% %properties%>%content%</option>';
16 16
 		$this->content=$caption;
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		$this->selected="";
19 19
 	}
20 20
 	
21
-	public function select(){
21
+	public function select() {
22 22
 		$this->selected="selected";
23 23
 		return $this;
24 24
 	}
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		return $this->value;
28 28
 	}
29 29
 	public function setValue($value) {
30
-		$this->value = $value;
30
+		$this->value=$value;
31 31
 		return $this;
32 32
 	}
33 33
 	
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlSelect.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	private $default;
17 17
 	private $options;
18 18
 
19
-	public function __construct($identifier, $caption,$default=NULL) {
19
+	public function __construct($identifier, $caption, $default=NULL) {
20 20
 		parent::__construct($identifier, "select");
21 21
 		$this->setProperty("name", $identifier);
22 22
 		$this->setProperty("class", "form-control");
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
 		$this->options=array();
26 26
 	}
27 27
 
28
-	public function addOption($element,$value="",$selected=false){
29
-		if($element instanceof HtmlOption){
28
+	public function addOption($element, $value="", $selected=false) {
29
+		if ($element instanceof HtmlOption) {
30 30
 			$option=$element;
31
-		}else{
32
-			$option=new HtmlOption($this->identifier."-".count($this->options), $element,$value);
31
+		}else {
32
+			$option=new HtmlOption($this->identifier."-".count($this->options), $element, $value);
33 33
 		}
34
-		if($selected || $option->getValue()==$this->getProperty("value")){
34
+		if ($selected || $option->getValue()==$this->getProperty("value")) {
35 35
 			$option->select();
36 36
 		}
37 37
 		$this->options[]=$option;
38 38
 	}
39 39
 
40 40
 	public function setValue($value) {
41
-		foreach ( $this->options as $option ) {
42
-			if (strcasecmp($option->getValue(),$value)===0) {
41
+		foreach ($this->options as $option) {
42
+			if (strcasecmp($option->getValue(), $value)===0) {
43 43
 				$option->setProperty("selected", "");
44 44
 			}
45 45
 		}
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
54 54
 		$this->content=array();
55
-		if(isset($this->default)){
55
+		if (isset($this->default)) {
56 56
 			$default=new HtmlOption("", $this->default);
57 57
 			$this->content[]=$default;
58 58
 		}
59
-		foreach ($this->options as $option){
59
+		foreach ($this->options as $option) {
60 60
 			$this->content[]=$option;
61 61
 		}
62 62
 		return parent::compile($js, $view);
63 63
 	}
64 64
 
65
-	public function fromArray($array){
66
-		if(JArray::isAssociative($array)){
67
-			foreach ($array as $k=>$v){
65
+	public function fromArray($array) {
66
+		if (JArray::isAssociative($array)) {
67
+			foreach ($array as $k=>$v) {
68 68
 				$this->addOption($v, $k);
69 69
 			}
70
-		}else{
71
-			foreach ($array as $v){
70
+		}else {
71
+			foreach ($array as $v) {
72 72
 				$this->addOption($v, $v);
73 73
 			}
74 74
 		}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$this->addOption($function($object));
102 102
 	}
103 103
 
104
-	public function setSize($size){
104
+	public function setSize($size) {
105 105
 		return $this->setProperty("size", $size);
106 106
 	}
107 107
 }
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlImg.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
 class HtmlImg extends HtmlSingleElement {
9 9
 
10
-	public function __construct($identifier,$src="",$alt="") {
10
+	public function __construct($identifier, $src="", $alt="") {
11 11
 		parent::__construct($identifier, "img");
12 12
 		$this->setSrc($src);
13 13
 		$this->setAlt($alt);
Please login to merge, or discard this patch.
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 1 patch
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.
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/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/html/content/HtmlDropdownItem.php 1 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.