Completed
Push — master ( 2461e8...b569b1 )
by Jean-Christophe
04:01
created
Ajax/Semantic.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 use Ajax\semantic\html\modules\HtmlSticky;
22 22
 
23 23
 class Semantic extends BaseGui {
24
-	use SemanticComponentsTrait,SemanticHtmlElementsTrait;
24
+	use SemanticComponentsTrait, SemanticHtmlElementsTrait;
25 25
 	public function __construct($autoCompile=true) {
26 26
 		parent::__construct($autoCompile=true);
27 27
 	}
@@ -32,24 +32,24 @@  discard block
 block discarded – undo
32 32
 	 * @param array $items
33 33
 	 * @return Ajax\semantic\html\collections\HtmlMenu
34 34
 	 */
35
-	public function htmlMenu($identifier,$items=array()){
36
-		return $this->addHtmlComponent(new HtmlMenu($identifier,$items));
35
+	public function htmlMenu($identifier, $items=array()) {
36
+		return $this->addHtmlComponent(new HtmlMenu($identifier, $items));
37 37
 	}
38 38
 
39 39
 	/**Adds an icon menu
40 40
 	 * @param string $identifier
41 41
 	 * @param array $items icons
42 42
 	 */
43
-	public function htmlIconMenu($identifier,$items=array()){
44
-		return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items));
43
+	public function htmlIconMenu($identifier, $items=array()) {
44
+		return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items));
45 45
 	}
46 46
 
47 47
 	/**Adds an labeled icon menu
48 48
 	 * @param string $identifier
49 49
 	 * @param array $items icons
50 50
 	 */
51
-	public function htmlLabeledIconMenu($identifier,$items=array()){
52
-		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items));
51
+	public function htmlLabeledIconMenu($identifier, $items=array()) {
52
+		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items));
53 53
 	}
54 54
 
55 55
 	/**
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 	 * @param string $value
58 58
 	 * @param array $items
59 59
 	 */
60
-	public function htmlDropdown($identifier, $value="", $items=array()){
61
-		return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items));
60
+	public function htmlDropdown($identifier, $value="", $items=array()) {
61
+		return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items));
62 62
 	}
63 63
 
64 64
 	/**
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 	 * @param string $identifier
67 67
 	 * @param string $content
68 68
 	 */
69
-	public function htmlMessage($identifier, $content=""){
70
-		return $this->addHtmlComponent(new HtmlMessage($identifier,$content));
69
+	public function htmlMessage($identifier, $content="") {
70
+		return $this->addHtmlComponent(new HtmlMessage($identifier, $content));
71 71
 	}
72 72
 
73 73
 	/**
74 74
 	 * @param string $identifier
75 75
 	 * @param mixed $content
76 76
 	 */
77
-	public function htmlPopup(BaseHtml $container,$identifier,$content){
78
-		return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content));
77
+	public function htmlPopup(BaseHtml $container, $identifier, $content) {
78
+		return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content));
79 79
 	}
80 80
 
81 81
 	/**
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @param boolean $createCols
86 86
 	 * @param boolean $implicitRows
87 87
 	 */
88
-	public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
89
-		return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows));
88
+	public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
89
+		return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows));
90 90
 	}
91 91
 
92 92
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
100 100
 	 * @return HtmlBreadcrumb
101 101
 	 */
102
-	public function htmlBreadcrumb( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
103
-		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier,$items,$autoActive,$startIndex,$hrefFunction));
102
+	public function htmlBreadcrumb($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
103
+		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier, $items, $autoActive, $startIndex, $hrefFunction));
104 104
 	}
105 105
 
106 106
 	/**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	 * @param string $identifier
118 118
 	 * @return HtmlAccordion
119 119
 	 */
120
-	public function htmlAccordionMenu($identifier,$items=array()) {
121
-		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier,$items));
120
+	public function htmlAccordionMenu($identifier, $items=array()) {
121
+		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items));
122 122
 	}
123 123
 
124 124
 	/**
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	 * @param string $identifier
127 127
 	 * @param array $elements
128 128
 	 */
