Completed
Push — master ( 409900...f20dfb )
by Jean-Christophe
03:24
created
Ajax/Semantic.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @param string $identifier
53 53
 	 * @param string $icon
54 54
 	 */
55
-	public function htmlIcon($identifier,$icon){
55
+	public function htmlIcon($identifier, $icon) {
56 56
 		return $this->addHtmlComponent(new HtmlIcon($identifier, $icon));
57 57
 	}
58 58
 
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
 	 * @param string $size
62 62
 	 * @param array $icons
63 63
 	 */
64
-	public function htmlIconGroups($identifier,$size="",$icons=array()){
65
-		$group=new HtmlIconGroups($identifier,$size);
66
-		if(JArray::isAssociative($icons)){
67
-			foreach ($icons as $icon=>$size){
68
-				$group->add($icon,$size);
64
+	public function htmlIconGroups($identifier, $size="", $icons=array()) {
65
+		$group=new HtmlIconGroups($identifier, $size);
66
+		if (JArray::isAssociative($icons)) {
67
+			foreach ($icons as $icon=>$size) {
68
+				$group->add($icon, $size);
69 69
 			}
70
-		}else{
71
-			foreach ($icons as $icon){
70
+		}else {
71
+			foreach ($icons as $icon) {
72 72
 				$group->add($icon);
73 73
 			}
74 74
 		}
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 * @param array $elements
81 81
 	 * @param boolean $asIcons
82 82
 	 */
83
-	public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){
84
-		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons));
83
+	public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) {
84
+		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons));
85 85
 	}
86 86
 
87 87
 	/**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @param string $identifier
90 90
 	 * @param string $content
91 91
 	 */
92
-	public function htmlContainer($identifier,$content=""){
92
+	public function htmlContainer($identifier, $content="") {
93 93
 		return $this->addHtmlComponent(new HtmlContainer($identifier, $content));
94 94
 	}
95 95
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @param string $identifier
98 98
 	 * @param string $content
99 99
 	 */
100
-	public function htmlDivider($identifier,$content="",$tagName="div"){
101
-		return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName));
100
+	public function htmlDivider($identifier, $content="", $tagName="div") {
101
+		return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName));
102 102
 	}
103 103
 
104 104
 	/**
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 	 * @param string $content
107 107
 	 * @param string $tagName
108 108
 	 */
109
-	public function htmlLabel($identifier,$content="",$tagName="div"){
110
-		return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName));
109
+	public function htmlLabel($identifier, $content="", $tagName="div") {
110
+		return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName));
111 111
 	}
112 112
 
113 113
 	/**
114 114
 	 * @param string $identifier
115 115
 	 * @param array $items
116 116
 	 */
117
-	public function htmlMenu($identifier,$items=array()){
118
-		return $this->addHtmlComponent(new HtmlMenu($identifier,$items));
117
+	public function htmlMenu($identifier, $items=array()) {
118
+		return $this->addHtmlComponent(new HtmlMenu($identifier, $items));
119 119
 	}
120 120
 
121 121
 	/**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 * @param string $value
124 124
 	 * @param array $items
125 125
 	 */
126
-	public function htmlDropdown($identifier, $value="", $items=array()){
127
-		return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items));
126
+	public function htmlDropdown($identifier, $value="", $items=array()) {
127
+		return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items));
128 128
 	}
129 129
 }
