@@ -21,7 +21,7 @@ |
||
| 21 | 21 | return $this->setParam("context", $value); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function setOffset($offset=0){ |
|
| 24 | + public function setOffset($offset=0) { |
|
| 25 | 25 | return $this->setParam("offset", $offset); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $this->params["onUnchecked"]="%function(){".$value."}%"; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function setOnChange($value){ |
|
| 23 | + public function setOnChange($value) { |
|
| 24 | 24 | $this->params["onChange"]="%function(){".$value."}%"; |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -8,16 +8,16 @@ |
||
| 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 | $this->_identifier=$identifier; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - public function getDataField(){ |
|
| 19 | - $field= $this->getField(); |
|
| 20 | - if($field instanceof HtmlInput) |
|
| 18 | + public function getDataField() { |
|
| 19 | + $field=$this->getField(); |
|
| 20 | + if ($field instanceof HtmlInput) |
|
| 21 | 21 | $field=$field->getDataField(); |
| 22 | 22 | return $field; |
| 23 | 23 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * @return $this |
| 51 | 51 | */ |
| 52 | 52 | public function setSource($source) { |
| 53 | - $source=str_ireplace(array ( |
|
| 53 | + $source=str_ireplace(array( |
|
| 54 | 54 | "\"", |
| 55 | 55 | "'" |
| 56 | 56 | ), "%quote%", $source); |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | * @property HtmlSemDoubleElement $_self |
| 16 | 16 | */ |
| 17 | 17 | trait BaseTrait { |
| 18 | - protected $_variations=[ ]; |
|
| 19 | - protected $_states=[ ]; |
|
| 18 | + protected $_variations=[]; |
|
| 19 | + protected $_states=[]; |
|
| 20 | 20 | protected $_baseClass; |
| 21 | 21 | |
| 22 | 22 | abstract protected function setPropertyCtrl($name, $value, $typeCtrl); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | abstract public function setProperty($name, $value); |
| 31 | 31 | |
| 32 | - abstract public function addContent($content,$before=false); |
|
| 32 | + abstract public function addContent($content, $before=false); |
|
| 33 | 33 | |
| 34 | 34 | abstract public function onCreate($jsCode); |
| 35 | 35 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $this->_self->setProperty("class", $this->_self->getBaseClass()); |
| 51 | 51 | if (\is_string($variations)) |
| 52 | 52 | $variations=\explode(" ", $variations); |
| 53 | - foreach ( $variations as $variation ) { |
|
| 53 | + foreach ($variations as $variation) { |
|
| 54 | 54 | $this->_self->addVariation($variation); |
| 55 | 55 | } |
| 56 | 56 | return $this; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function addVariations($variations=array()) { |
| 65 | 65 | if (\is_string($variations)) |
| 66 | 66 | $variations=\explode(" ", $variations); |
| 67 | - foreach ( $variations as $variation ) { |
|
| 67 | + foreach ($variations as $variation) { |
|
| 68 | 68 | $this->_self->addVariation($variation); |
| 69 | 69 | } |
| 70 | 70 | return $this; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | public function addStates($states=array()) { |
| 74 | 74 | if (\is_string($states)) |
| 75 | 75 | $states=\explode(" ", $states); |
| 76 | - foreach ( $states as $state ) { |
|
| 76 | + foreach ($states as $state) { |
|
| 77 | 77 | $this->_self->addState($state); |
| 78 | 78 | } |
| 79 | 79 | return $this; |
@@ -83,17 +83,17 @@ discard block |
||
| 83 | 83 | $this->_self->setProperty("class", $this->_self->getBaseClass()); |
| 84 | 84 | if (\is_string($states)) |
| 85 | 85 | $states=\explode(" ", $states); |
| 86 | - foreach ( $states as $state ) { |
|
| 86 | + foreach ($states as $state) { |
|
| 87 | 87 | $this->_self->addState($state); |
| 88 | 88 | } |
| 89 | 89 | return $this; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | public function addIcon($icon, $before=true) { |
| 93 | - return $this->_self->addContent(new HtmlIcon("icon-" . $this->_self->getIdentifier(), $icon), $before); |
|
| 93 | + return $this->_self->addContent(new HtmlIcon("icon-".$this->_self->getIdentifier(), $icon), $before); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function addSticky($context="body"){ |
|
| 96 | + public function addSticky($context="body") { |
|
| 97 | 97 | $this->_self->onCreate("$('#".$this->_self->getIdentifier()."').sticky({ context: '".$context."'});"); |
| 98 | 98 | return $this; |
| 99 | 99 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @return HtmlSemDoubleElement |
| 115 | 115 | */ |
| 116 | 116 | public function setDisabled($disable=true) { |
| 117 | - if($disable) |
|
| 117 | + if ($disable) |
|
| 118 | 118 | $this->_self->addToProperty("class", "disabled"); |
| 119 | 119 | return $this; |
| 120 | 120 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * |
| 141 | 141 | * @return HtmlSemDoubleElement |
| 142 | 142 | */ |
| 143 | - public function asHeader(){ |
|
| 143 | + public function asHeader() { |
|
| 144 | 144 | return $this->_self->addToProperty("class", "header"); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -148,15 +148,15 @@ discard block |
||
| 148 | 148 | * show it is currently the active user selection |
| 149 | 149 | * @return HtmlSemDoubleElement |
| 150 | 150 | */ |
| 151 | - public function setActive($value=true){ |
|
| 152 | - if($value) |
|
| 151 | + public function setActive($value=true) { |
|
| 152 | + if ($value) |
|
| 153 | 153 | $this->_self->addToProperty("class", "active"); |
| 154 | 154 | return $this; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - public function setAttached($value=true){ |
|
| 158 | - if($value) |
|
| 159 | - $this->_self->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 157 | + public function setAttached($value=true) { |
|
| 158 | + if ($value) |
|
| 159 | + $this->_self->addToPropertyCtrl("class", "attached", array("attached")); |
|
| 160 | 160 | return $this; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -164,13 +164,13 @@ discard block |
||
| 164 | 164 | * can be formatted to appear on dark backgrounds |
| 165 | 165 | */ |
| 166 | 166 | public function setInverted($recursive=true) { |
| 167 | - if($recursive===true){ |
|
| 167 | + if ($recursive===true) { |
|
| 168 | 168 | $content=$this->_self->getContent(); |
| 169 | - if($content instanceof HtmlSemDoubleElement) |
|
| 169 | + if ($content instanceof HtmlSemDoubleElement) |
|
| 170 | 170 | $content->setInverted($recursive); |
| 171 | - elseif(\is_array($content) || $content instanceof \Traversable){ |
|
| 172 | - foreach ($content as $elm){ |
|
| 173 | - if($elm instanceof HtmlSemDoubleElement){ |
|
| 171 | + elseif (\is_array($content) || $content instanceof \Traversable) { |
|
| 172 | + foreach ($content as $elm) { |
|
| 173 | + if ($elm instanceof HtmlSemDoubleElement) { |
|
| 174 | 174 | $elm->setInverted($recursive); |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | public function setFloated($direction="right") { |
| 187 | - return $this->_self->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated")); |
|
| 187 | + return $this->_self->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated")); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | public function floatRight() { |
@@ -199,14 +199,14 @@ discard block |
||
| 199 | 199 | return $this->_baseClass; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - protected function addBehavior(&$array,$key,$value,$before="",$after=""){ |
|
| 203 | - if(\is_string($value)){ |
|
| 204 | - if(isset($array[$key])){ |
|
| 202 | + protected function addBehavior(&$array, $key, $value, $before="", $after="") { |
|
| 203 | + if (\is_string($value)) { |
|
| 204 | + if (isset($array[$key])) { |
|
| 205 | 205 | $p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, ""); |
| 206 | 206 | $array[$key]=$before.$p.$value.$after; |
| 207 | - }else |
|
| 207 | + } else |
|
| 208 | 208 | $array[$key]=$before.$value.$after; |
| 209 | - }else{ |
|
| 209 | + } else { |
|
| 210 | 210 | $array[$key]=$value; |
| 211 | 211 | } |
| 212 | 212 | return $this; |
@@ -17,6 +17,6 @@ |
||
| 17 | 17 | if (isset($toElement) && \method_exists($toElement, "setAttached")) { |
| 18 | 18 | $toElement->setAttached(true); |
| 19 | 19 | } |
| 20 | - return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached")); |
|
| 20 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
| 21 | 21 | } |
| 22 | 22 | } |
@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace Ajax\semantic\html\base\constants; |
| 3 | 3 | use Ajax\common\BaseEnum; |
| 4 | 4 | abstract class Social extends BaseEnum { |
| 5 | - const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube",GITHUB="github"; |
|
| 5 | + const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube", GITHUB="github"; |
|
| 6 | 6 | } |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | * @return $this |
| 28 | 28 | */ |
| 29 | 29 | public function setOnShow($jsCode) { |
| 30 | - $jsCode=str_ireplace("\"","%quote%", $jsCode); |
|
| 30 | + $jsCode=str_ireplace("\"", "%quote%", $jsCode); |
|
| 31 | 31 | return $this->setParam("onShow", "%function(){".$jsCode."}%"); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function setExclusive($value){ |
|
| 34 | + public function setExclusive($value) { |
|
| 35 | 35 | return $this->setParam("exclusive", $value); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -40,19 +40,19 @@ discard block |
||
| 40 | 40 | * @param string $popup the css selector of the popup |
| 41 | 41 | * @return \Ajax\semantic\components\Popup |
| 42 | 42 | */ |
| 43 | - public function setPopup($popup){ |
|
| 43 | + public function setPopup($popup) { |
|
| 44 | 44 | return $this->setParam("popup", $popup); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function setInline($value){ |
|
| 47 | + public function setInline($value) { |
|
| 48 | 48 | return $this->setParam("inline", $value); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public function setPosition($value){ |
|
| 51 | + public function setPosition($value) { |
|
| 52 | 52 | return $this->setParam("position", $value); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function setSetFluidWidth($value){ |
|
| 55 | + public function setSetFluidWidth($value) { |
|
| 56 | 56 | return $this->setParam("setFluidWidth", $value); |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | * @param array $instances |
| 19 | 19 | * @return DataTable |
| 20 | 20 | */ |
| 21 | - public function dataTable($identifier,$model, $instances){ |
|
| 22 | - return $this->addHtmlComponent(new DataTable($identifier,$model,$instances)); |
|
| 21 | + public function dataTable($identifier, $model, $instances) { |
|
| 22 | + return $this->addHtmlComponent(new DataTable($identifier, $model, $instances)); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | * @param array $instances |
| 29 | 29 | * @return JsonDataTable |
| 30 | 30 | */ |
| 31 | - public function jsonDataTable($identifier,$model, $instances){ |
|
| 32 | - return $this->addHtmlComponent(new JsonDataTable($identifier,$model,$instances)); |
|
| 31 | + public function jsonDataTable($identifier, $model, $instances) { |
|
| 32 | + return $this->addHtmlComponent(new JsonDataTable($identifier, $model, $instances)); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | * @param object $instance |
| 38 | 38 | * @return DataElement |
| 39 | 39 | */ |
| 40 | - public function dataElement($identifier, $instance){ |
|
| 41 | - return $this->addHtmlComponent(new DataElement($identifier,$instance)); |
|
| 40 | + public function dataElement($identifier, $instance) { |
|
| 41 | + return $this->addHtmlComponent(new DataElement($identifier, $instance)); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | * @param object $instance |
| 47 | 47 | * @return DataForm |
| 48 | 48 | */ |
| 49 | - public function dataForm($identifier, $instance){ |
|
| 50 | - return $this->addHtmlComponent(new DataForm($identifier,$instance)); |
|
| 49 | + public function dataForm($identifier, $instance) { |
|
| 50 | + return $this->addHtmlComponent(new DataForm($identifier, $instance)); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | * @param object $instance |
| 56 | 56 | * @return FormLogin |
| 57 | 57 | */ |
| 58 | - public function defaultLogin($identifier,$instance=null){ |
|
| 59 | - return $this->addHtmlComponent(FormLogin::regular($identifier,$instance)); |
|
| 58 | + public function defaultLogin($identifier, $instance=null) { |
|
| 59 | + return $this->addHtmlComponent(FormLogin::regular($identifier, $instance)); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | * @param object $instance |
| 65 | 65 | * @return FormLogin |
| 66 | 66 | */ |
| 67 | - public function smallLogin($identifier,$instance=null){ |
|
| 68 | - return $this->addHtmlComponent(FormLogin::small($identifier,$instance)); |
|
| 67 | + public function smallLogin($identifier, $instance=null) { |
|
| 68 | + return $this->addHtmlComponent(FormLogin::small($identifier, $instance)); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | * @param object $instance |
| 74 | 74 | * @return FormLogin |
| 75 | 75 | */ |
| 76 | - public function segmentedLogin($identifier,$instance=null){ |
|
| 77 | - return $this->addHtmlComponent(FormLogin::attachedSegment($identifier,$instance)); |
|
| 76 | + public function segmentedLogin($identifier, $instance=null) { |
|
| 77 | + return $this->addHtmlComponent(FormLogin::attachedSegment($identifier, $instance)); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @param object $instance |
| 83 | 83 | * @return FormAccount |
| 84 | 84 | */ |
| 85 | - public function defaultAccount($identifier,$instance=null){ |
|
| 86 | - return $this->addHtmlComponent(FormAccount::regular($identifier,$instance)); |
|
| 85 | + public function defaultAccount($identifier, $instance=null) { |
|
| 86 | + return $this->addHtmlComponent(FormAccount::regular($identifier, $instance)); |
|
| 87 | 87 | } |
| 88 | 88 | } |