@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | protected function createItem($value) { |
| 20 | 20 | $count=$this->count(); |
| 21 | - $item=new HtmlListItem("item-" . $this->identifier . "-" . $count, $value); |
|
| 21 | + $item=new HtmlListItem("item-".$this->identifier."-".$count, $value); |
|
| 22 | 22 | return $item; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function addHeader($niveau, $content) { |
| 26 | - $header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page"); |
|
| 26 | + $header=new HtmlHeader("header-".$this->identifier, $niveau, $content, "page"); |
|
| 27 | 27 | $this->wrap($header); |
| 28 | 28 | return $header; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function getItemPart($index,$partName="header"){ |
|
| 31 | + public function getItemPart($index, $partName="header") { |
|
| 32 | 32 | return $this->getItem($index)->getPart($partName); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function asLink() { |
| 40 | - $this->addToPropertyCtrl("class", "link", array ("link" )); |
|
| 40 | + $this->addToPropertyCtrl("class", "link", array("link")); |
|
| 41 | 41 | return $this->contentAs("a"); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function run(JsUtils $js) { |
| 63 | - if ($this->_hasCheckedList === true) { |
|
| 64 | - $jsCode=include dirname(__FILE__) . '/../../components/jsTemplates/tplCheckedList.php'; |
|
| 65 | - $jsCode=\str_replace("%identifier%", "#" . $this->identifier, $jsCode); |
|
| 63 | + if ($this->_hasCheckedList===true) { |
|
| 64 | + $jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php'; |
|
| 65 | + $jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode); |
|
| 66 | 66 | $this->executeOnRun($jsCode); |
| 67 | 67 | } |
| 68 | 68 | return parent::run($js); |
@@ -86,24 +86,24 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function addCheckedList($items=array(), $masterItem=NULL, $values=array()) { |
| 88 | 88 | $count=$this->count(); |
| 89 | - $identifier=$this->identifier . "-" . $count; |
|
| 89 | + $identifier=$this->identifier."-".$count; |
|
| 90 | 90 | if (isset($masterItem)) { |
| 91 | - $masterO=new HtmlFormCheckbox("master-" . $identifier, $masterItem); |
|
| 91 | + $masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem); |
|
| 92 | 92 | $masterO->getHtmlCk()->addToProperty("class", "master"); |
| 93 | 93 | $masterO->setClass("item"); |
| 94 | 94 | $this->addItem($masterO); |
| 95 | 95 | } |
| 96 | - $fields=array (); |
|
| 96 | + $fields=array(); |
|
| 97 | 97 | $i=0; |
| 98 | - foreach ( $items as $val => $caption ) { |
|
| 99 | - $itemO=new HtmlFormCheckbox($identifier . "-" . $i++, $caption, $val, "child"); |
|
| 100 | - if (\array_search($val, $values) !== false) { |
|
| 98 | + foreach ($items as $val => $caption) { |
|
| 99 | + $itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child"); |
|
| 100 | + if (\array_search($val, $values)!==false) { |
|
| 101 | 101 | $itemO->getField()->setProperty("checked", ""); |
| 102 | 102 | } |
| 103 | 103 | $itemO->setClass("item"); |
| 104 | 104 | $fields[]=$itemO; |
| 105 | 105 | } |
| 106 | - if (isset($masterO) === true) { |
|
| 106 | + if (isset($masterO)===true) { |
|
| 107 | 107 | $list=new HtmlList("", $fields); |
| 108 | 108 | $list->setClass("list"); |
| 109 | 109 | $masterO->addContent($list); |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | use Ajax\semantic\traits\SemanticWidgetsTrait; |
| 12 | 12 | |
| 13 | 13 | class Semantic extends BaseGui { |
| 14 | - use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait, |
|
| 15 | - SemanticHtmlModulesTrait,SemanticHtmlViewsTrait,SemanticWidgetsTrait; |
|
| 14 | + use SemanticComponentsTrait, SemanticHtmlElementsTrait, SemanticHtmlCollectionsTrait, |
|
| 15 | + SemanticHtmlModulesTrait, SemanticHtmlViewsTrait, SemanticWidgetsTrait; |
|
| 16 | 16 | |
| 17 | 17 | private $language; |
| 18 | 18 | |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | - public function setLanguage($language){ |
|
| 25 | - if($language!==$this->language){ |
|
| 24 | + public function setLanguage($language) { |
|
| 25 | + if ($language!==$this->language) { |
|
| 26 | 26 | $file=\realpath(dirname(__FILE__)."/semantic/components/validation/languages/".$language.".js"); |
| 27 | - if(\file_exists($file)){ |
|
| 27 | + if (\file_exists($file)) { |
|
| 28 | 28 | $script=\file_get_contents($file); |
| 29 | - $this->js->exec($script,true); |
|
| 29 | + $this->js->exec($script, true); |
|
| 30 | 30 | $this->language=$language; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | trait JqueryActionsTrait { |
| 13 | - abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
|
| 13 | + abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true); |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Get or set the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element. |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param boolean $immediatly defers the execution if set to false |
| 39 | 39 | * @return string |
| 40 | 40 | */ |
| 41 | - public function after($element='this', $value='', $immediatly=false){ |
|
| 41 | + public function after($element='this', $value='', $immediatly=false) { |
|
| 42 | 42 | $element=Javascript::prep_element($element); |
| 43 | 43 | $value=Javascript::prep_value($value); |
| 44 | 44 | $str="$({$element}).after({$value});"; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $animations="\t\t\t"; |
| 65 | 65 | if (\is_array($params)) { |
| 66 | - foreach ( $params as $param => $value ) { |
|
| 66 | + foreach ($params as $param => $value) { |
|
| 67 | 67 | $animations.=$param.': \''.$value.'\', '; |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -356,8 +356,8 @@ discard block |
||
| 356 | 356 | * @param boolean $immediatly |
| 357 | 357 | * @return string |
| 358 | 358 | */ |
| 359 | - public function _doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="",$immediatly=true) { |
|
| 360 | - return $this->_add_event($element, $this->_doJQuery($elementToModify, $jqueryCall, $param, $jsCallback), $event, $preventDefault, $stopPropagation,$immediatly); |
|
| 359 | + public function _doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="", $immediatly=true) { |
|
| 360 | + return $this->_add_event($element, $this->_doJQuery($elementToModify, $jqueryCall, $param, $jsCallback), $event, $preventDefault, $stopPropagation, $immediatly); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
@@ -383,8 +383,8 @@ discard block |
||
| 383 | 383 | * @param boolean $immediatly |
| 384 | 384 | * @return String |
| 385 | 385 | */ |
| 386 | - public function _execOn($element, $event, $js, $preventDefault=false, $stopPropagation=false,$immediatly=true) { |
|
| 387 | - return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation,$immediatly); |
|
| 386 | + public function _execOn($element, $event, $js, $preventDefault=false, $stopPropagation=false, $immediatly=true) { |
|
| 387 | + return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation, $immediatly); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | /** |
@@ -393,8 +393,8 @@ discard block |
||
| 393 | 393 | * @return string |
| 394 | 394 | */ |
| 395 | 395 | private function _validate_speed($speed) { |
| 396 | - if (in_array($speed, array ( |
|
| 397 | - 'slow','normal','fast' |
|
| 396 | + if (in_array($speed, array( |
|
| 397 | + 'slow', 'normal', 'fast' |
|
| 398 | 398 | ))) { |
| 399 | 399 | $speed='"'.$speed.'"'; |
| 400 | 400 | } elseif (preg_match("/[^0-9]/", $speed)) { |
@@ -17,18 +17,18 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function __construct(JsUtils $js=NULL) { |
| 19 | 19 | parent::__construct($js); |
| 20 | - $this->events=array (); |
|
| 20 | + $this->events=array(); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | protected function compileEvents() { |
| 24 | - foreach ( $this->events as $event => $jsCode ) { |
|
| 25 | - if($event=="execute"){ |
|
| 24 | + foreach ($this->events as $event => $jsCode) { |
|
| 25 | + if ($event=="execute") { |
|
| 26 | 26 | $this->jquery_code_for_compile []=$jsCode; |
| 27 | - }else if($event=="beforeExecute"){ |
|
| 27 | + } else if ($event=="beforeExecute") { |
|
| 28 | 28 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
| 29 | - }else{ |
|
| 29 | + } else { |
|
| 30 | 30 | $selector=$this->attachTo; |
| 31 | - if(isset($this->itemSelector)){ |
|
| 31 | + if (isset($this->itemSelector)) { |
|
| 32 | 32 | $selector.=" ".$this->itemSelector; |
| 33 | 33 | } |
| 34 | 34 | $this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $result=implode("\n", $this->jquery_code_for_compile); |
| 41 | 41 | $result=str_ireplace("\"%", "", $result); |
| 42 | 42 | $result=str_ireplace("%\"", "", $result); |
| 43 | - $result=str_replace(array ( |
|
| 43 | + $result=str_replace(array( |
|
| 44 | 44 | "\\n", |
| 45 | 45 | "\\r", |
| 46 | 46 | "\\t" |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function getScript() { |
| 52 | 52 | $allParams=$this->params; |
| 53 | - $this->jquery_code_for_compile=array (); |
|
| 53 | + $this->jquery_code_for_compile=array(); |
|
| 54 | 54 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");"; |
| 55 | 55 | $this->compileEvents(); |
| 56 | 56 | return $this->compileJQueryCode(); |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | |
| 8 | 8 | class HtmlTextarea extends HtmlDoubleElement { |
| 9 | 9 | |
| 10 | - public function __construct($identifier,$value=NULL,$placeholder=NULL,$rows=NULL) { |
|
| 10 | + public function __construct($identifier, $value=NULL, $placeholder=NULL, $rows=NULL) { |
|
| 11 | 11 | parent::__construct($identifier, "textarea"); |
| 12 | 12 | $this->setProperty("name", $identifier); |
| 13 | 13 | $this->setValue($value); |
| 14 | 14 | $this->setPlaceholder($placeholder); |
| 15 | - if(isset($rows)) |
|
| 15 | + if (isset($rows)) |
|
| 16 | 16 | $this->setRows($rows); |
| 17 | 17 | } |
| 18 | 18 | public function setValue($value) { |
| 19 | - if(isset($value)) |
|
| 19 | + if (isset($value)) |
|
| 20 | 20 | $this->setContent($value); |
| 21 | 21 | return $this; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function setPlaceholder($value){ |
|
| 25 | - if(JString::isNotNull($value)) |
|
| 24 | + public function setPlaceholder($value) { |
|
| 25 | + if (JString::isNotNull($value)) |
|
| 26 | 26 | $this->setProperty("placeholder", $value); |
| 27 | 27 | return $this; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function setRows($count){ |
|
| 30 | + public function setRows($count) { |
|
| 31 | 31 | $this->setProperty("rows", $count); |
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | \ No newline at end of file |
@@ -10,14 +10,14 @@ discard block |
||
| 10 | 10 | use Ajax\semantic\html\base\traits\AttachedTrait; |
| 11 | 11 | |
| 12 | 12 | class HtmlHeader extends HtmlSemDoubleElement { |
| 13 | - use TextAlignmentTrait,AttachedTrait; |
|
| 13 | + use TextAlignmentTrait, AttachedTrait; |
|
| 14 | 14 | protected $image; |
| 15 | 15 | |
| 16 | 16 | public function __construct($identifier, $niveau=1, $content=NULL, $type="page") { |
| 17 | 17 | parent::__construct($identifier, "div", "ui header"); |
| 18 | 18 | $this->_template="<%tagName% %properties%>%image%%wrapContentBefore%%content%%wrapContentAfter%</%tagName%>"; |
| 19 | 19 | if (isset($type)) { |
| 20 | - if ($type == "page") { |
|
| 20 | + if ($type=="page") { |
|
| 21 | 21 | $this->asPageHeader($niveau); |
| 22 | 22 | } else |
| 23 | 23 | $this->asContentHeader($niveau); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function asPageHeader($niveau) { |
| 29 | - $this->tagName="h" . $niveau; |
|
| 29 | + $this->tagName="h".$niveau; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function asContentHeader($niveau) { |
@@ -39,25 +39,25 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function asIcon($icon, $title, $subHeader=NULL) { |
| 41 | 41 | $this->addToProperty("class", "icon"); |
| 42 | - $this->image=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
| 42 | + $this->image=new HtmlIcon("icon-".$this->identifier, $icon); |
|
| 43 | 43 | return $this->asTitle($title, $subHeader); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function asImage($src, $title, $subHeader=NULL) { |
| 47 | - $this->image=new HtmlImg("img-" . $this->identifier, $src, $title); |
|
| 47 | + $this->image=new HtmlImg("img-".$this->identifier, $src, $title); |
|
| 48 | 48 | return $this->asTitle($title, $subHeader); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function asTitle($title, $subHeader=NULL) { |
| 52 | 52 | if (!\is_object($title)) { |
| 53 | - $this->content=new HtmlDoubleElement("content-" . $this->identifier, "div"); |
|
| 53 | + $this->content=new HtmlDoubleElement("content-".$this->identifier, "div"); |
|
| 54 | 54 | $this->content->setContent($title); |
| 55 | 55 | } else { |
| 56 | 56 | $this->content=$title; |
| 57 | 57 | } |
| 58 | 58 | $this->content->setClass("content"); |
| 59 | 59 | if (isset($subHeader)) { |
| 60 | - $sub=new HtmlDoubleElement("subheader-" . $this->identifier, "div"); |
|
| 60 | + $sub=new HtmlDoubleElement("subheader-".$this->identifier, "div"); |
|
| 61 | 61 | $sub->setClass("sub header"); |
| 62 | 62 | $sub->setContent($subHeader); |
| 63 | 63 | $this->content->addContent($sub); |
@@ -7,20 +7,20 @@ discard block |
||
| 7 | 7 | use Ajax\semantic\html\base\constants\Sens; |
| 8 | 8 | use Ajax\JsUtils; |
| 9 | 9 | |
| 10 | -class HtmlSegmentGroups extends HtmlSemCollection{ |
|
| 10 | +class HtmlSegmentGroups extends HtmlSemCollection { |
|
| 11 | 11 | |
| 12 | 12 | |
| 13 | - public function __construct( $identifier, $items=array()){ |
|
| 14 | - parent::__construct( $identifier, "div","ui segments"); |
|
| 13 | + public function __construct($identifier, $items=array()) { |
|
| 14 | + parent::__construct($identifier, "div", "ui segments"); |
|
| 15 | 15 | $this->addItems($items); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | - protected function createItem($value){ |
|
| 20 | - return new HtmlSegment("segment-".$this->count(),$value); |
|
| 19 | + protected function createItem($value) { |
|
| 20 | + return new HtmlSegment("segment-".$this->count(), $value); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - protected function createCondition($value){ |
|
| 23 | + protected function createCondition($value) { |
|
| 24 | 24 | return !($value instanceof HtmlSegment); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -29,21 +29,21 @@ discard block |
||
| 29 | 29 | * @param string $type one of "raised","stacked","piled" default : "" |
| 30 | 30 | * @return \Ajax\semantic\html\elements\HtmlSegmentGroups |
| 31 | 31 | */ |
| 32 | - public function setType($type){ |
|
| 32 | + public function setType($type) { |
|
| 33 | 33 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function setSens($sens=Sens::VERTICAL){ |
|
| 36 | + public function setSens($sens=Sens::VERTICAL) { |
|
| 37 | 37 | return $this->addToPropertyCtrl("class", $sens, Sens::getConstants()); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function run(JsUtils $js){ |
|
| 41 | - $result= parent::run($js); |
|
| 40 | + public function run(JsUtils $js) { |
|
| 41 | + $result=parent::run($js); |
|
| 42 | 42 | return $result->setItemSelector(".ui.segment"); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){ |
|
| 46 | - $group=new HtmlSegmentGroups($identifier,$items); |
|
| 45 | + public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) { |
|
| 46 | + $group=new HtmlSegmentGroups($identifier, $items); |
|
| 47 | 47 | $group->setSens($sens); |
| 48 | 48 | return $group->setType($type); |
| 49 | 49 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $icon=JArray::getValue($value, "icon", 0); |
| 27 | 27 | $size=JArray::getValue($value, "size", 1); |
| 28 | 28 | } |
| 29 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
| 29 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
| 30 | 30 | if (isset($size)) { |
| 31 | 31 | $iconO->setSize($size); |
| 32 | 32 | } |
@@ -34,15 +34,15 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | protected function createCondition($value) { |
| 37 | - return ($value instanceof HtmlIcon) === false; |
|
| 37 | + return ($value instanceof HtmlIcon)===false; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function getIcon($index) { |
| 41 | 41 | return $this->content[$index]; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function run(JsUtils $js){ |
|
| 45 | - $result= parent::run($js); |
|
| 44 | + public function run(JsUtils $js) { |
|
| 45 | + $result=parent::run($js); |
|
| 46 | 46 | return $result->setItemSelector("i"); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | abstract class HtmlAbsractItem extends HtmlSemDoubleElement { |
| 13 | 13 | |
| 14 | - public function __construct($identifier, $baseClass,$content=NULL) { |
|
| 14 | + public function __construct($identifier, $baseClass, $content=NULL) { |
|
| 15 | 15 | parent::__construct($identifier, "div", $baseClass); |
| 16 | 16 | $this->content=array(); |
| 17 | 17 | $this->initContent($content); |
@@ -19,53 +19,53 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | abstract protected function initContent($content); |
| 21 | 21 | |
| 22 | - public function setIcon($icon){ |
|
| 22 | + public function setIcon($icon) { |
|
| 23 | 23 | $this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public function setImage($image){ |
|
| 26 | + public function setImage($image) { |
|
| 27 | 27 | $image=new HtmlImg("icon-".$this->identifier, $image); |
| 28 | 28 | $image->asAvatar(); |
| 29 | 29 | $this->content["image"]=$image; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - private function createContent(){ |
|
| 33 | - $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); |
|
| 32 | + private function createContent() { |
|
| 33 | + $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content"); |
|
| 34 | 34 | return $this->content["content"]; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public function setTitle($title,$description=NULL,$baseClass="title"){ |
|
| 38 | - $title=new HtmlSemDoubleElement("","div",$baseClass,$title); |
|
| 39 | - if(\array_key_exists("content", $this->content)===false){ |
|
| 37 | + public function setTitle($title, $description=NULL, $baseClass="title") { |
|
| 38 | + $title=new HtmlSemDoubleElement("", "div", $baseClass, $title); |
|
| 39 | + if (\array_key_exists("content", $this->content)===false) { |
|
| 40 | 40 | $this->createContent(); |
| 41 | 41 | } |
| 42 | 42 | $this->content["content"]->addContent($title); |
| 43 | - if(isset($description)){ |
|
| 44 | - $description=new HtmlSemDoubleElement("","div","description",$description); |
|
| 43 | + if (isset($description)) { |
|
| 44 | + $description=new HtmlSemDoubleElement("", "div", "description", $description); |
|
| 45 | 45 | $this->content["content"]->addContent($description); |
| 46 | 46 | } |
| 47 | 47 | return $this; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - public function getPart($partName="header"){ |
|
| 51 | - $content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"])); |
|
| 50 | + public function getPart($partName="header") { |
|
| 51 | + $content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"])); |
|
| 52 | 52 | return $this->getElementByPropertyValue("class", $partName, $content); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function setActive($value=true){ |
|
| 56 | - if($value){ |
|
| 55 | + public function setActive($value=true) { |
|
| 56 | + if ($value) { |
|
| 57 | 57 | $this->setTagName("div"); |
| 58 | 58 | $this->removeProperty("href"); |
| 59 | 59 | $this->addToPropertyCtrl("class", "active", array("active")); |
| 60 | - }else{ |
|
| 60 | + } else { |
|
| 61 | 61 | $this->removePropertyValue("class", "active"); |
| 62 | 62 | } |
| 63 | 63 | return $this; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public function asLink($href=NULL,$part=NULL){ |
|
| 66 | + public function asLink($href=NULL, $part=NULL) { |
|
| 67 | 67 | $this->setTagName("a"); |
| 68 | - if(isset($href)) |
|
| 68 | + if (isset($href)) |
|
| 69 | 69 | $this->setProperty("href", $href); |
| 70 | 70 | return $this; |
| 71 | 71 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 78 | 78 | */ |
| 79 | 79 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 80 | - if(\is_array($this->content) && JArray::isAssociative($this->content)) |
|
| 81 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
| 80 | + if (\is_array($this->content) && JArray::isAssociative($this->content)) |
|
| 81 | + $this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]); |
|
| 82 | 82 | return parent::compile($js, $view); |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | \ No newline at end of file |