129
-	public function htmlForm($identifier,$elements=array()) {
130
-		return $this->addHtmlComponent(new HtmlForm($identifier,$elements));
129
+	public function htmlForm($identifier, $elements=array()) {
130
+		return $this->addHtmlComponent(new HtmlForm($identifier, $elements));
131 131
 	}
132 132
 
133
-	public function htmlSticky($identifier,$content=array()) {
134
-		return $this->addHtmlComponent(new HtmlSticky($identifier,$content));
133
+	public function htmlSticky($identifier, $content=array()) {
134
+		return $this->addHtmlComponent(new HtmlSticky($identifier, $content));
135 135
 	}
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormField.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -8,26 +8,26 @@  discard block
 block discarded – undo
8 8
 
9 9
 class HtmlFormField extends HtmlSemDoubleElement {
10 10
 	protected $_container;
11
-	public function __construct($identifier, $field,$label=NULL) {
12
-		parent::__construct($identifier, "div","field");
11
+	public function __construct($identifier, $field, $label=NULL) {
12
+		parent::__construct($identifier, "div", "field");
13 13
 		$this->content=array();
14
-		$this->_states=[State::ERROR,State::DISABLED];
15
-		if(isset($label))
14
+		$this->_states=[State::ERROR, State::DISABLED];
15
+		if (isset($label))
16 16
 			$this->setLabel($label);
17 17
 		$this->setField($field);
18 18
 	}
19 19
 
20
-	public function setLabel($label){
20
+	public function setLabel($label) {
21 21
 		$labelO=$label;
22
-		if(\is_string($label)){
23
-			$labelO=new HtmlSemDoubleElement("","label","");
22
+		if (\is_string($label)) {
23
+			$labelO=new HtmlSemDoubleElement("", "label", "");
24 24
 			$labelO->setContent($label);
25
-			$labelO->setProperty("for", \str_replace("field-", "",$this->identifier));
25
+			$labelO->setProperty("for", \str_replace("field-", "", $this->identifier));
26 26
 		}
27 27
 		$this->content["label"]=$labelO;
28 28
 	}
29 29
 
30
-	public function setField($field){
30
+	public function setField($field) {
31 31
 		$this->content["field"]=$field;
32 32
 	}
33 33
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 	 * Returns the label or null
36 36
 	 * @return mixed
37 37
 	 */
38
-	public function getLabel(){
39
-		if(\array_key_exists("label", $this->content))
38
+	public function getLabel() {
39
+		if (\array_key_exists("label", $this->content))
40 40
 			return $this->content["label"];
41 41
 	}
42 42
 
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 	 * Return the field
45 45
 	 * @return mixed
46 46
 	 */
47
-	public function getField(){
47
+	public function getField() {
48 48
 		return $this->content["field"];
49 49
 	}
50 50
 
51 51
 	/**
52 52
 	 * puts the label before or behind
53 53
 	 */
54
-	public function swapLabel(){
54
+	public function swapLabel() {
55 55
 		$label=$this->getLabel();
56 56
 		unset($this->content["label"]);
57 57
 		$this->content["label"]=$label;
@@ -62,27 +62,27 @@  discard block
 block discarded – undo
62 62
 	 * @param int $width
63 63
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
64 64
 	 */
65
-	public function setWidth($width){
66
-		if(\is_int($width)){
65
+	public function setWidth($width) {
66
+		if (\is_int($width)) {
67 67
 			$width=Wide::getConstants()["W".$width];
68 68
 		}
69 69
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
70
-		if(isset($this->_container)){
70
+		if (isset($this->_container)) {
71 71
 			$this->_container->setEqualWidth(false);
72 72
 		}
73
-		return $this->addToPropertyCtrl("class", "wide",array("wide"));
73
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
74 74
 	}
75 75
 
76 76
 	/**
77 77
 	 * Field displays an error state
78 78
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
79 79
 	 */
80
-	public function setError(){
80
+	public function setError() {
81 81
 		return $this->addToProperty("class", "error");
82 82
 	}
83 83
 
84
-	public function jsState($state){
85
-		return $this->jsDoJquery("addClass",$state);
84
+	public function jsState($state) {
85
+		return $this->jsDoJquery("addClass", $state);
86 86
 	}
87 87
 
88 88
 	public function setContainer($_container) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		return $this;
91 91
 	}
92 92
 
93
-	public function setReadonly(){
93
+	public function setReadonly() {
94 94
 		$this->getField()->setProperty("readonly", "");
95 95
 	}
96 96
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormRadio.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  */
11 11
 class HtmlFormRadio extends AbstractHtmlFormRadioCheckbox {
12 12
 
13
-	public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL,$type=NULL) {
14
-		parent::__construct($identifier, $name,$label,$value,$type);
13
+	public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $type=NULL) {
14
+		parent::__construct($identifier, $name, $label, $value, $type);
15 15
 		$this->_input->getField()->setProperty("type", "radio");
16 16
 		$this->_input->setClass("ui radio checkbox");
17
-		if(isset($name))
17
+		if (isset($name))
18 18
 			$this->_input->getField()->setProperty("name", $name);
19
-		if(isset($type))
19
+		if (isset($type))
20 20
 			$this->setType($type);
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormInput.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@
 block discarded – undo
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 	use TextFieldsTrait;
10 10
 
11
-	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
11
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
12
+		if (!isset($placeholder) && $type==="text")
13 13
 			$placeholder=$label;
14
-		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
14
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
15 15
 	}
16 16
 
17
-	public function setReadonly(){
17
+	public function setReadonly() {
18 18
 		$this->getField()->setProperty("readonly", "");
19 19
 	}
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlPopup.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 class HtmlPopup extends HtmlSemDoubleElement {
13 13
 	private $_params;
14 14
 	private $_container;
15
-	public function __construct(BaseHtml $container,$identifier, $content="") {
15
+	public function __construct(BaseHtml $container, $identifier, $content="") {
16 16
 		parent::__construct($identifier, "div");
17 17
 		$this->_container=$container;
18 18
 		$this->setClass("ui popup");
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 		$this->_params=array("on"=>"hover");
21 21
 	}
22 22
 
23
-	public function addList($items=array(),$header=NULL){
24
-		if(!$this->content instanceof HtmlGrid){
25
-			$this->content=new HtmlGrid("Grid-".$this->identifier,0);
23
+	public function addList($items=array(), $header=NULL) {
24
+		if (!$this->content instanceof HtmlGrid) {
25
+			$this->content=new HtmlGrid("Grid-".$this->identifier, 0);
26 26
 		}
27 27
 		$grid=$this->content;
28 28
 
29 29
 		$colCount=$grid->colCount();
30 30
 		$grid->setColsCount(++$colCount);
31 31
 
32
-		$list=new HtmlList("",$items);
32
+		$list=new HtmlList("", $items);
33 33
 		$list->asLink();
34
-		if(isset($header)){
35
-			$list->addHeader(4,$header);
34
+		if (isset($header)) {
35
+			$list->addHeader(4, $header);
36 36
 		}
37
-		$grid->getCell(0,$colCount-1)->setContent($list);
37
+		$grid->getCell(0, $colCount-1)->setContent($list);
38 38
 		$grid->setDivided()->setRelaxed(true);
39 39
 		return $list;
40 40
 	}
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * A popup can have no maximum width and continue to flow to fit its content
44 44
 	 */
45
-	public function setFlowing(){
45
+	public function setFlowing() {
46 46
 		return $this->addToProperty("class", "flowing");
47 47
 	}
48 48
 
49 49
 	/**
50 50
 	 * A popup can provide more basic formatting
51 51
 	 */
52
-	public function setBasic(){
52
+	public function setBasic() {
53 53
 		return $this->addToProperty("class", "basic");
54 54
 	}
55 55
 
@@ -57,22 +57,22 @@  discard block
 block discarded – undo
57 57
 	 * {@inheritDoc}
58 58
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
59 59
 	 */
60
-	public function run(JsUtils $js){
60
+	public function run(JsUtils $js) {
61 61
 		$this->_params["popup"]="#".$this->identifier;
62
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params);
62
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params);
63 63
 	}
64 64
 
65
-	public function setOn($event="click"){
65
+	public function setOn($event="click") {
66 66
 		$this->_params["on"]=$event;
67 67
 		return $this;
68 68
 	}
69 69
 
70
-	public function setInline($value=true){
70
+	public function setInline($value=true) {
71 71
 		$this->_params["inline"]=$value;
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function setPosition($position){
75
+	public function setPosition($position) {
76 76
 		$this->_params["position"]=$position;
77 77
 		return $this;
78 78
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridRow.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
  * @author jc
17 17
  * @version 1.001
18 18
  */
19
-class HtmlGridRow extends HtmlSemCollection{
19
+class HtmlGridRow extends HtmlSemCollection {
20 20
 	use TextAlignmentTrait;
21 21
 
22 22
 	private $_colSize;
23 23
 	private $_implicite=false;
24 24
 
25
-	public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){
26
-		parent::__construct( $identifier,"div","row");
25
+	public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) {
26
+		parent::__construct($identifier, "div", "row");
27 27
 		$this->_implicite=$implicite;
28 28
 		$width=null;
29
-		if(isset($numCols)){
30
-			$numCols=min(16,$numCols);
31
-			$numCols=max(1,$numCols);
32
-			if($colSizing)
33
-				$width=(int)(16/$numCols);
29
+		if (isset($numCols)) {
30
+			$numCols=min(16, $numCols);
31
+			$numCols=max(1, $numCols);
32
+			if ($colSizing)
33
+				$width=(int) (16 / $numCols);
34 34
 			else
35
-				$this->_colSize=16/$numCols;
36
-			for ($i=0;$i<$numCols;$i++){
35
+				$this->_colSize=16 / $numCols;
36
+			for ($i=0; $i<$numCols; $i++) {
37 37
 				$this->addItem($width);
38 38
 			}
39 39
 		}
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 * @param int $width
45 45
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
46 46
 	 */
47
-	public function setWidth($width){
48
-		if(\is_int($width)){
47
+	public function setWidth($width) {
48
+		if (\is_int($width)) {
49 49
 			$width=Wide::getConstants()["W".$width];
50 50
 		}
51 51
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
52
-		return $this->addToPropertyCtrl("class", "column",array("column"));
52
+		return $this->addToPropertyCtrl("class", "column", array("column"));
53 53
 	}
54 54
 
55 55
 	/**
@@ -57,29 +57,29 @@  discard block
 block discarded – undo
57 57
 	 * @param int $index
58 58
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
59 59
 	 */
60
-	public function getCol($index){
60
+	public function getCol($index) {
61 61
 		return $this->getItem($index);
62 62
 	}
63 63
 
64
-	public function setColsCount($colsCount,$toCreate=true){
64
+	public function setColsCount($colsCount, $toCreate=true) {
65 65
 		$this->setWidth($colsCount);
66
-		if($toCreate===true){
66
+		if ($toCreate===true) {
67 67
 			$count=$this->count();
68
-			for($i=$count;$i<$colsCount;$i++){
68
+			for ($i=$count; $i<$colsCount; $i++) {
69 69
 				$this->addItem(null);
70 70
 			}
71 71
 		}
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function addCols($colCount){
76
-		for($i=0;$i<$colCount;$i++){
75
+	public function addCols($colCount) {
76
+		for ($i=0; $i<$colCount; $i++) {
77 77
 			$this->addItem(null);
78 78
 		}
79 79
 		return $this;
80 80
 	}
81 81
 
82
-	public function addCol($width=NULL){
82
+	public function addCol($width=NULL) {
83 83
 		return $this->addItem($width);
84 84
 	}
85 85
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * stretch the row contents to take up the entire column height
88 88
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
89 89
 	 */
90
-	public function setStretched(){
90
+	public function setStretched() {
91 91
 		return $this->addToProperty("class", "stretched");
92 92
 	}
93 93
 
@@ -95,19 +95,19 @@  discard block
 block discarded – undo
95 95
 	 * @param string $color
96 96
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
97 97
 	 */
98
-	public function setColor($color){
99
-		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
98
+	public function setColor($color) {
99
+		return $this->addToPropertyCtrl("class", $color, Color::getConstants());
100 100
 	}
101 101
 
102
-	public function setValues($values,$force=false){
102
+	public function setValues($values, $force=false) {
103 103
 		$count=$this->count();
104
-		if($force===true){
105
-			for($i=$count;$i<\sizeof($values);$i++){
106
-				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null));
104
+		if ($force===true) {
105
+			for ($i=$count; $i<\sizeof($values); $i++) {
106
+				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null));
107 107
 			}
108 108
 		}
109
-		$count=\min(array($this->count(),\sizeof($values)));
110
-		for($i=0;$i<$count;$i++){
109
+		$count=\min(array($this->count(), \sizeof($values)));
110
+		for ($i=0; $i<$count; $i++) {
111 111
 			$this->content[$i]->setValue($values[$i]);
112 112
 		}
113 113
 		return $this;
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 	 * {@inheritDoc}
118 118
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
119 119
 	 */
120
-	protected function createItem($value){
121
-		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value);
120
+	protected function createItem($value) {
121
+		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value);
122 122
 		return $col;
123 123
 	}
124 124
 
125
-	public function compile(JsUtils $js=NULL,View $view=NULL){
126
-		if($this->_implicite===true){
125
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
126
+		if ($this->_implicite===true) {
127 127
 			$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
128 128
 		}
129
-		return parent::compile($js,$view);
129
+		return parent::compile($js, $view);
130 130
 	}
131 131
 }
132 132
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,86 +7,86 @@
 block discarded – undo
7 7
 use Ajax\semantic\html\collections\form\HtmlFormCheckbox;
8 8
 use Ajax\JsUtils;
9 9
 
10
-class HtmlList extends HtmlSemCollection{
10
+class HtmlList extends HtmlSemCollection {
11 11
 	protected $_hasCheckedList;
12 12
 
13
-	public function __construct( $identifier, $items=array()){
14
-		parent::__construct( $identifier, "div", "ui list");
13
+	public function __construct($identifier, $items=array()) {
14
+		parent::__construct($identifier, "div", "ui list");
15 15
 		$this->addItems($items);
16 16
 		$this->_hasCheckedList=false;
17 17
 	}
18 18
 
19 19
 
20
-	protected function createItem($value){
20
+	protected function createItem($value) {
21 21
 		$count=$this->count();
22
-		if(\is_array($value)){
22
+		if (\is_array($value)) {
23 23
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
24 24
 			$item->addIcon($value[1]);
25 25
 		}else
26
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
26
+			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
27 27
 		return $item;
28 28
 	}
29 29
 
30
-	public function addHeader($niveau,$content){
31
-		return $this->wrap(new HtmlHeader("header-".$this->identifier,$niveau,$content,"page"));
30
+	public function addHeader($niveau, $content) {
31
+		return $this->wrap(new HtmlHeader("header-".$this->identifier, $niveau, $content, "page"));
32 32
 	}
33 33
 
34
-	public function itemsAs($tagName){
34
+	public function itemsAs($tagName) {
35 35
 		return $this->contentAs($tagName);
36 36
 	}
37 37
 
38
-	public function asLink(){
38
+	public function asLink() {
39 39
 		$this->addToPropertyCtrl("class", "link", array("link"));
40 40
 		return $this->contentAs("a");
41 41
 	}
42 42
 
43
-	public function addList($items=array()){
44
-		$list=new HtmlList("",$items);
43
+	public function addList($items=array()) {
44
+		$list=new HtmlList("", $items);
45 45
 		$list->setClass("list");
46 46
 		return $this->addItem($list);
47 47
 	}
48 48
 
49
-	public function setCelled(){
49
+	public function setCelled() {
50 50
 		return $this->addToProperty("class", "celled");
51 51
 	}
52 52
 
53
-	public function run(JsUtils $js){
54
-		if($this->_hasCheckedList===true){
53
+	public function run(JsUtils $js) {
54
+		if ($this->_hasCheckedList===true) {
55 55
 			$jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php';
56
-			$jsCode=\str_replace("%identifier%","#".$this->identifier,$jsCode);
56
+			$jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode);
57 57
 			$this->executeOnRun($jsCode);
58 58
 		}
59 59
 		return parent::run($js);
60 60
 	}
61 61
 
62
-	public function setRelaxed(){
62
+	public function setRelaxed() {
63 63
 		return $this->addToProperty("class", "relaxed");
64 64
 	}
65 65
 
66
-	public function addCheckedList($items=array(),$masterItem=NULL,$values=array()){
66
+	public function addCheckedList($items=array(), $masterItem=NULL, $values=array()) {
67 67
 		$count=$this->count();
68 68
 		$identifier=$this->identifier."-".$count;
69
-		if(isset($masterItem)){
70
-			$masterO=new HtmlFormCheckbox("master-".$identifier,$masterItem);
71
-			$masterO->getField()->addToProperty("class","master");
69
+		if (isset($masterItem)) {
70
+			$masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem);
71
+			$masterO->getField()->addToProperty("class", "master");
72 72
 			$masterO->setClass("item");
73 73
 			$this->addItem($masterO);
74 74
 		}
75 75
 		$fields=array();
76 76
 		$i=0;
77
-		foreach ($items as $val=>$caption){
78
-			$itemO=new HtmlFormCheckbox($identifier."-".$i++,$caption,$val,"child");
79
-			if(\array_search($val, $values)!==false){
77
+		foreach ($items as $val=>$caption) {
78
+			$itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child");
79
+			if (\array_search($val, $values)!==false) {
80 80
 				$itemO->getInput()->getField()->setProperty("checked", "");
81 81
 			}
82 82
 			$itemO->setClass("item");
83 83
 			$fields[]=$itemO;
84 84
 		}
85
-		if(isset($masterO)===true){
86
-			$list=new HtmlList("",$fields);
85
+		if (isset($masterO)===true) {
86
+			$list=new HtmlList("", $fields);
87 87
 			$list->setClass("list");
88 88
 			$masterO->addContent($list);
89
-		}else{
89
+		}else {
90 90
 			$this->addList($fields);
91 91
 		}
92 92
 		$this->_hasCheckedList=true;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -15,26 +15,26 @@  discard block
 block discarded – undo
15 15
 	protected $_equalWidth;
16 16
 	protected $_name;
17 17
 
18
-	public function __construct($identifier, $fields=array(),$equalWidth=true) {
18
+	public function __construct($identifier, $fields=array(), $equalWidth=true) {
19 19
 		parent::__construct($identifier, "div");
20 20
 		$this->_equalWidth=$equalWidth;
21 21
 		$this->addItems($fields);
22 22
 	}
23 23
 
24
-	public function addFields($fields=NULL,$label=NULL){
25
-		if(!$fields instanceof HtmlFormFields){
26
-			if(\is_array($fields)===false){
27
-				$fields = \func_get_args();
24
+	public function addFields($fields=NULL, $label=NULL) {
25
+		if (!$fields instanceof HtmlFormFields) {
26
+			if (\is_array($fields)===false) {
27
+				$fields=\func_get_args();
28 28
 				$end=\end($fields);
29
-				if(\is_string($end)){
29
+				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32 32
 				}else $label=NULL;
33 33
 			}
34 34
 		}
35
-		if(isset($label))
35
+		if (isset($label))
36 36
 			$this->setLabel($label);
37
-		foreach ($fields as $field){
37
+		foreach ($fields as $field) {
38 38
 			$this->addItem($field);
39 39
 		}
40 40
 		return $this;
@@ -44,40 +44,40 @@  discard block
 block discarded – undo
44 44
 	 * @param string|HtmlSemDoubleElement $label
45 45
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
46 46
 	 */
47
-	public function setLabel($label){
47
+	public function setLabel($label) {
48 48
 		$labelO=$label;
49
-		if(\is_string($label)){
50
-			$labelO=new HtmlSemDoubleElement("","label","",$label);
49
+		if (\is_string($label)) {
50
+			$labelO=new HtmlSemDoubleElement("", "label", "", $label);
51 51
 		}
52
-		$this->insertItem($labelO,0);
52
+		$this->insertItem($labelO, 0);
53 53
 		return $labelO;
54 54
 	}
55
-	public function addItem($item){
55
+	public function addItem($item) {
56 56
 		$item=parent::addItem($item);
57 57
 		$item->setContainer($this);
58 58
 		return $item;
59 59
 	}
60
-	public function compile(JsUtils $js=NULL,View $view=NULL){
61
-		if($this->_equalWidth){
60
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
61
+		if ($this->_equalWidth) {
62 62
 			$count=$this->count();
63 63
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
64 64
 		}else
65
-			$this->addToProperty("class","fields");
66
-		return parent::compile($js,$view);
65
+			$this->addToProperty("class", "fields");
66
+		return parent::compile($js, $view);
67 67
 	}
68 68
 
69
-	public function setWidth($index,$width){
69
+	public function setWidth($index, $width) {
70 70
 		$this->_equalWidth=false;
71 71
 		return $this->getItem($index)->setWidth($width);
72 72
 	}
73 73
 
74
-	public function setInline(){
74
+	public function setInline() {
75 75
 		$this->_equalWidth=false;
76 76
 		$this->addToProperty("class", "inline");
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setGrouped(){
80
+	public function setGrouped() {
81 81
 		$this->_equalWidth=false;
82 82
 		$this->addToProperty("class", "grouped");
83 83
 	}
@@ -91,34 +91,34 @@  discard block
 block discarded – undo
91 91
 		return $this;
92 92
 	}
93 93
 
94
-	public static function radios($name,$items=array(),$label=NULL,$value=null,$type=NULL){
94
+	public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) {
95 95
 		$fields=array();
96 96
 		$i=0;
97
-		foreach ($items as $val=>$caption){
98
-			$itemO=new HtmlFormRadio($name."-".$i++,$name,$caption,$val,$type);
99
-			if($val===$value){
97
+		foreach ($items as $val=>$caption) {
98
+			$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
99
+			if ($val===$value) {
100 100
 				$itemO->getInput()->getField()->setProperty("checked", "");
101 101
 			}
102 102
 			$fields[]=$itemO;
103 103
 		}
104
-		$radios=new HtmlFormFields("fields-".$name,$fields);
105
-		if(isset($label))
104
+		$radios=new HtmlFormFields("fields-".$name, $fields);
105
+		if (isset($label))
106 106
 			$radios->setLabel($label)->setProperty("for", $name);
107 107
 		return $radios;
108 108
 	}
109 109
 
110
-	public static function checkeds($name,$items=array(),$label=NULL,$values=array(),$type=NULL){
110
+	public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
111 111
 		$fields=array();
112 112
 		$i=0;
113
-		foreach ($items as $val=>$caption){
114
-			$itemO=new HtmlFormCheckbox($name."-".$i++,$name,$caption,$val,$type);
115
-			if(\array_search($val, $values)!==false){
113
+		foreach ($items as $val=>$caption) {
114
+			$itemO=new HtmlFormCheckbox($name."-".$i++, $name, $caption, $val, $type);
115
+			if (\array_search($val, $values)!==false) {
116 116
 				$itemO->getInput()->getField()->setProperty("checked", "");
117 117
 			}
118 118
 			$fields[]=$itemO;
119 119
 		}
120
-		$radios=new HtmlFormFields("fields-".$name,$fields);
121
-		if(isset($label))
120
+		$radios=new HtmlFormFields("fields-".$name, $fields);
121
+		if (isset($label))
122 122
 			$radios->setLabel($label)->setProperty("for", $name);
123 123
 			return $radios;
124 124
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -17,31 +17,31 @@  discard block
 block discarded – undo
17 17
 	}
18 18
 	protected $mClass="menu";
19 19
 	protected $mTagName="div";
20
-	protected $items=array ();
21
-	protected $_params=array("action"=>"nothing","on"=>"hover");
20
+	protected $items=array();
21
+	protected $_params=array("action"=>"nothing", "on"=>"hover");
22 22
 	protected $input;
23 23
 
24 24
 	public function __construct($identifier, $value="", $items=array()) {
25 25
 		parent::__construct($identifier, "div");
26 26
 		$this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php';
27 27
 		$this->setProperty("class", "ui dropdown");
28
-		$content=new HtmlSemDoubleElement("text-".$this->identifier,"div");
28
+		$content=new HtmlSemDoubleElement("text-".$this->identifier, "div");
29 29
 		$content->setClass("text");
30 30
 		$content->setContent($value);
31
-		$content->wrap("",new HtmlIcon("", "dropdown"));
31
+		$content->wrap("", new HtmlIcon("", "dropdown"));
32 32
 		$this->content=array($content);
33 33
 		$this->tagName="div";
34 34
 		$this->addItems($items);
35 35
 	}
36 36
 
37
-	public function addItem($item,$value=NULL,$image=NULL){
38
-		$itemO=$this->beforeAddItem($item,$value,$image);
37
+	public function addItem($item, $value=NULL, $image=NULL) {
38
+		$itemO=$this->beforeAddItem($item, $value, $image);
39 39
 		$this->items[]=$itemO;
40 40
 		return $itemO;
41 41
 	}
42 42
 
43
-	public function addIcon($icon,$before=true,$labeled=false){
44
-		$this->addIconP($icon,$before,$labeled);
43
+	public function addIcon($icon, $before=true, $labeled=false) {
44
+		$this->addIconP($icon, $before, $labeled);
45 45
 		return $this->getElementById("text-".$this->identifier, $this->content)->setWrapAfter("");
46 46
 	}
47 47
 	/**
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
 	 * @param number $position
51 51
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
52 52
 	 */
53
-	public function insertItem($item,$position=0){
53
+	public function insertItem($item, $position=0) {
54 54
 		$itemO=$this->beforeAddItem($item);
55
-		 $start = array_slice($this->items, 0, $position);
56
-		 $end = array_slice($this->items, $position);
57
-		 $start[] = $item;
55
+		 $start=array_slice($this->items, 0, $position);
56
+		 $end=array_slice($this->items, $position);
57
+		 $start[]=$item;
58 58
 		 $this->items=array_merge($start, $end);
59 59
 		 return $itemO;
60 60
 	}
61 61
 
62
-	protected function beforeAddItem($item,$value=NULL,$image=NULL){
62
+	protected function beforeAddItem($item, $value=NULL, $image=NULL) {
63 63
 		$itemO=$item;
64
-		if(!$item instanceof HtmlDropdownItem){
65
-			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image);
66
-		}elseif($itemO instanceof HtmlDropdownItem){
64
+		if (!$item instanceof HtmlDropdownItem) {
65
+			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image);
66
+		}elseif ($itemO instanceof HtmlDropdownItem) {
67 67
 			$this->addToProperty("class", "vertical");
68 68
 		}
69 69
 		return $itemO;
@@ -76,76 +76,76 @@  discard block
 block discarded – undo
76 76
 		$this->addItem($function($object));
77 77
 	}
78 78
 
79
-	public function addInput($name){
80
-		if(!isset($name))
79
+	public function addInput($name) {
80
+		if (!isset($name))
81 81
 			$name="input-".$this->identifier;
82 82
 		$this->setAction("activate");
83
-		$this->input=new HtmlInput($name,"hidden");
83
+		$this->input=new HtmlInput($name, "hidden");
84 84
 	}
85 85
 
86
-	public function addItems($items){
87
-		if(JArray::isAssociative($items)){
88
-			foreach ($items as $k=>$v){
86
+	public function addItems($items) {
87
+		if (JArray::isAssociative($items)) {
88
+			foreach ($items as $k=>$v) {
89 89
 				$this->addItem($v)->setData($k);
90 90
 			}
91
-		}else{
92
-			foreach ($items as $item){
91
+		}else {
92
+			foreach ($items as $item) {
93 93
 				$this->addItem($item);
94 94
 			}
95 95
 		}
96 96
 	}
97 97
 
98
-	public function count(){
98
+	public function count() {
99 99
 		return \sizeof($this->items);
100 100
 	}
101 101
 	/**
102 102
 	 * @param boolean $dropdown
103 103
 	 */
104
-	public function asDropdown($dropdown){
105
-		if($dropdown===false){
104
+	public function asDropdown($dropdown) {
105
+		if ($dropdown===false) {
106 106
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
107 107
 			$dropdown="menu";
108
-		}else{
108
+		}else {
109 109
 			$dropdown="dropdown";
110 110
 			$this->mClass="menu";
111 111
 		}
112
-		return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown"));
112
+		return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown"));
113 113
 	}
114 114
 
115
-	public function setVertical(){
116
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
115
+	public function setVertical() {
116
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
117 117
 	}
118 118
 
119
-	public function setSimple(){
120
-		return $this->addToPropertyCtrl("class", "simple",array("simple"));
119
+	public function setSimple() {
120
+		return $this->addToPropertyCtrl("class", "simple", array("simple"));
121 121
 	}
122 122
 
123
-	public function asButton($floating=false){
124
-		if($floating)
123
+	public function asButton($floating=false) {
124
+		if ($floating)
125 125
 			$this->addToProperty("class", "floating");
126 126
 		return $this->addToProperty("class", "button");
127 127
 	}
128 128
 
129
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
130
-		if(isset($name))
129
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
130
+		if (isset($name))
131 131
 			$this->addInput($name);
132
-		if($multiple)
132
+		if ($multiple)
133 133
 			$this->addToProperty("class", "multiple");
134 134
 		if ($selection)
135
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
135
+			$this->addToPropertyCtrl("class", "selection", array("selection"));
136 136
 		return $this;
137 137
 	}
138 138
 
139
-	public function asSearch($name=NULL,$multiple=false,$selection=false){
140
-		$this->asSelect($name,$multiple,$selection);
139
+	public function asSearch($name=NULL, $multiple=false, $selection=false) {
140
+		$this->asSelect($name, $multiple, $selection);
141 141
 		return $this->addToProperty("class", "search");
142 142
 	}
143 143
 
144
-	public function setSelect($name=NULL,$multiple=false){
145
-		if(!isset($name))
144
+	public function setSelect($name=NULL, $multiple=false) {
145
+		if (!isset($name))
146 146
 			$name="select-".$this->identifier;
147 147
 		$this->input=null;
148
-		if($multiple){
148
+		if ($multiple) {
149 149
 			$this->setProperty("multiple", true);
150 150
 			$this->addToProperty("class", "multiple");
151 151
 		}
@@ -153,32 +153,32 @@  discard block
 block discarded – undo
153 153
 		$this->tagName="select";
154 154
 		$this->setProperty("name", $name);
155 155
 		$this->content=null;
156
-		foreach ($this->items as $item){
156
+		foreach ($this->items as $item) {
157 157
 			$item->asOption();
158 158
 		}
159 159
 		return $this;
160 160
 	}
161 161
 
162
-	public function asSubmenu($pointing=NULL){
162
+	public function asSubmenu($pointing=NULL) {
163 163
 		$this->setClass("ui dropdown link item");
164
-		if(isset($pointing)){
164
+		if (isset($pointing)) {
165 165
 			$this->setPointing($pointing);
166 166
 		}
167 167
 		return $this;
168 168
 	}
169 169
 
170
-	public function setPointing($value=Direction::NONE){
171
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
170
+	public function setPointing($value=Direction::NONE) {
171
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
172 172
 	}
173 173
 
174
-	public function setValue($value){
175
-		if(isset($this->input)){
174
+	public function setValue($value) {
175
+		if (isset($this->input)) {
176 176
 			$this->input->setProperty("value", $value);
177
-		}else{
177
+		}else {
178 178
 			$this->setProperty("value", $value);
179 179
 		}
180 180
 		$textElement=$this->getElementById("text-".$this->identifier, $this->content);
181
-		if(isset($textElement))
181
+		if (isset($textElement))
182 182
 			$textElement->setContent($value);
183 183
 		return $this;
184 184
 	}
@@ -188,19 +188,19 @@  discard block
 block discarded – undo
188 188
 	 * @see BaseHtml::run()
189 189
 	 */
190 190
 	public function run(JsUtils $js) {
191
-		if($this->propertyContains("class", "simple")===false){
192
-			if(isset($this->_bsComponent)===false)
193
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
191
+		if ($this->propertyContains("class", "simple")===false) {
192
+			if (isset($this->_bsComponent)===false)
193
+				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->_params);
194 194
 			$this->addEventsOnRun($js);
195 195
 			return $this->_bsComponent;
196 196
 		}
197 197
 	}
198 198
 
199
-	public function setAction($action){
199
+	public function setAction($action) {
200 200
 		$this->_params["action"]=$action;
201 201
 	}
202 202
 
203
-	public function setFullTextSearch($value){
203
+	public function setFullTextSearch($value) {
204 204
 		$this->_params["fullTextSearch"]=$value;
205 205
 	}
206 206
 }
207 207
\ No newline at end of file
Please login to merge, or discard this patch.