Completed
Push — master ( 141d55...411df4 )
by Jean-Christophe
02:55
created
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,9 +20,9 @@  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
 
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 		$colCount++;
31 31
 		$grid->setColsCount($colCount);
32 32
 
33
-		$list=new HtmlList("",$items);
33
+		$list=new HtmlList("", $items);
34 34
 		$list->asLink();
35
-		if(isset($header)){
36
-			$list->addHeader(4,$header);
35
+		if (isset($header)) {
36
+			$list->addHeader(4, $header);
37 37
 		}
38
-		$grid->getCell(0,$colCount-1)->setContent($list);
38
+		$grid->getCell(0, $colCount-1)->setContent($list);
39 39
 		$grid->setDivided()->setRelaxed(true);
40 40
 		return $list;
41 41
 	}
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	/**
44 44
 	 * A popup can have no maximum width and continue to flow to fit its content
45 45
 	 */
46
-	public function setFlowing(){
46
+	public function setFlowing() {
47 47
 		return $this->addToProperty("class", "flowing");
48 48
 	}
49 49
 
50 50
 	/**
51 51
 	 * A popup can provide more basic formatting
52 52
 	 */
53
-	public function setBasic(){
53
+	public function setBasic() {
54 54
 		return $this->addToProperty("class", "basic");
55 55
 	}
56 56
 
@@ -58,22 +58,22 @@  discard block
 block discarded – undo
58 58
 	 * {@inheritDoc}
59 59
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
60 60
 	 */
61
-	public function run(JsUtils $js){
61
+	public function run(JsUtils $js) {
62 62
 		$this->_params["popup"]="#".$this->identifier;
63
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params);
63
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params);
64 64
 	}
65 65
 
66
-	public function setOn($event="click"){
66
+	public function setOn($event="click") {
67 67
 		$this->_params["on"]=$event;
68 68
 		return $this;
69 69
 	}
70 70
 
71
-	public function setInline($value=true){
71
+	public function setInline($value=true) {
72 72
 		$this->_params["inline"]=$value;
73 73
 		return $this;
74 74
 	}
75 75
 
76
-	public function setPosition($position){
76
+	public function setPosition($position) {
77 77
 		$this->_params["position"]=$position;
78 78
 		return $this;
79 79
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlRating.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	 * @param int $max
14 14
 	 * @param string $icon star or heart
15 15
 	 */
16
-	public function __construct($identifier, $value,$max=5,$icon="") {
16
+	public function __construct($identifier, $value, $max=5, $icon="") {
17 17
 		parent::__construct($identifier, "div", "ui {$icon} rating");
18 18
 		$this->setValue($value);
19 19
 		$this->setMax($max);
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\common\html\HtmlDoubleElement::setValue()
25 25
 	 */
26
-	public function setValue($value){
26
+	public function setValue($value) {
27 27
 		$this->setProperty("data-rating", $value);
28 28
 	}
29 29
 
30
-	public function setMax($max){
30
+	public function setMax($max) {
31 31
 		$this->setProperty("data-max-rating", $max);
32 32
 	}
33 33
 
@@ -35,20 +35,20 @@  discard block
 block discarded – undo
35 35
 	 * {@inheritDoc}
36 36
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
37 37
 	 */
38
-	public function run(JsUtils $js){
38
+	public function run(JsUtils $js) {
39 39
 		parent::run($js);
40
-		return $js->semantic()->rating("#".$this->identifier,$this->_params);
40
+		return $js->semantic()->rating("#".$this->identifier, $this->_params);
41 41
 	}
42 42
 
43
-	public function asStar(){
43
+	public function asStar() {
44 44
 		return $this->setIcon();
45 45
 	}
46 46
 
47
-	public function asHeart(){
47
+	public function asHeart() {
48 48
 		return $this->setIcon("heart");
49 49
 	}
50 50
 
51
-	public function setIcon($icon="star"){
52
-		return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]);
51
+	public function setIcon($icon="star") {
52
+		return $this->addToPropertyCtrl("class", $icon, ["star", "heart", ""]);
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\constants\CheckboxType;
7 7
 
8 8
 abstract class AbstractCheckbox extends HtmlSemDoubleElement {
9
-	protected $_params=array ();
9
+	protected $_params=array();
10 10
 
11 11
 	public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $inputType="checkbox", $type="checkbox") {
12 12
 		parent::__construct("ck-".$identifier, "div", "ui ".$type);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox
74 74
 	 */
75 75
 	public function attachEvent($selector, $action=NULL) {
76
-		if (isset($action)!==false||\is_numeric($action)===true) {
76
+		if (isset($action)!==false || \is_numeric($action)===true) {
77 77
 			$js='$("#%identifier%").checkbox("attach events", "'.$selector.'", "'.$action.'");';
78 78
 		} else {
79 79
 			$js='$("#%identifier%").checkbox("attach events", "'.$selector.'");';
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function attachEvents($events=array()) {
91 91
 		if (\is_array($events)) {
92
-			foreach ( $events as $action => $selector ) {
92
+			foreach ($events as $action => $selector) {
93 93
 				$this->attachEvent($selector, $action);
94 94
 			}
95 95
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSticky.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 class HtmlSticky extends HtmlSemDoubleElement {
9 9
 	private $_params=array();
10 10
 
11
-	public function __construct($identifier,$context=NULL,$content=NULL) {
11
+	public function __construct($identifier, $context=NULL, $content=NULL) {
12 12
 		parent::__construct($identifier, "div", "ui sticky", $content);
13
-		if(isset($content))
13
+		if (isset($content))
14 14
 			$this->setContext($context);
15 15
 	}
16 16
 
17
-	public function setContext($context){
17
+	public function setContext($context) {
18 18
 		$this->_params["context"]=$context;
19 19
 		return $this;
20 20
 	}
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
25 25
 	 */
26
-	public function run(JsUtils $js){
26
+	public function run(JsUtils $js) {
27 27
 		parent::run($js);
28
-		return $js->semantic()->sticky("#".$this->identifier,$this->_params);
28
+		return $js->semantic()->sticky("#".$this->identifier, $this->_params);
29 29
 	}
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegmentGroups.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\HtmlSemCollection;
7 7
 use Ajax\semantic\html\base\constants\Sens;
8 8
 
9
-class HtmlSegmentGroups extends HtmlSemCollection{
9
+class HtmlSegmentGroups extends HtmlSemCollection {
10 10
 
11 11
 
12
-	public function __construct( $identifier, $items=array()){
13
-		parent::__construct( $identifier, "div","ui segments");
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, "div", "ui segments");
14 14
 		$this->addItems($items);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		return new HtmlSegment("segment-".$this->count(),$value);
18
+	protected function createItem($value) {
19
+		return new HtmlSegment("segment-".$this->count(), $value);
20 20
 	}
21 21
 
22
-	protected function createCondition($value){
22
+	protected function createCondition($value) {
23 23
 		return !($value instanceof HtmlSegment);
24 24
 	}
25 25
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 	 * @param string $type one of "raised","stacked","piled" default : ""
29 29
 	 * @return \Ajax\semantic\html\elements\HtmlSegmentGroups
30 30
 	 */
31
-	public function setType($type){
31
+	public function setType($type) {
32 32
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
33 33
 	}
34 34
 
35
-	public function setSens($sens=Sens::VERTICAL){
35
+	public function setSens($sens=Sens::VERTICAL) {
36 36
 		return $this->addToPropertyCtrl("class", $sens, Sens::getConstants());
37 37
 	}
38 38
 
39
-	public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){
40
-		$group=new HtmlSegmentGroups($identifier,$items);
39
+	public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) {
40
+		$group=new HtmlSegmentGroups($identifier, $items);
41 41
 		$group->setSens($sens);
42 42
 		return $group->setType($type);
43 43
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlInput.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 	use IconTrait;
14 14
 
15 15
 	public function __construct($identifier, $type="text", $value="", $placeholder="") {
16
-		parent::__construct("div-" . $identifier, "div", "ui input");
17
-		$this->content=[ "field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder) ];
18
-		$this->_states=[ State::DISABLED,State::FOCUS,State::ERROR ];
19
-		$this->_variations=[ Variation::TRANSPARENT ];
16
+		parent::__construct("div-".$identifier, "div", "ui input");
17
+		$this->content=["field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder)];
18
+		$this->_states=[State::DISABLED, State::FOCUS, State::ERROR];
19
+		$this->_variations=[Variation::TRANSPARENT];
20 20
 	}
21 21
 
22 22
 	public function setFocus() {
@@ -24,38 +24,38 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public function addLoading() {
27
-		if ($this->_hasIcon === false) {
27
+		if ($this->_hasIcon===false) {
28 28
 			throw new \Exception("Input must have an icon for showing a loader, use addIcon before");
29 29
 		}
30 30
 		return $this->addToProperty("class", State::LOADING);
31 31
 	}
32 32
 
33 33
 	public function labeled($label, $direction=Direction::LEFT, $icon=NULL) {
34
-		$labelO=$this->addLabel($label,$direction===Direction::LEFT,$icon);
35
-		$this->addToProperty("class", $direction . " labeled");
34
+		$labelO=$this->addLabel($label, $direction===Direction::LEFT, $icon);
35
+		$this->addToProperty("class", $direction." labeled");
36 36
 		return $labelO;
37 37
 	}
38 38
 
39 39
 	public function labeledToCorner($icon, $direction=Direction::LEFT) {
40
-		return $this->labeled("", $direction . " corner", $icon)->toCorner($direction);
40
+		return $this->labeled("", $direction." corner", $icon)->toCorner($direction);
41 41
 	}
42 42
 
43 43
 	public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $labeled=false) {
44 44
 		$actionO=$action;
45
-		if (\is_object($action) === false) {
46
-			$actionO=new HtmlButton("action-" . $this->identifier, $action);
45
+		if (\is_object($action)===false) {
46
+			$actionO=new HtmlButton("action-".$this->identifier, $action);
47 47
 			if (isset($icon))
48 48
 				$actionO->addIcon($icon, true, $labeled);
49 49
 		}
50
-		$this->addToProperty("class", $direction . " action");
51
-		$this->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
50
+		$this->addToProperty("class", $direction." action");
51
+		$this->addContent($actionO, \strstr($direction, Direction::LEFT)!==false);
52 52
 		return $actionO;
53 53
 	}
54 54
 
55
-	public function addDropdown($label="", $items=array(),$direction=Direction::RIGHT){
56
-		$labelO=new HtmlDropdown("dd-".$this->identifier,$label,$items);
57
-		$labelO->asSelect("select-".$this->identifier,false,true);
58
-		return $this->labeled($labelO,$direction);
55
+	public function addDropdown($label="", $items=array(), $direction=Direction::RIGHT) {
56
+		$labelO=new HtmlDropdown("dd-".$this->identifier, $label, $items);
57
+		$labelO->asSelect("select-".$this->identifier, false, true);
58
+		return $this->labeled($labelO, $direction);
59 59
 	}
60 60
 
61 61
 	public function getField() {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
  * @version 1.001
19 19
  */
20 20
 class HtmlSegment extends HtmlSemDoubleElement {
21
-	use AttachedTrait,TextAlignmentTrait;
21
+	use AttachedTrait, TextAlignmentTrait;
22 22
 
23 23
 	public function __construct($identifier, $content="") {
24 24
 		parent::__construct($identifier, "div", "ui segment");
25
-		$this->_variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]);
26
-		$this->_states=\array_merge($this->_states, [ State::LOADING ]);
25
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
26
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
27 27
 		$this->content=$content;
28 28
 	}
29 29
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	public function setSens($sens="vertical") {
40
-		return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" ));
40
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
41 41
 	}
42 42
 
43 43
 	public function setEmphasis($value=Emphasis::SECONDARY) {
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	public function asContainer() {
64
-		return $this->addToPropertyCtrl("class", "container", array ("container" ));
64
+		return $this->addToPropertyCtrl("class", "container", array("container"));
65 65
 	}
66 66
 
67
-	public function addGrid($numRows=1, $numCols=NULL){
68
-		$grid=new HtmlGrid("Grid-".$this->identifier,$numRows,$numCols);
67
+	public function addGrid($numRows=1, $numCols=NULL) {
68
+		$grid=new HtmlGrid("Grid-".$this->identifier, $numRows, $numCols);
69 69
 		$this->content=$grid;
70 70
 		return $grid;
71 71
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabelGroups.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class HtmlLabelGroups extends HtmlSemCollection {
17 17
 
18
-	public function __construct($identifier,$labels=array(), $attributes=array()) {
18
+	public function __construct($identifier, $labels=array(), $attributes=array()) {
19 19
 		parent::__construct($identifier, "div", "ui labels");
20
-		$this->_states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]);
20
+		$this->_states=\array_merge(Size::getConstants(), Color::getConstants(), ["tag", "circular"]);
21 21
 		$this->addItems($labels);
22 22
 		$this->setStates($attributes);
23 23
 	}
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 			$icon=JArray::getValue($value, "icon", 1);
32 32
 			$tagName=JArray::getValue($value, "tagName", 2);
33 33
 		}
34
-		$labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName);
34
+		$labelO=new HtmlLabel("label-".$this->identifier, $caption, $icon, $tagName);
35 35
 		return $labelO;
36 36
 	}
37 37
 
38 38
 	protected function createCondition($value) {
39
-		return ($value instanceof HtmlLabel) === false;
39
+		return ($value instanceof HtmlLabel)===false;
40 40
 	}
41 41
 
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/html5/HtmlLink.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 	 * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run()
22 22
 	 */
23 23
 	public function run(JsUtils $js) {
24
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
24
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
25 25
 		$this->addEventsOnRun($js);
26 26
 		return $this->_bsComponent;
27 27
 	}
28 28
 
29 29
 	public function addIcon($icon, $before=true) {
30
-		return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
30
+		return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before);
31 31
 	}
32 32
 
33 33
 	public static function icon($identifier, $icon, $href="#", $label=NULL) {
Please login to merge, or discard this patch.