Completed
Push — master ( 409900...f20dfb )
by Jean-Christophe
03:24
created
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * {@inheritDoc}
21 21
 	 * @see \Ajax\common\html\HtmlSingleElement::setSize()
22 22
 	 */
23
-	public function setSize($size){
23
+	public function setSize($size) {
24 24
 		return $this->addToPropertyCtrl("class", $size, Size::getConstants());
25 25
 	}
26 26
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * show it is currently unable to be interacted with
29 29
 	 * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement
30 30
 	 */
31
-	public function setDisabled(){
31
+	public function setDisabled() {
32 32
 		return $this->addToProperty("class", "disabled");
33 33
 	}
34 34
 
@@ -36,28 +36,28 @@  discard block
 block discarded – undo
36 36
 	 * @param string $color
37 37
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
38 38
 	 */
39
-	public function setColor($color){
40
-		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
39
+	public function setColor($color) {
40
+		return $this->addToPropertyCtrl("class", $color, Color::getConstants());
41 41
 	}
42 42
 
43
-	public function setPopupAttributes($variation=NULL,$popupEvent=NULL){
44
-		if(isset($this->_popup))
45
-			$this->_popup->setAttributes($variation,$popupEvent);
43
+	public function setPopupAttributes($variation=NULL, $popupEvent=NULL) {
44
+		if (isset($this->_popup))
45
+			$this->_popup->setAttributes($variation, $popupEvent);
46 46
 	}
47 47
 
48
-	public function addPopup($title="",$content="",$variation=NULL,$params=array()){
49
-		$this->_popup=new InternalPopup($this,$title,$content,$variation,$params);
48
+	public function addPopup($title="", $content="", $variation=NULL, $params=array()) {
49
+		$this->_popup=new InternalPopup($this, $title, $content, $variation, $params);
50 50
 		return $this;
51 51
 	}
52 52
 
53
-	public function addPopupHtml($html="",$variation=NULL,$params=array()){
53
+	public function addPopupHtml($html="", $variation=NULL, $params=array()) {
54 54
 		$this->_popup=new InternalPopup($this);
55 55
 		$this->_popup->setHtml($html);
56
-		$this->_popup->setAttributes($variation,$params);
56
+		$this->_popup->setAttributes($variation, $params);
57 57
 		return $this;
58 58
 	}
59 59
 
60
-	public function setFluid(){
60
+	public function setFluid() {
61 61
 		$this->addToProperty("class", "fluid");
62 62
 	}
63 63
 
@@ -68,27 +68,27 @@  discard block
 block discarded – undo
68 68
 	 * @param boolean $labeled
69 69
 	 * @return \Ajax\semantic\html\elements\HtmlIcon
70 70
 	 */
71
-	public function addIcon($icon,$before=true,$labeled=false){
71
+	public function addIcon($icon, $before=true, $labeled=false) {
72 72
 		$iconO=$icon;
73
-		if(\is_string($icon)){
73
+		if (\is_string($icon)) {
74 74
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
75 75
 		}
76
-		if($labeled!==false){
76
+		if ($labeled!==false) {
77 77
 			$this->addToProperty("class", "labeled icon");
78 78
 			$this->tagName="div";
79 79
 		}
80
-		$this->addContent($iconO,$before);
80
+		$this->addContent($iconO, $before);
81 81
 		return $iconO;
82 82
 	}
83 83
 
84
-	public function compile(JsUtils $js=NULL, View $view=NULL){
85
-		if(isset($this->_popup))
84
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
85
+		if (isset($this->_popup))
86 86
 			$this->_popup->compile();
87
-		return parent::compile($js,$view);
87
+		return parent::compile($js, $view);
88 88
 	}
89
-	public function run(JsUtils $js){
89
+	public function run(JsUtils $js) {
90 90
 		parent::run($js);
91
-		if(isset($this->_popup)){
91
+		if (isset($this->_popup)) {
92 92
 			$this->_popup->run($js);
93 93
 			//$this->addEventsOnRun($js);
94 94
 			//return $this->_bsComponent;
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   +23 added lines, -23 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,42 +41,42 @@  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 static function searchInput($placeholder=NULL,$icon=NULL){
80
-		return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon);
79
+	public static function searchInput($placeholder=NULL, $icon=NULL) {
80
+		return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon);
81 81
 	}
82 82
 }
83 83
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/components/Popup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 		return $this->setParam("onShow", "%function(){".$jsCode."}%");
31 31
 	}
32 32
 
33
-	public function setExclusive($value){
33
+	public function setExclusive($value) {
34 34
 		return $this->setParam("exclusive", $value);
35 35
 	}
36 36
 	//TODO other events implementation
Please login to merge, or discard this patch.
Ajax/semantic/components/Dropdown.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 	 * @param string $action one of "select","auto","activate","combo","nothing","hide"
18 18
 	 * @return \Ajax\semantic\components\Dropdown
19 19
 	 */
20
-	public function setAction($action){
21
-		return $this->setParamCtrl("action", $action,array("select","auto","activate","combo","nothing","hide"));
20
+	public function setAction($action) {
21
+		return $this->setParamCtrl("action", $action, array("select", "auto", "activate", "combo", "nothing", "hide"));
22 22
 	}
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.