@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $state=\explode(" ", $state); |
| 14 | 14 | } |
| 15 | 15 | if (\is_array($elements)) { |
| 16 | - foreach ( $elements as $element ) { |
|
| 16 | + foreach ($elements as $element) { |
|
| 17 | 17 | if ($element instanceof BaseHtml) { |
| 18 | 18 | self::_add($state, $element); |
| 19 | 19 | } |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | private static function _add($states, $element) { |
| 25 | - foreach ( $states as $state ) { |
|
| 26 | - $element->addToPropertyCtrl("class", $state, array ($state )); |
|
| 25 | + foreach ($states as $state) { |
|
| 26 | + $element->addToPropertyCtrl("class", $state, array($state)); |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace Ajax\semantic\html\base\constants; |
| 3 | 3 | use Ajax\common\BaseEnum; |
| 4 | 4 | abstract class Size extends BaseEnum { |
| 5 | - const MASSIVE="massive",HUGE="huge",BIG="big",LARGE="large",MEDIUM="",SMALL="small",TINY="tiny",MINI="mini"; |
|
| 5 | + const MASSIVE="massive", HUGE="huge", BIG="big", LARGE="large", MEDIUM="", SMALL="small", TINY="tiny", MINI="mini"; |
|
| 6 | 6 | } |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | abstract class StepStatus extends BaseEnum { |
| 8 | - const ACTIVE="active",COMPLETED="completed",DISABLED="disabled",NONE=""; |
|
| 8 | + const ACTIVE="active", COMPLETED="completed", DISABLED="disabled", NONE=""; |
|
| 9 | 9 | } |
@@ -12,23 +12,23 @@ |
||
| 12 | 12 | * @param string $value |
| 13 | 13 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
| 14 | 14 | */ |
| 15 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
| 16 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
| 15 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
| 16 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function textCenterAligned(){ |
|
| 19 | + public function textCenterAligned() { |
|
| 20 | 20 | return $this->setTextAlignment(TextAlignment::CENTER); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function textJustified(){ |
|
| 23 | + public function textJustified() { |
|
| 24 | 24 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function textRightAligned(){ |
|
| 27 | + public function textRightAligned() { |
|
| 28 | 28 | return $this->setTextAlignment(TextAlignment::RIGHT); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function textLeftAligned(){ |
|
| 31 | + public function textLeftAligned() { |
|
| 32 | 32 | return $this->setTextAlignment(); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | class HtmlCard extends HtmlViewItem { |
| 8 | 8 | |
| 9 | - public function __construct($identifier,$content=NULL) { |
|
| 9 | + public function __construct($identifier, $content=NULL) { |
|
| 10 | 10 | parent::__construct($identifier, "ui card", $content); |
| 11 | 11 | } |
| 12 | 12 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * @param string $event |
| 22 | 22 | * @param boolean $multiple |
| 23 | 23 | */ |
| 24 | - public function __construct($table,$class="active",$event="click",$multiple=false){ |
|
| 24 | + public function __construct($table, $class="active", $event="click", $multiple=false) { |
|
| 25 | 25 | $this->table=$table; |
| 26 | 26 | $this->class=$class; |
| 27 | 27 | $this->event=$event; |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | return $this; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - public function compile(){ |
|
| 58 | + public function compile() { |
|
| 59 | 59 | $multiple=""; |
| 60 | - if(!$this->multiple){ |
|
| 60 | + if (!$this->multiple) { |
|
| 61 | 61 | $multiple="$(this).closest('tbody').children('tr').removeClass('".$this->class."');"; |
| 62 | 62 | } |
| 63 | - $this->table->onRow($this->event, $multiple."$(this).toggleClass('".$this->class."');",false,false); |
|
| 63 | + $this->table->onRow($this->event, $multiple."$(this).toggleClass('".$this->class."');", false, false); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | } |
@@ -12,15 +12,15 @@ discard block |
||
| 12 | 12 | * @author jc |
| 13 | 13 | * @version 1.001 |
| 14 | 14 | */ |
| 15 | -class HtmlLabeledIconMenu extends HtmlMenu{ |
|
| 15 | +class HtmlLabeledIconMenu extends HtmlMenu { |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param string $identifier |
| 20 | 20 | * @param array $items icons |
| 21 | 21 | */ |
| 22 | - public function __construct( $identifier, $items=array()){ |
|
| 23 | - parent::__construct( $identifier, $items); |
|
| 22 | + public function __construct($identifier, $items=array()) { |
|
| 23 | + parent::__construct($identifier, $items); |
|
| 24 | 24 | $this->addToProperty("class", "labeled icon"); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | protected function createItem($value) { |
| 32 | 32 | $text=""; |
| 33 | 33 | $v=$value; |
| 34 | - if(\is_array($value)){ |
|
| 34 | + if (\is_array($value)) { |
|
| 35 | 35 | $v=@$value[0]; |
| 36 | 36 | $text=@$value[1]; |
| 37 | 37 | } |
| 38 | 38 | $count=\sizeof($this->content); |
| 39 | 39 | $value=new HtmlIcon("icon-".$count, $v); |
| 40 | - $value->wrap("",$text); |
|
| 41 | - $itemO=new HtmlLink("item-".$count,"",$value); |
|
| 40 | + $value->wrap("", $text); |
|
| 41 | + $itemO=new HtmlLink("item-".$count, "", $value); |
|
| 42 | 42 | return $itemO->setClass("item"); |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -12,15 +12,15 @@ discard block |
||
| 12 | 12 | * @author jc |
| 13 | 13 | * @version 1.001 |
| 14 | 14 | */ |
| 15 | -class HtmlIconMenu extends HtmlMenu{ |
|
| 15 | +class HtmlIconMenu extends HtmlMenu { |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param string $identifier |
| 20 | 20 | * @param array $items icons |
| 21 | 21 | */ |
| 22 | - public function __construct( $identifier, $items=array()){ |
|
| 23 | - parent::__construct( $identifier, $items); |
|
| 22 | + public function __construct($identifier, $items=array()) { |
|
| 23 | + parent::__construct($identifier, $items); |
|
| 24 | 24 | $this->addToProperty("class", "icon"); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | protected function createItem($value) { |
| 33 | 33 | $count=\sizeof($this->content); |
| 34 | 34 | $value=new HtmlIcon("icon-".$count, $value); |
| 35 | - $itemO=new HtmlLink("item-".$count,"",$value); |
|
| 35 | + $itemO=new HtmlLink("item-".$count, "", $value); |
|
| 36 | 36 | return $itemO->setClass("item"); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -68,10 +68,11 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function setDismissable($dismiss=true){ |
| 71 | - if($dismiss===true) |
|
| 72 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 73 | - else |
|
| 74 | - $this->close=NULL; |
|
| 71 | + if($dismiss===true) { |
|
| 72 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 73 | + } else { |
|
| 74 | + $this->close=NULL; |
|
| 75 | + } |
|
| 75 | 76 | return $this; |
| 76 | 77 | } |
| 77 | 78 | |
@@ -115,8 +116,9 @@ discard block |
||
| 115 | 116 | public function setMessage($message){ |
| 116 | 117 | if(\is_array($this->content)){ |
| 117 | 118 | $this->content[\sizeof($this->content)-1]=$message; |
| 118 | - }else |
|
| 119 | - $this->setContent($message); |
|
| 119 | + } else { |
|
| 120 | + $this->setContent($message); |
|
| 121 | + } |
|
| 120 | 122 | } |
| 121 | 123 | |
| 122 | 124 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @version 1.001 |
| 16 | 16 | */ |
| 17 | 17 | class HtmlMessage extends HtmlSemDoubleElement { |
| 18 | - use AttachedTrait,HasTimeoutTrait; |
|
| 18 | + use AttachedTrait, HasTimeoutTrait; |
|
| 19 | 19 | protected $icon; |
| 20 | 20 | protected $close; |
| 21 | 21 | |
@@ -32,35 +32,35 @@ discard block |
||
| 32 | 32 | * @param string|HtmlSemDoubleElement $header |
| 33 | 33 | * @return \Ajax\semantic\html\collections\HtmlMessage |
| 34 | 34 | */ |
| 35 | - public function addHeader($header){ |
|
| 35 | + public function addHeader($header) { |
|
| 36 | 36 | $headerO=$header; |
| 37 | - if(\is_string($header)){ |
|
| 38 | - $headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div"); |
|
| 37 | + if (\is_string($header)) { |
|
| 38 | + $headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div"); |
|
| 39 | 39 | $headerO->setClass("header"); |
| 40 | 40 | $headerO->setContent($header); |
| 41 | 41 | } |
| 42 | - return $this->addContent($headerO,true); |
|
| 42 | + return $this->addContent($headerO, true); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function setHeader($header){ |
|
| 45 | + public function setHeader($header) { |
|
| 46 | 46 | return $this->addHeader($header); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function setIcon($icon){ |
|
| 49 | + public function setIcon($icon) { |
|
| 50 | 50 | $this->addToProperty("class", "icon"); |
| 51 | - $this->wrapContent("<div class='content'>","</div>"); |
|
| 51 | + $this->wrapContent("<div class='content'>", "</div>"); |
|
| 52 | 52 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
| 53 | 53 | return $this; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function addLoader($loaderIcon="notched circle"){ |
|
| 56 | + public function addLoader($loaderIcon="notched circle") { |
|
| 57 | 57 | $this->setIcon($loaderIcon); |
| 58 | 58 | $this->icon->addToIcon("loading"); |
| 59 | 59 | return $this; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function setDismissable($dismiss=true){ |
|
| 63 | - if($dismiss===true) |
|
| 62 | + public function setDismissable($dismiss=true) { |
|
| 63 | + if ($dismiss===true) |
|
| 64 | 64 | $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
| 65 | 65 | else |
| 66 | 66 | $this->close=NULL; |
@@ -71,43 +71,43 @@ discard block |
||
| 71 | 71 | * {@inheritDoc} |
| 72 | 72 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
| 73 | 73 | */ |
| 74 | - public function run(JsUtils $js){ |
|
| 75 | - if(!isset($this->_bsComponent)){ |
|
| 76 | - if(isset($this->close)){ |
|
| 74 | + public function run(JsUtils $js) { |
|
| 75 | + if (!isset($this->_bsComponent)) { |
|
| 76 | + if (isset($this->close)) { |
|
| 77 | 77 | $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition})"); |
| 78 | 78 | } |
| 79 | - if(isset($this->_timeout)){ |
|
| 80 | - $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});",true); |
|
| 79 | + if (isset($this->_timeout)) { |
|
| 80 | + $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});", true); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | return parent::run($js); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public function setState($visible=true){ |
|
| 87 | - $visible=($visible===true)?"visible":"hidden"; |
|
| 88 | - return $this->addToPropertyCtrl("class", $visible, array("visible","hidden")); |
|
| 86 | + public function setState($visible=true) { |
|
| 87 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
| 88 | + return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden")); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public function setVariation($value="floating"){ |
|
| 92 | - return $this->addToPropertyCtrl("class", $value, array("floating","compact")); |
|
| 91 | + public function setVariation($value="floating") { |
|
| 92 | + return $this->addToPropertyCtrl("class", $value, array("floating", "compact")); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function setStyle($style){ |
|
| 95 | + public function setStyle($style) { |
|
| 96 | 96 | return $this->addToPropertyCtrl("class", $style, Style::getConstants()); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - public function setError(){ |
|
| 99 | + public function setError() { |
|
| 100 | 100 | return $this->setStyle("error"); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - public function setWarning(){ |
|
| 103 | + public function setWarning() { |
|
| 104 | 104 | return $this->setStyle("warning"); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - public function setMessage($message){ |
|
| 108 | - if(\is_array($this->content)){ |
|
| 107 | + public function setMessage($message) { |
|
| 108 | + if (\is_array($this->content)) { |
|
| 109 | 109 | $this->content[\sizeof($this->content)-1]=$message; |
| 110 | - }else |
|
| 110 | + } else |
|
| 111 | 111 | $this->setContent($message); |
| 112 | 112 | } |
| 113 | 113 | |