@@ -27,15 +27,15 @@ discard block |
||
| 27 | 27 | return $this->content; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function addContent($content,$before=false) { |
|
| 30 | + public function addContent($content, $before=false) { |
|
| 31 | 31 | if (!\is_array($this->content)) { |
| 32 | - if(isset($this->content)) |
|
| 33 | - $this->content=array ($this->content); |
|
| 32 | + if (isset($this->content)) |
|
| 33 | + $this->content=array($this->content); |
|
| 34 | 34 | else |
| 35 | 35 | $this->content=array(); |
| 36 | 36 | } |
| 37 | - if($before) |
|
| 38 | - array_unshift($this->content,$content); |
|
| 37 | + if ($before) |
|
| 38 | + array_unshift($this->content, $content); |
|
| 39 | 39 | else |
| 40 | 40 | $this->content []=$content; |
| 41 | 41 | return $this; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if ($this->content instanceof HtmlDoubleElement) { |
| 51 | 51 | $this->content->run($js); |
| 52 | 52 | } else if (\is_array($this->content)) { |
| 53 | - foreach ( $this->content as $itemContent ) { |
|
| 53 | + foreach ($this->content as $itemContent) { |
|
| 54 | 54 | if ($itemContent instanceof HtmlDoubleElement) { |
| 55 | 55 | $itemContent->run($js); |
| 56 | 56 | } |
@@ -67,19 +67,19 @@ discard block |
||
| 67 | 67 | return $this; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function getContentInstances($class){ |
|
| 71 | - return $this->_getContentInstances($class,$this->content); |
|
| 70 | + public function getContentInstances($class) { |
|
| 71 | + return $this->_getContentInstances($class, $this->content); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - protected function _getContentInstances($class,$content){ |
|
| 74 | + protected function _getContentInstances($class, $content) { |
|
| 75 | 75 | $instances=[]; |
| 76 | - if($content instanceof $class){ |
|
| 76 | + if ($content instanceof $class) { |
|
| 77 | 77 | $instances[]=$content; |
| 78 | - }elseif($content instanceof HtmlDoubleElement){ |
|
| 79 | - $instances=\array_merge($instances,$content->getContentInstances($class)); |
|
| 80 | - }elseif (\is_array($content)){ |
|
| 81 | - foreach ($content as $element){ |
|
| 82 | - $instances=\array_merge($instances,$this->_getContentInstances($class, $element)); |
|
| 78 | + }elseif ($content instanceof HtmlDoubleElement) { |
|
| 79 | + $instances=\array_merge($instances, $content->getContentInstances($class)); |
|
| 80 | + }elseif (\is_array($content)) { |
|
| 81 | + foreach ($content as $element) { |
|
| 82 | + $instances=\array_merge($instances, $this->_getContentInstances($class, $element)); |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | return $instances; |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | class HtmlInput extends HtmlSingleElement { |
| 10 | 10 | protected $_placeholder; |
| 11 | - public function __construct($identifier,$type="text",$value=NULL,$placeholder=NULL) { |
|
| 11 | + public function __construct($identifier, $type="text", $value=NULL, $placeholder=NULL) { |
|
| 12 | 12 | parent::__construct($identifier, "input"); |
| 13 | 13 | $this->setProperty("name", $identifier); |
| 14 | 14 | $this->setValue($value); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function setValue($value) { |
| 20 | - if(isset($value)) |
|
| 20 | + if (isset($value)) |
|
| 21 | 21 | $this->setProperty("value", $value); |
| 22 | 22 | return $this; |
| 23 | 23 | } |
@@ -26,19 +26,19 @@ discard block |
||
| 26 | 26 | return $this->setProperty("type", $value); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function setPlaceholder($value){ |
|
| 30 | - if(JString::isNotNull($value)) |
|
| 29 | + public function setPlaceholder($value) { |
|
| 30 | + if (JString::isNotNull($value)) |
|
| 31 | 31 | $this->_placeholder=$value; |
| 32 | 32 | return $this; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function compile(JsUtils $js=NULL,&$view=NULL){ |
|
| 35 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
| 36 | 36 | $value=$this->_placeholder; |
| 37 | - if(JString::isNull($value)){ |
|
| 38 | - if(JString::isNotNull($this->getProperty("name"))) |
|
| 37 | + if (JString::isNull($value)) { |
|
| 38 | + if (JString::isNotNull($this->getProperty("name"))) |
|
| 39 | 39 | $value=\ucfirst($this->getProperty("name")); |
| 40 | 40 | } |
| 41 | 41 | $this->setProperty("placeholder", $value); |
| 42 | - return parent::compile($js,$view); |
|
| 42 | + return parent::compile($js, $view); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file |
@@ -16,6 +16,6 @@ |
||
| 16 | 16 | if (isset($toElement)) { |
| 17 | 17 | $toElement->setAttached(true); |
| 18 | 18 | } |
| 19 | - return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached")); |
|
| 19 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Ajax\semantic\html\collections\table\traits; |
| 3 | 3 | |
| 4 | -trait TableTrait{ |
|
| 4 | +trait TableTrait { |
|
| 5 | 5 | /** |
| 6 | 6 | * @return HtmlTable |
| 7 | 7 | */ |
| 8 | 8 | abstract protected function getTable(); |
| 9 | 9 | |
| 10 | - protected function addToPropertyTable($property,$value){ |
|
| 10 | + protected function addToPropertyTable($property, $value) { |
|
| 11 | 11 | return $this->getTable()->addToProperty($property, $value); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -18,15 +18,15 @@ discard block |
||
| 18 | 18 | public function setBasic($very=false) { |
| 19 | 19 | $table=$this->getTable(); |
| 20 | 20 | if ($very) |
| 21 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 22 | - return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
|
| 21 | + $table->addToPropertyCtrl("class", "very", array("very")); |
|
| 22 | + return $table->addToPropertyCtrl("class", "basic", array("basic")); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function setCompact($very=false) { |
| 26 | 26 | $table=$this->getTable(); |
| 27 | 27 | if ($very) |
| 28 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 29 | - return $table->addToPropertyCtrl("class", "compact", array ("compact" )); |
|
| 28 | + $table->addToPropertyCtrl("class", "very", array("very")); |
|
| 29 | + return $table->addToPropertyCtrl("class", "compact", array("compact")); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function setCollapsing() { |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | public static $preventDefault="\nif(event && event.preventDefault) event.preventDefault();\n"; |
| 7 | 7 | public static $stopPropagation="\nif(event && event.stopPropagation) event.stopPropagation();\n"; |
| 8 | 8 | |
| 9 | - public static function containsCode($expression){ |
|
| 10 | - return strrpos($expression, 'this')!==false||strrpos($expression, 'event')!==false||strrpos($expression, 'self')!==false; |
|
| 9 | + public static function containsCode($expression) { |
|
| 10 | + return strrpos($expression, 'this')!==false || strrpos($expression, 'event')!==false || strrpos($expression, 'self')!==false; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | /** |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | * @return \Ajax\semantic\html\collections\HtmlMenu |
| 41 | 41 | */ |
| 42 | 42 | public function setType($type="") { |
| 43 | - return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
|
| 43 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function setActiveItem($index) { |
| 47 | 47 | $item=$this->getItem($index); |
| 48 | - if ($item !== null) { |
|
| 48 | + if ($item!==null) { |
|
| 49 | 49 | $item->addToProperty("class", "active"); |
| 50 | 50 | } |
| 51 | 51 | return $this; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | private function getItemToInsert($item) { |
| 55 | 55 | if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButtonGroups || $item instanceof HtmlButton || $item instanceof HtmlLabel) { |
| 56 | - $itemO=new HtmlMenuItem("item-" . $this->identifier . "-" . \sizeof($this->content) , $item); |
|
| 56 | + $itemO=new HtmlMenuItem("item-".$this->identifier."-".\sizeof($this->content), $item); |
|
| 57 | 57 | $item=$itemO; |
| 58 | 58 | } |
| 59 | 59 | return $item; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | private function afterInsert($item) { |
| 63 | 63 | if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
| 64 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 64 | + $item->addToPropertyCtrl("class", "item", array("item")); |
|
| 65 | 65 | else { |
| 66 | 66 | $this->setSecondary(); |
| 67 | 67 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function addItem($item) { |
| 78 | 78 | $number=$item; |
| 79 | 79 | $item=parent::addItem($this->getItemToInsert($item)); |
| 80 | - if(\is_int($number)) |
|
| 80 | + if (\is_int($number)) |
|
| 81 | 81 | $item->setProperty("data-page", $number); |
| 82 | 82 | return $this->afterInsert($item); |
| 83 | 83 | } |
@@ -95,15 +95,15 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | public function generateMenuAsItem($menu, $header=null) { |
| 97 | 97 | $count=$this->count(); |
| 98 | - $item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div"); |
|
| 98 | + $item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div"); |
|
| 99 | 99 | if (isset($header)) { |
| 100 | - $headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header"); |
|
| 100 | + $headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header"); |
|
| 101 | 101 | $headerItem->setContent($header); |
| 102 | 102 | $item->addContent($headerItem); |
| 103 | 103 | $this->_itemHeader=$headerItem; |
| 104 | 104 | } |
| 105 | - if(\is_array($menu)){ |
|
| 106 | - $menu=new HtmlMenu("menu-" . $this->identifier . "-" . $count,$menu); |
|
| 105 | + if (\is_array($menu)) { |
|
| 106 | + $menu=new HtmlMenu("menu-".$this->identifier."-".$count, $menu); |
|
| 107 | 107 | } |
| 108 | 108 | $menu->setClass("menu"); |
| 109 | 109 | $item->addContent($menu); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value); |
| 119 | 119 | $value->addContent(new HtmlIcon("", "dropdown")); |
| 120 | 120 | $value=$this->addItem($value); |
| 121 | - $popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content); |
|
| 121 | + $popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content); |
|
| 122 | 122 | $popup->setFlowing()->setPosition("bottom left")->setOn("click"); |
| 123 | 123 | $this->wrap("", $popup); |
| 124 | 124 | return $popup; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | public function addDropdownAsItem($value, $items=NULL) { |
| 128 | 128 | $dd=$value; |
| 129 | 129 | if (\is_string($value)) { |
| 130 | - $dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items); |
|
| 130 | + $dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items); |
|
| 131 | 131 | } |
| 132 | 132 | $this->addItem($dd); |
| 133 | 133 | return $dd; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
| 141 | 141 | */ |
| 142 | 142 | protected function createItem($value) { |
| 143 | - $itemO=new HtmlMenuItem($this->identifier."-item-" . \sizeof($this->content),""); |
|
| 143 | + $itemO=new HtmlMenuItem($this->identifier."-item-".\sizeof($this->content), ""); |
|
| 144 | 144 | $itemO->setTagName("a"); |
| 145 | 145 | $itemO->setContent($value); |
| 146 | 146 | return $itemO; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | public function setSecondary($value=true) { |
| 154 | - if($value) |
|
| 154 | + if ($value) |
|
| 155 | 155 | $this->addToProperty("class", "secondary"); |
| 156 | 156 | else |
| 157 | 157 | $this->removePropertyValue("class", "secondary"); |
@@ -159,28 +159,28 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | public function setVertical() { |
| 162 | - return $this->addToPropertyCtrl("class", "vertical", array ("vertical" )); |
|
| 162 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | public function setPosition($value="right") { |
| 166 | - return $this->addToPropertyCtrl("class", $value, array ("right","left" )); |
|
| 166 | + return $this->addToPropertyCtrl("class", $value, array("right", "left")); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | public function setPointing($value=Direction::NONE) { |
| 170 | - return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing")); |
|
| 170 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | public function asTab($vertical=false) { |
| 174 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
| 174 | + $this->apply(function(HtmlDoubleElement&$item) { |
|
| 175 | 175 | $item->setTagName("a"); |
| 176 | 176 | }); |
| 177 | - if ($vertical === true) |
|
| 177 | + if ($vertical===true) |
|
| 178 | 178 | $this->setVertical(); |
| 179 | 179 | return $this->addToProperty("class", "tabular"); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | public function asPagination() { |
| 183 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
| 183 | + $this->apply(function(HtmlDoubleElement&$item) { |
|
| 184 | 184 | $item->setTagName("a"); |
| 185 | 185 | }); |
| 186 | 186 | return $this->addToProperty("class", "pagination"); |
@@ -217,10 +217,10 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function setWidth($width) { |
| 219 | 219 | if (\is_int($width)) { |
| 220 | - $width=Wide::getConstants()["W" . $width]; |
|
| 220 | + $width=Wide::getConstants()["W".$width]; |
|
| 221 | 221 | } |
| 222 | 222 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
| 223 | - return $this->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 223 | + return $this->addToPropertyCtrl("class", "item", array("item")); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | public function addImage($identifier, $src="", $alt="") { |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | return $this->_itemHeader; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - public function run(JsUtils $js){ |
|
| 239 | - $result= parent::run($js); |
|
| 238 | + public function run(JsUtils $js) { |
|
| 239 | + $result=parent::run($js); |
|
| 240 | 240 | return $result->setItemSelector(".item"); |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | public function setClass($classNames) { |
| 16 | - if(\is_array($classNames)){ |
|
| 16 | + if (\is_array($classNames)) { |
|
| 17 | 17 | $classNames=implode(" ", $classNames); |
| 18 | 18 | } |
| 19 | 19 | $this->setProperty("class", $classNames); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | public function addClass($classNames) { |
| 24 | - if(\is_array($classNames)){ |
|
| 24 | + if (\is_array($classNames)) { |
|
| 25 | 25 | $classNames=implode(" ", $classNames); |
| 26 | 26 | } |
| 27 | 27 | $this->addToProperty("class", $classNames); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function fromArray($array) { |
| 54 | 54 | $array=parent::fromArray($array); |
| 55 | - foreach ( $array as $key => $value ) { |
|
| 55 | + foreach ($array as $key => $value) { |
|
| 56 | 56 | $this->setProperty($key, $value); |
| 57 | 57 | } |
| 58 | 58 | return $array; |
@@ -8,12 +8,12 @@ discard block |
||
| 8 | 8 | * @author jc |
| 9 | 9 | * |
| 10 | 10 | */ |
| 11 | -trait BaseHtmlPropertiesTrait{ |
|
| 11 | +trait BaseHtmlPropertiesTrait { |
|
| 12 | 12 | |
| 13 | - protected $properties=array (); |
|
| 13 | + protected $properties=array(); |
|
| 14 | 14 | abstract protected function ctrl($name, $value, $typeCtrl); |
| 15 | 15 | abstract protected function removeOldValues(&$oldValue, $allValues); |
| 16 | - abstract protected function _getElementBy($callback,$elements); |
|
| 16 | + abstract protected function _getElementBy($callback, $elements); |
|
| 17 | 17 | public function getProperties() { |
| 18 | 18 | return $this->properties; |
| 19 | 19 | } |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function addToProperty($name, $value, $separator=" ") { |
| 41 | 41 | if (\is_array($value)) { |
| 42 | - foreach ( $value as $v ) { |
|
| 42 | + foreach ($value as $v) { |
|
| 43 | 43 | $this->addToProperty($name, $v, $separator); |
| 44 | 44 | } |
| 45 | - } else if ($value !== "" && $this->propertyContains($name, $value) === false) { |
|
| 45 | + } else if ($value!=="" && $this->propertyContains($name, $value)===false) { |
|
| 46 | 46 | $v=@$this->properties[$name]; |
| 47 | - if (isset($v) && $v !== "") |
|
| 48 | - $v=$v . $separator . $value; |
|
| 47 | + if (isset($v) && $v!=="") |
|
| 48 | + $v=$v.$separator.$value; |
|
| 49 | 49 | else |
| 50 | 50 | $v=$value; |
| 51 | 51 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | public function addToPropertyCtrlCheck($name, $value, $typeCtrl) { |
| 86 | - if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
| 86 | + if ($this->ctrl($name, $value, $typeCtrl)===true) { |
|
| 87 | 87 | return $this->addToProperty($name, $value); |
| 88 | 88 | } |
| 89 | 89 | return $this; |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 107 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
| 107 | + if ($this->ctrl($name, $value, $typeCtrl)===true) |
|
| 108 | 108 | return $this->setProperty($name, $value); |
| 109 | 109 | return $this; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - protected function getElementByPropertyValue($propertyName,$value, $elements) { |
|
| 113 | - return $this->_getElementBy(function($element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements); |
|
| 112 | + protected function getElementByPropertyValue($propertyName, $value, $elements) { |
|
| 113 | + return $this->_getElementBy(function($element) use ($propertyName, $value){return $element->propertyContains($propertyName, $value)===true; }, $elements); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | \ No newline at end of file |
@@ -14,64 +14,64 @@ |
||
| 14 | 14 | protected $params; |
| 15 | 15 | protected $semElement; |
| 16 | 16 | |
| 17 | - public function __construct($semElement,$title="",$content="",$variation=NULL,$params=array()){ |
|
| 17 | + public function __construct($semElement, $title="", $content="", $variation=NULL, $params=array()) { |
|
| 18 | 18 | $this->semElement=$semElement; |
| 19 | 19 | $this->title=$title; |
| 20 | 20 | $this->content=$content; |
| 21 | - $this->setAttributes($variation,$params); |
|
| 21 | + $this->setAttributes($variation, $params); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function setHtml($html) { |
| 25 | - $this->html= $html; |
|
| 25 | + $this->html=$html; |
|
| 26 | 26 | return $this; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function setAttributes($variation=NULL,$params=array()){ |
|
| 29 | + public function setAttributes($variation=NULL, $params=array()) { |
|
| 30 | 30 | $this->variation=$variation; |
| 31 | 31 | $this->params=$params; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function onShow($jsCode){ |
|
| 34 | + public function onShow($jsCode) { |
|
| 35 | 35 | $this->params["onShow"]=$jsCode; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function compile(JsUtils $js=NULL){ |
|
| 39 | - if(JString::isNotNull($this->title)){ |
|
| 38 | + public function compile(JsUtils $js=NULL) { |
|
| 39 | + if (JString::isNotNull($this->title)) { |
|
| 40 | 40 | $this->semElement->addToProperty("data-title", $this->title); |
| 41 | 41 | } |
| 42 | - if(JString::isNotNull($this->content)){ |
|
| 42 | + if (JString::isNotNull($this->content)) { |
|
| 43 | 43 | $this->semElement->addToProperty("data-content", $this->content); |
| 44 | 44 | } |
| 45 | 45 | $this->_compileHtml($js); |
| 46 | - if(JString::isNotNull($this->variation)){ |
|
| 46 | + if (JString::isNotNull($this->variation)) { |
|
| 47 | 47 | $this->semElement->addToProperty("data-variation", $this->variation); |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - private function _compileHtml(JsUtils $js=NULL){ |
|
| 52 | - if(JString::isNotNull($this->html)){ |
|
| 51 | + private function _compileHtml(JsUtils $js=NULL) { |
|
| 52 | + if (JString::isNotNull($this->html)) { |
|
| 53 | 53 | $html=$this->html; |
| 54 | - if(\is_array($html)){ |
|
| 54 | + if (\is_array($html)) { |
|
| 55 | 55 | \array_walk($html, function(&$item) use($js){ |
| 56 | - if($item instanceof HtmlSemDoubleElement){ |
|
| 56 | + if ($item instanceof HtmlSemDoubleElement) { |
|
| 57 | 57 | $comp=$item->compile($js); |
| 58 | - if(isset($js)){ |
|
| 58 | + if (isset($js)) { |
|
| 59 | 59 | $bs=$item->run($js); |
| 60 | - if(isset($bs)) |
|
| 60 | + if (isset($bs)) |
|
| 61 | 61 | $this->params['onShow']=$bs->getScript(); |
| 62 | 62 | } |
| 63 | 63 | $item=$comp; |
| 64 | 64 | } |
| 65 | 65 | }); |
| 66 | - $html=\implode("",$html); |
|
| 66 | + $html=\implode("", $html); |
|
| 67 | 67 | } |
| 68 | 68 | $html=\str_replace("\"", "'", $html); |
| 69 | 69 | $this->semElement->addToProperty("data-html", $html); |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function run(JsUtils $js){ |
|
| 74 | - $js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params); |
|
| 73 | + public function run(JsUtils $js) { |
|
| 74 | + $js->semantic()->popup("#".$this->semElement->getIdentifier(), $this->params); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | } |
| 78 | 78 | \ No newline at end of file |