130 130
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlInput.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class HtmlInput extends HtmlSingleElement {
8 8
 
9
-	public function __construct($identifier,$type="text") {
9
+	public function __construct($identifier, $type="text") {
10 10
 		parent::__construct($identifier, "input");
11 11
 		$this->setProperty("name", $identifier);
12 12
 		$this->setProperty("value", "");
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/SimpleComponent.php 1 patch
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.
Ajax/semantic/html/collections/HtmlMenu.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	public function __construct($identifier, $items=array()) {
12 12
 		parent::__construct($identifier, "div");
13 13
 		$this->setClass("ui menu");
14
-		foreach ($items as $item){
14
+		foreach ($items as $item) {
15 15
 			$this->addItem($item);
16 16
 		}
17 17
 	}
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 	 * @param string $type one of text,item
22 22
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
23 23
 	 */
24
-	public function setType($type=""){
25
-		return $this->addToPropertyCtrl("class", $type, array("","item","text"));
24
+	public function setType($type="") {
25
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
26 26
 	}
27 27
 
28
-	public function addItem($item){
28
+	public function addItem($item) {
29 29
 		$itemO=$item;
30
-		if(\is_string($item)){
31
-				$itemO=new HtmlLink("item-".\sizeof($this->content),"",$item);
30
+		if (\is_string($item)) {
31
+				$itemO=new HtmlLink("item-".\sizeof($this->content), "", $item);
32 32
 				$itemO->setClass("item");
33 33
 		}
34 34
 		$this->addContent($itemO);
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 			}
49 49
 	}
50 50
 
51
-	public function setActiveItem($index){
51
+	public function setActiveItem($index) {
52 52
 		$item=$this->getItem($index);
53
-		if($item!==null){
53
+		if ($item!==null) {
54 54
 			$item->addToProperty("class", "active");
55 55
 		}
56 56
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 class HtmlDropdown extends HtmlSemDoubleElement {
13 13
 	protected $mClass="menu";
14 14
 	protected $mTagName="div";
15
-	protected $items=array ();
15
+	protected $items=array();
16 16
 	protected $params=array("action"=>"select");
17 17
 	protected $input;
18 18
 
@@ -20,67 +20,67 @@  discard block
 block discarded – undo
20 20
 		parent::__construct($identifier, "div");
21 21
 		$this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php';
22 22
 		$this->setProperty("class", "ui dropdown");
23
-		$content=new HtmlSemDoubleElement("","div");
23
+		$content=new HtmlSemDoubleElement("", "div");
24 24
 		$content->setClass("text");
25 25
 		$content->setContent($value);
26
-		$content->wrap("",new HtmlIcon("", "dropdown"));
26
+		$content->wrap("", new HtmlIcon("", "dropdown"));
27 27
 		$this->content=array($content);
28 28
 		$this->tagName="div";
29 29
 		$this->addItems($items);
30 30
 	}
31 31
 
32
-	public function addItem($item,$value=NULL,$image=NULL){
32
+	public function addItem($item, $value=NULL, $image=NULL) {
33 33
 		$itemO=$item;
34
-		if(\is_object($item)===false){
35
-			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier,$item,$value,$image);
34
+		if (\is_object($item)===false) {
35
+			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier, $item, $value, $image);
36 36
 		}
37 37
 		$this->items[]=$itemO;
38 38
 		return $itemO;
39 39
 	}
40 40
 
41
-	public function addInput($name){
42
-		if(!isset($name))
41
+	public function addInput($name) {
42
+		if (!isset($name))
43 43
 			$name="input-".$this->identifier;
44 44
 		$this->setAction("activate");
45
-		$this->input=new HtmlInput($name,"hidden");
45
+		$this->input=new HtmlInput($name, "hidden");
46 46
 	}
47 47
 
48
-	public function addItems($items){
49
-		if(JArray::isAssociative($items)){
50
-			foreach ($items as $k=>$v){
48
+	public function addItems($items) {
49
+		if (JArray::isAssociative($items)) {
50
+			foreach ($items as $k=>$v) {
51 51
 				$this->addItem($v)->setData($k);
52 52
 			}
53
-		}else{
54
-			foreach ($items as $item){
53
+		}else {
54
+			foreach ($items as $item) {
55 55
 				$this->addItem($item);
56 56
 			}
57 57
 		}
58 58
 	}
59 59
 
60
-	public function asButton(){
60
+	public function asButton() {
61 61
 		return $this->addToProperty("class", "button");
62 62
 	}
63 63
 
64
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
65
-		if(isset($name))
64
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
65
+		if (isset($name))
66 66
 			$this->addInput($name);
67
-		if($multiple)
67
+		if ($multiple)
68 68
 			$this->addToProperty("class", "multiple");
69 69
 		if ($selection)
70
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
70
+			$this->addToPropertyCtrl("class", "selection", array("selection"));
71 71
 		return $this;
72 72
 	}
73 73
 
74
-	public function asSearch($name=NULL,$multiple=false,$selection=false){
75
-		$this->asSelect($name,$multiple,$selection);
74
+	public function asSearch($name=NULL, $multiple=false, $selection=false) {
75
+		$this->asSelect($name, $multiple, $selection);
76 76
 		return $this->addToProperty("class", "search");
77 77
 	}
78 78
 
79
-	public function setSelect($name=NULL,$multiple=false){
80
-		if(!isset($name))
79
+	public function setSelect($name=NULL, $multiple=false) {
80
+		if (!isset($name))
81 81
 			$name="select-".$this->identifier;
82 82
 		$this->input=null;
83
-		if($multiple){
83
+		if ($multiple) {
84 84
 			$this->setProperty("multiple", true);
85 85
 			$this->addToProperty("class", "multiple");
86 86
 		}
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
 		$this->tagName="select";
89 89
 		$this->setProperty("name", $name);
90 90
 		$this->content=null;
91
-		foreach ($this->items as $item){
91
+		foreach ($this->items as $item) {
92 92
 			$item->asOption();
93 93
 		}
94 94
 		return $this;
95 95
 	}
96 96
 
97
-	public function setValue($value){
98
-		if(isset($this->input)){
97
+	public function setValue($value) {
98
+		if (isset($this->input)) {
99 99
 			$this->input->setProperty("value", $value);
100
-		}else{
100
+		}else {
101 101
 			$this->setProperty("value", $value);
102 102
 		}
103 103
 		return $this;
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 	 * @see BaseHtml::run()
109 109
 	 */
110 110
 	public function run(JsUtils $js) {
111
-		$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params);
111
+		$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->params);
112 112
 		$this->addEventsOnRun($js);
113 113
 		return $this->_bsComponent;
114 114
 	}
115 115
 
116
-	public function setAction($action){
116
+	public function setAction($action) {
117 117
 		$this->params["action"]=$action;
118 118
 	}
119 119
 }
120 120
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 
9 9
 class HtmlLabel extends HtmlSemDoubleElement {
10 10
 
11
-	public function __construct($identifier,$caption="",$tagName="div") {
12
-		parent::__construct($identifier,$tagName);
11
+	public function __construct($identifier, $caption="", $tagName="div") {
12
+		parent::__construct($identifier, $tagName);
13 13
 		$this->setProperty("class", "ui label");
14 14
 		$this->content=$caption;
15 15
 	}
@@ -18,26 +18,26 @@  discard block
 block discarded – undo
18 18
 	 * @param string $side
19 19
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
20 20
 	 */
21
-	public function setPointing($side=""){
22
-		return $this->addToPropertyCtrl("class", $side." pointing",array("right pointing","left pointing"," pointing"));
21
+	public function setPointing($side="") {
22
+		return $this->addToPropertyCtrl("class", $side." pointing", array("right pointing", "left pointing", " pointing"));
23 23
 	}
24 24
 
25 25
 	/**
26 26
 	 * @param string $side
27 27
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
28 28
 	 */
29
-	public function toCorner($side="left"){
30
-		return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner"));
29
+	public function toCorner($side="left") {
30
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
31 31
 	}
32 32
 
33 33
 	/**
34 34
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
35 35
 	 */
36
-	public function asTag(){
36
+	public function asTag() {
37 37
 		return $this->addToProperty("class", "tag");
38 38
 	}
39 39
 
40
-	public function setBasic(){
40
+	public function setBasic() {
41 41
 		return $this->addToProperty("class", "basic");
42 42
 	}
43 43
 
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 	 * @param string $before
49 49
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
50 50
 	 */
51
-	public function addImage($src,$alt="",$before=true){
51
+	public function addImage($src, $alt="", $before=true) {
52 52
 		$this->addToProperty("class", "image");
53
-		return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before);
53
+		return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before);
54 54
 	}
55 55
 
56 56
 	/**
57 57
 	 * @param string $detail
58 58
 	 * @return \Ajax\common\html\HtmlDoubleElement
59 59
 	 */
60
-	public function addDetail($detail){
61
-		$div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName);
60
+	public function addDetail($detail) {
61
+		$div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName);
62 62
 		$div->setClass("detail");
63 63
 		$div->setContent($detail);
64 64
 		$this->addContent($div);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlContainer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
 		$this->setProperty("class", "ui container");
18 18
 	}
19 19
 
20
-	public function setAlignement($value="justified"){
21
-		if($value!=="justified")
20
+	public function setAlignement($value="justified") {
21
+		if ($value!=="justified")
22 22
 			$value.=" aligned";
23 23
 		return $this->addToProperty("class", $value);
24 24
 	}
25 25
 
26
-	public function setTextContainer(){
26
+	public function setTextContainer() {
27 27
 		return $this->addToProperty("class", "text");
28 28
 	}
29 29
 }
30 30
\ No newline at end of file
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.