| @@ -12,34 +12,34 @@ discard block | ||
| 12 | 12 | use Ajax\semantic\html\base\traits\MenuItemTrait; | 
| 13 | 13 | |
| 14 | 14 |  class HtmlDropdownItem extends HtmlSemDoubleElement { | 
| 15 | - use IconTrait,MenuItemTrait; | |
| 16 | -	public function __construct($identifier, $content="",$value=NULL,$image=NULL,$description=NULL) { | |
| 15 | + use IconTrait, MenuItemTrait; | |
| 16 | +	public function __construct($identifier, $content="", $value=NULL, $image=NULL, $description=NULL) { | |
| 17 | 17 | parent::__construct($identifier, "a"); | 
| 18 | 18 |  		$this->setClass("item"); | 
| 19 | 19 | $this->setContent($content); | 
| 20 | - if($value!==NULL) | |
| 20 | + if ($value!==NULL) | |
| 21 | 21 | $this->setData($value); | 
| 22 | - if($image!==NULL) | |
| 22 | + if ($image!==NULL) | |
| 23 | 23 | $this->asMiniAvatar($image); | 
| 24 | - if($description!==NULL) | |
| 24 | + if ($description!==NULL) | |
| 25 | 25 | $this->setDescription($description); | 
| 26 | 26 | } | 
| 27 | 27 | |
| 28 | -	public function setDescription($description){ | |
| 29 | -		$descO=new HtmlDoubleElement("desc-".$this->identifier,"span"); | |
| 28 | +	public function setDescription($description) { | |
| 29 | +		$descO=new HtmlDoubleElement("desc-".$this->identifier, "span"); | |
| 30 | 30 |  		$descO->setClass("description"); | 
| 31 | 31 | $descO->setContent($description); | 
| 32 | - return $this->addContent($descO,true); | |
| 32 | + return $this->addContent($descO, true); | |
| 33 | 33 | } | 
| 34 | 34 | |
| 35 | -	public function setData($value){ | |
| 35 | +	public function setData($value) { | |
| 36 | 36 |  		$this->setProperty("data-value", $value); | 
| 37 | 37 | return $this; | 
| 38 | 38 | } | 
| 39 | 39 | |
| 40 | -	public function asOption(){ | |
| 40 | +	public function asOption() { | |
| 41 | 41 | $this->tagName="option"; | 
| 42 | -		if($this->getProperty("data-value")!==null) | |
| 42 | +		if ($this->getProperty("data-value")!==null) | |
| 43 | 43 |  			$this->setProperty("value", $this->getProperty("data-value")); | 
| 44 | 44 | } | 
| 45 | 45 | |
| @@ -47,11 +47,11 @@ discard block | ||
| 47 | 47 | * @param string $image the image src | 
| 48 | 48 | * @return HtmlImg | 
| 49 | 49 | */ | 
| 50 | -	public function asMiniAvatar($image){ | |
| 50 | +	public function asMiniAvatar($image) { | |
| 51 | 51 | $this->tagName="div"; | 
| 52 | -		$img=new HtmlImg("image-".$this->identifier,$image); | |
| 52 | +		$img=new HtmlImg("image-".$this->identifier, $image); | |
| 53 | 53 |  		$img->setClass("ui mini avatar image"); | 
| 54 | - $this->addContent($img,true); | |
| 54 | + $this->addContent($img, true); | |
| 55 | 55 | return $this; | 
| 56 | 56 | } | 
| 57 | 57 | |
| @@ -60,9 +60,9 @@ discard block | ||
| 60 | 60 | * @param string $icon | 
| 61 | 61 | * @return HtmlDropdownItem | 
| 62 | 62 | */ | 
| 63 | -	public function asIcon($caption,$icon){ | |
| 63 | +	public function asIcon($caption, $icon) { | |
| 64 | 64 | $this->setContent($caption); | 
| 65 | -		$this->addContent(new HtmlIcon("", $icon),true); | |
| 65 | +		$this->addContent(new HtmlIcon("", $icon), true); | |
| 66 | 66 | return $this; | 
| 67 | 67 | } | 
| 68 | 68 | |
| @@ -71,23 +71,23 @@ discard block | ||
| 71 | 71 | * @param string $color | 
| 72 | 72 | * @return HtmlDropdownItem | 
| 73 | 73 | */ | 
| 74 | -	public function asCircularLabel($caption,$color){ | |
| 74 | +	public function asCircularLabel($caption, $color) { | |
| 75 | 75 | $this->setContent($caption); | 
| 76 | 76 |  		$lbl=new HtmlLabel(""); | 
| 77 | 77 | $lbl->setCircular()->setColor($color)->setEmpty(); | 
| 78 | - $this->addContent($lbl,true); | |
| 78 | + $this->addContent($lbl, true); | |
| 79 | 79 | return $this; | 
| 80 | 80 | } | 
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 |  	public function addMenuItem($items) { | 
| 85 | -		$menu=new HtmlMenu("menu-" . $this->identifier, $items); | |
| 85 | +		$menu=new HtmlMenu("menu-".$this->identifier, $items); | |
| 86 | 86 | $content=$this->content; | 
| 87 | 87 |  		$this->setTagName("div"); | 
| 88 | 88 |  		$this->setProperty("class", "item"); | 
| 89 | 89 |  		$icon=new HtmlIcon("", "dropdown"); | 
| 90 | -		$this->content=[$icon,new HtmlSemDoubleElement("","span","text",$content),$menu]; | |
| 90 | +		$this->content=[$icon, new HtmlSemDoubleElement("", "span", "text", $content), $menu]; | |
| 91 | 91 | return $menu; | 
| 92 | 92 | } | 
| 93 | 93 | |
| @@ -96,14 +96,14 @@ discard block | ||
| 96 | 96 | * @param string $icon | 
| 97 | 97 | * @return HtmlDropdownItem | 
| 98 | 98 | */ | 
| 99 | -	public static function searchInput($placeholder=NULL,$icon=NULL){ | |
| 100 | -		return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon); | |
| 99 | +	public static function searchInput($placeholder=NULL, $icon=NULL) { | |
| 100 | +		return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon); | |
| 101 | 101 | } | 
| 102 | 102 | |
| 103 | 103 | /** | 
| 104 | 104 | * @return HtmlDropdownItem | 
| 105 | 105 | */ | 
| 106 | -	public static function divider(){ | |
| 106 | +	public static function divider() { | |
| 107 | 107 |  		return (new HtmlDropdownItem(""))->asDivider(); | 
| 108 | 108 | } | 
| 109 | 109 | |
| @@ -112,8 +112,8 @@ discard block | ||
| 112 | 112 | * @param string $icon | 
| 113 | 113 | * @return HtmlDropdownItem | 
| 114 | 114 | */ | 
| 115 | -	public static function header($caption=NULL,$icon=NULL){ | |
| 116 | -		return (new HtmlDropdownItem(""))->asHeader($caption,$icon); | |
| 115 | +	public static function header($caption=NULL, $icon=NULL) { | |
| 116 | +		return (new HtmlDropdownItem(""))->asHeader($caption, $icon); | |
| 117 | 117 | } | 
| 118 | 118 | |
| 119 | 119 | /** | 
| @@ -121,8 +121,8 @@ discard block | ||
| 121 | 121 | * @param string $color | 
| 122 | 122 | * @return HtmlDropdownItem | 
| 123 | 123 | */ | 
| 124 | -	public static function circular($caption,$color){ | |
| 125 | -		return (new HtmlDropdownItem(""))->asCircularLabel($caption,$color); | |
| 124 | +	public static function circular($caption, $color) { | |
| 125 | +		return (new HtmlDropdownItem(""))->asCircularLabel($caption, $color); | |
| 126 | 126 | } | 
| 127 | 127 | |
| 128 | 128 | /** | 
| @@ -130,8 +130,8 @@ discard block | ||
| 130 | 130 | * @param string $icon | 
| 131 | 131 | * @return HtmlDropdownItem | 
| 132 | 132 | */ | 
| 133 | -	public static function icon($caption,$icon){ | |
| 134 | -		return (new HtmlDropdownItem(""))->asIcon($caption,$icon); | |
| 133 | +	public static function icon($caption, $icon) { | |
| 134 | +		return (new HtmlDropdownItem(""))->asIcon($caption, $icon); | |
| 135 | 135 | } | 
| 136 | 136 | |
| 137 | 137 | /** | 
| @@ -139,7 +139,7 @@ discard block | ||
| 139 | 139 | * @param string $image | 
| 140 | 140 | * @return HtmlDropdownItem | 
| 141 | 141 | */ | 
| 142 | -	public static function avatar($caption,$image){ | |
| 143 | -		return (new HtmlDropdownItem("",$caption))->asMiniAvatar($image); | |
| 142 | +	public static function avatar($caption, $image) { | |
| 143 | +		return (new HtmlDropdownItem("", $caption))->asMiniAvatar($image); | |
| 144 | 144 | } | 
| 145 | 145 | } |