@@ -14,19 +14,19 @@ discard block |
||
| 14 | 14 | * @property boolean $_visibleHover |
| 15 | 15 | * @property InstanceViewer $_instanceViewer |
| 16 | 16 | */ |
| 17 | -trait DataTableFieldAsTrait{ |
|
| 17 | +trait DataTableFieldAsTrait { |
|
| 18 | 18 | abstract public function addField($field); |
| 19 | - abstract public function insertField($index,$field); |
|
| 20 | - abstract public function insertInField($index,$field); |
|
| 21 | - abstract public function fieldAs($index,$type,$attributes=NULL); |
|
| 19 | + abstract public function insertField($index, $field); |
|
| 20 | + abstract public function insertInField($index, $field); |
|
| 21 | + abstract public function fieldAs($index, $type, $attributes=NULL); |
|
| 22 | 22 | /** |
| 23 | 23 | * @param string $caption |
| 24 | 24 | * @param callable $callback |
| 25 | 25 | * @param boolean $visibleHover |
| 26 | 26 | * @return callable |
| 27 | 27 | */ |
| 28 | - private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
|
| 29 | - return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
|
| 28 | + private function getFieldButtonCallable($caption, $visibleHover=true, $callback=null) { |
|
| 29 | + return $this->getCallable("getFieldButton", [$caption, $visibleHover], $callback); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -35,20 +35,20 @@ discard block |
||
| 35 | 35 | * @param callable $callback |
| 36 | 36 | * @return callable |
| 37 | 37 | */ |
| 38 | - private function getCallable($thisCallback,$parameters,$callback=null){ |
|
| 39 | - $result=function($instance) use($thisCallback,$parameters,$callback){ |
|
| 40 | - $object=call_user_func_array(array($this,$thisCallback), $parameters); |
|
| 41 | - if(isset($callback)){ |
|
| 42 | - if(\is_callable($callback)){ |
|
| 43 | - $callback($object,$instance,$this->_instanceViewer->count()+1); |
|
| 38 | + private function getCallable($thisCallback, $parameters, $callback=null) { |
|
| 39 | + $result=function($instance) use($thisCallback, $parameters, $callback){ |
|
| 40 | + $object=call_user_func_array(array($this, $thisCallback), $parameters); |
|
| 41 | + if (isset($callback)) { |
|
| 42 | + if (\is_callable($callback)) { |
|
| 43 | + $callback($object, $instance, $this->_instanceViewer->count()+1); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - if($object instanceof HtmlSemDoubleElement){ |
|
| 46 | + if ($object instanceof HtmlSemDoubleElement) { |
|
| 47 | 47 | $id=$this->_instanceViewer->getIdentifier(); |
| 48 | - $object->setProperty("data-ajax",$id); |
|
| 49 | - if($object->propertyContains("class","visibleover")){ |
|
| 48 | + $object->setProperty("data-ajax", $id); |
|
| 49 | + if ($object->propertyContains("class", "visibleover")) { |
|
| 50 | 50 | $this->_visibleHover=true; |
| 51 | - $object->setProperty("style","visibility:hidden;"); |
|
| 51 | + $object->setProperty("style", "visibility:hidden;"); |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | return $object; |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | * @param string $caption |
| 61 | 61 | * @return HtmlButton |
| 62 | 62 | */ |
| 63 | - private function getFieldButton($caption,$visibleHover=true){ |
|
| 64 | - $bt= new HtmlButton($this->cleanIdentifier($caption),$caption); |
|
| 65 | - if($visibleHover) |
|
| 63 | + private function getFieldButton($caption, $visibleHover=true) { |
|
| 64 | + $bt=new HtmlButton($this->cleanIdentifier($caption), $caption); |
|
| 65 | + if ($visibleHover) |
|
| 66 | 66 | $this->_visibleOver($bt); |
| 67 | 67 | return $bt; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - private function getFieldButtons($buttons,$visibleHover=true){ |
|
| 71 | - $bts=new HtmlButtonGroups("",$buttons); |
|
| 72 | - if($visibleHover) |
|
| 70 | + private function getFieldButtons($buttons, $visibleHover=true) { |
|
| 71 | + $bts=new HtmlButtonGroups("", $buttons); |
|
| 72 | + if ($visibleHover) |
|
| 73 | 73 | $this->_visibleOver($bts); |
| 74 | 74 | return $bts; |
| 75 | 75 | } |
@@ -83,19 +83,19 @@ discard block |
||
| 83 | 83 | * @param array $attributes associative array (<b>ajax</b> key is for ajax post) |
| 84 | 84 | * @return DataTable |
| 85 | 85 | */ |
| 86 | - public function fieldAsSubmit($index,$cssStyle=NULL,$url=NULL,$responseElement=NULL,$attributes=NULL){ |
|
| 87 | - return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$index,$attributes){ |
|
| 88 | - $button=new HtmlButton($id,$value,$cssStyle); |
|
| 89 | - $button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]); |
|
| 90 | - if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) |
|
| 86 | + public function fieldAsSubmit($index, $cssStyle=NULL, $url=NULL, $responseElement=NULL, $attributes=NULL) { |
|
| 87 | + return $this->_fieldAs(function($id, $name, $value, $caption) use ($url, $responseElement, $cssStyle, $index, $attributes){ |
|
| 88 | + $button=new HtmlButton($id, $value, $cssStyle); |
|
| 89 | + $button->postOnClick($url, "$(event.target).closest('tr').find(':input').serialize()", $responseElement, $attributes["ajax"]); |
|
| 90 | + if (!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) |
|
| 91 | 91 | $this->_visibleOver($button); |
| 92 | 92 | return $button; |
| 93 | - }, $index,$attributes); |
|
| 93 | + }, $index, $attributes); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - protected function _visibleOver(BaseHtml $element){ |
|
| 96 | + protected function _visibleOver(BaseHtml $element) { |
|
| 97 | 97 | $this->_visibleHover=true; |
| 98 | - return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;"); |
|
| 98 | + return $element->addToProperty("class", "visibleover")->setProperty("style", "visibility:hidden;"); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | * @param boolean $visibleHover |
| 106 | 106 | * @return DataTable |
| 107 | 107 | */ |
| 108 | - public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
|
| 109 | - $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
|
| 108 | + public function addFieldButton($caption, $visibleHover=true, $callback=null) { |
|
| 109 | + $this->addField($this->getCallable("getFieldButton", [$caption, $visibleHover], $callback)); |
|
| 110 | 110 | return $this; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | * @param boolean $visibleHover |
| 118 | 118 | * @return DataTable |
| 119 | 119 | */ |
| 120 | - public function addFieldButtons($buttons,$visibleHover=true,$callback=null){ |
|
| 121 | - $this->addField($this->getCallable("getFieldButtons",[$buttons,$visibleHover],$callback)); |
|
| 120 | + public function addFieldButtons($buttons, $visibleHover=true, $callback=null) { |
|
| 121 | + $this->addField($this->getCallable("getFieldButtons", [$buttons, $visibleHover], $callback)); |
|
| 122 | 122 | return $this; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | * @param callable $callback |
| 130 | 130 | * @return DataTable |
| 131 | 131 | */ |
| 132 | - public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
|
| 133 | - $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
|
| 132 | + public function insertFieldButton($index, $caption, $visibleHover=true, $callback=null) { |
|
| 133 | + $this->insertField($index, $this->getFieldButtonCallable($caption, $visibleHover, $callback)); |
|
| 134 | 134 | return $this; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -141,25 +141,25 @@ discard block |
||
| 141 | 141 | * @param callable $callback |
| 142 | 142 | * @return DataTable |
| 143 | 143 | */ |
| 144 | - public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
|
| 145 | - $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
|
| 144 | + public function insertInFieldButton($index, $caption, $visibleHover=true, $callback=null) { |
|
| 145 | + $this->insertInField($index, $this->getFieldButtonCallable($caption, $visibleHover, $callback)); |
|
| 146 | 146 | return $this; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
|
| 150 | - $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
|
| 149 | + private function addDefaultButton($icon, $class=null, $visibleHover=true, $callback=null) { |
|
| 150 | + $this->addField($this->getCallable("getDefaultButton", [$icon, $class, $visibleHover], $callback)); |
|
| 151 | 151 | return $this; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
|
| 155 | - $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
|
| 154 | + private function insertDefaultButtonIn($index, $icon, $class=null, $visibleHover=true, $callback=null) { |
|
| 155 | + $this->insertInField($index, $this->getCallable("getDefaultButton", [$icon, $class, $visibleHover], $callback)); |
|
| 156 | 156 | return $this; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - private function getDefaultButton($icon,$class=null,$visibleHover=true){ |
|
| 160 | - $bt=$this->getFieldButton("",$visibleHover); |
|
| 159 | + private function getDefaultButton($icon, $class=null, $visibleHover=true) { |
|
| 160 | + $bt=$this->getFieldButton("", $visibleHover); |
|
| 161 | 161 | $bt->asIcon($icon); |
| 162 | - if(isset($class)) |
|
| 162 | + if (isset($class)) |
|
| 163 | 163 | $bt->addClass($class); |
| 164 | 164 | return $bt; |
| 165 | 165 | } |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
| 172 | 172 | * @return DataTable |
| 173 | 173 | */ |
| 174 | - public function addDeleteButton($visibleHover=true,$deleteBehavior=[],$callback=null){ |
|
| 174 | + public function addDeleteButton($visibleHover=true, $deleteBehavior=[], $callback=null) { |
|
| 175 | 175 | $this->_deleteBehavior=$deleteBehavior; |
| 176 | - return $this->addDefaultButton("remove","_delete red basic",$visibleHover,$callback); |
|
| 176 | + return $this->addDefaultButton("remove", "_delete red basic", $visibleHover, $callback); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
| 184 | 184 | * @return DataTable |
| 185 | 185 | */ |
| 186 | - public function addEditButton($visibleHover=true,$editBehavior=[],$callback=null){ |
|
| 186 | + public function addEditButton($visibleHover=true, $editBehavior=[], $callback=null) { |
|
| 187 | 187 | $this->_editBehavior=$editBehavior; |
| 188 | - return $this->addDefaultButton("edit","_edit basic",$visibleHover,$callback); |
|
| 188 | + return $this->addDefaultButton("edit", "_edit basic", $visibleHover, $callback); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -196,20 +196,20 @@ discard block |
||
| 196 | 196 | * @param callable $callbackDelete this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
| 197 | 197 | * @return DataTable |
| 198 | 198 | */ |
| 199 | - public function addEditDeleteButtons($visibleHover=true,$behavior=[],$callbackEdit=null,$callbackDelete=null){ |
|
| 200 | - $this->addEditButton($visibleHover,$behavior,$callbackEdit); |
|
| 199 | + public function addEditDeleteButtons($visibleHover=true, $behavior=[], $callbackEdit=null, $callbackDelete=null) { |
|
| 200 | + $this->addEditButton($visibleHover, $behavior, $callbackEdit); |
|
| 201 | 201 | $index=$this->_instanceViewer->visiblePropertiesCount()-1; |
| 202 | - $this->insertDeleteButtonIn($index,$visibleHover,$behavior,$callbackDelete); |
|
| 202 | + $this->insertDeleteButtonIn($index, $visibleHover, $behavior, $callbackDelete); |
|
| 203 | 203 | return $this; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - public function insertDeleteButtonIn($index,$visibleHover=true,$deleteBehavior=[],$callback=null){ |
|
| 206 | + public function insertDeleteButtonIn($index, $visibleHover=true, $deleteBehavior=[], $callback=null) { |
|
| 207 | 207 | $this->_deleteBehavior=$deleteBehavior; |
| 208 | - return $this->insertDefaultButtonIn($index,"remove","_delete red basic",$visibleHover,$callback); |
|
| 208 | + return $this->insertDefaultButtonIn($index, "remove", "_delete red basic", $visibleHover, $callback); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - public function insertEditButtonIn($index,$visibleHover=true,$editBehavior=[],$callback=null){ |
|
| 211 | + public function insertEditButtonIn($index, $visibleHover=true, $editBehavior=[], $callback=null) { |
|
| 212 | 212 | $this->_editBehavior=$editBehavior; |
| 213 | - return $this->insertDefaultButtonIn($index,"edit","_edit basic",$visibleHover,$callback); |
|
| 213 | + return $this->insertDefaultButtonIn($index, "edit", "_edit basic", $visibleHover, $callback); |
|
| 214 | 214 | } |
| 215 | 215 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | */ |
| 26 | 26 | class DataTable extends Widget { |
| 27 | - use TableTrait,DataTableFieldAsTrait,HasCheckboxesTrait,BaseTrait; |
|
| 27 | + use TableTrait, DataTableFieldAsTrait, HasCheckboxesTrait, BaseTrait; |
|
| 28 | 28 | protected $_searchField; |
| 29 | 29 | protected $_urls; |
| 30 | 30 | protected $_pagination; |
@@ -42,35 +42,35 @@ discard block |
||
| 42 | 42 | protected $_colWidths; |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - public function __construct($identifier,$model,$modelInstance=NULL) { |
|
| 46 | - parent::__construct($identifier, $model,$modelInstance); |
|
| 47 | - $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0,0), false); |
|
| 45 | + public function __construct($identifier, $model, $modelInstance=NULL) { |
|
| 46 | + parent::__construct($identifier, $model, $modelInstance); |
|
| 47 | + $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0, 0), false); |
|
| 48 | 48 | $this->_urls=[]; |
| 49 | - $this->_emptyMessage=new HtmlMessage("","nothing to display"); |
|
| 49 | + $this->_emptyMessage=new HtmlMessage("", "nothing to display"); |
|
| 50 | 50 | $this->_emptyMessage->setIcon("info circle"); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function run(JsUtils $js){ |
|
| 54 | - if($this->_hasCheckboxes && isset($js)){ |
|
| 53 | + public function run(JsUtils $js) { |
|
| 54 | + if ($this->_hasCheckboxes && isset($js)) { |
|
| 55 | 55 | $this->_runCheckboxes($js); |
| 56 | 56 | } |
| 57 | - if($this->_visibleHover){ |
|
| 58 | - $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
|
| 59 | - $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
|
| 57 | + if ($this->_visibleHover) { |
|
| 58 | + $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');", ["preventDefault"=>false, "stopPropagation"=>true]); |
|
| 59 | + $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');", ["preventDefault"=>false, "stopPropagation"=>true]); |
|
| 60 | 60 | } |
| 61 | - if(\is_array($this->_deleteBehavior)) |
|
| 62 | - $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
| 63 | - if(\is_array($this->_editBehavior)) |
|
| 64 | - $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
| 61 | + if (\is_array($this->_deleteBehavior)) |
|
| 62 | + $this->_generateBehavior("delete", $this->_deleteBehavior, $js); |
|
| 63 | + if (\is_array($this->_editBehavior)) |
|
| 64 | + $this->_generateBehavior("edit", $this->_editBehavior, $js); |
|
| 65 | 65 | return parent::run($js); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - protected function _generateBehavior($op,$params,JsUtils $js){ |
|
| 71 | - if(isset($this->_urls[$op])){ |
|
| 72 | - $params=\array_merge($params,["attr"=>"data-ajax"]); |
|
| 73 | - $js->ajaxOnClick("#".$this->identifier." ._".$op, $this->_urls[$op],$this->getTargetSelector($op),$params); |
|
| 70 | + protected function _generateBehavior($op, $params, JsUtils $js) { |
|
| 71 | + if (isset($this->_urls[$op])) { |
|
| 72 | + $params=\array_merge($params, ["attr"=>"data-ajax"]); |
|
| 73 | + $js->ajaxOnClick("#".$this->identifier." ._".$op, $this->_urls[$op], $this->getTargetSelector($op), $params); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -83,158 +83,158 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| 86 | - public function compile(JsUtils $js=NULL,&$view=NULL){ |
|
| 87 | - if(!$this->_generated){ |
|
| 86 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
| 87 | + if (!$this->_generated) { |
|
| 88 | 88 | $this->_instanceViewer->setInstance($this->_model); |
| 89 | 89 | $captions=$this->_instanceViewer->getCaptions(); |
| 90 | 90 | $table=$this->content["table"]; |
| 91 | - if($this->_hasCheckboxes){ |
|
| 91 | + if ($this->_hasCheckboxes) { |
|
| 92 | 92 | $this->_generateMainCheckbox($captions); |
| 93 | 93 | } |
| 94 | 94 | $table->setRowCount(0, \sizeof($captions)); |
| 95 | - $this->_generateHeader($table,$captions); |
|
| 95 | + $this->_generateHeader($table, $captions); |
|
| 96 | 96 | |
| 97 | - if(isset($this->_compileParts)) |
|
| 97 | + if (isset($this->_compileParts)) |
|
| 98 | 98 | $table->setCompileParts($this->_compileParts); |
| 99 | 99 | |
| 100 | 100 | $this->_generateContent($table); |
| 101 | 101 | |
| 102 | - $this->compileExtraElements($table, $captions,$js); |
|
| 102 | + $this->compileExtraElements($table, $captions, $js); |
|
| 103 | 103 | |
| 104 | - $this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"table",PositionInTable::AFTERTABLE]); |
|
| 104 | + $this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE, "table", PositionInTable::AFTERTABLE]); |
|
| 105 | 105 | $this->_compileForm(); |
| 106 | 106 | $this->_applyStyleAttributes($table); |
| 107 | 107 | $this->_generated=true; |
| 108 | 108 | } |
| 109 | - return parent::compile($js,$view); |
|
| 109 | + return parent::compile($js, $view); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - protected function compileExtraElements($table,$captions,JsUtils $js=NULL){ |
|
| 113 | - if(isset($this->_searchField) && isset($js) && isset($this->_urls["refresh"])){ |
|
| 114 | - $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
| 112 | + protected function compileExtraElements($table, $captions, JsUtils $js=NULL) { |
|
| 113 | + if (isset($this->_searchField) && isset($js) && isset($this->_urls["refresh"])) { |
|
| 114 | + $this->_searchField->postOn("change", $this->_urls["refresh"], "{'s':$(this).val()}", "#".$this->identifier." tbody", ["preventDefault"=>false, "jqueryDone"=>"replaceWith"]); |
|
| 115 | 115 | } |
| 116 | - if($this->_hasCheckboxes && $table->hasPart("thead")){ |
|
| 116 | + if ($this->_hasCheckboxes && $table->hasPart("thead")) { |
|
| 117 | 117 | $table->getHeader()->getCell(0, 0)->addClass("no-sort"); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if(isset($this->_toolbar)){ |
|
| 120 | + if (isset($this->_toolbar)) { |
|
| 121 | 121 | $this->_setToolbarPosition($table, $captions); |
| 122 | 122 | } |
| 123 | - if(isset($this->_pagination) && $this->_pagination->getVisible()){ |
|
| 124 | - $this->_generatePagination($table,$js); |
|
| 123 | + if (isset($this->_pagination) && $this->_pagination->getVisible()) { |
|
| 124 | + $this->_generatePagination($table, $js); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - protected function _applyStyleAttributes($table){ |
|
| 129 | - if(isset($this->_hiddenColumns)) |
|
| 128 | + protected function _applyStyleAttributes($table) { |
|
| 129 | + if (isset($this->_hiddenColumns)) |
|
| 130 | 130 | $this->_hideColumns(); |
| 131 | - if(isset($this->_colWidths)){ |
|
| 132 | - foreach ($this->_colWidths as $colIndex=>$width){ |
|
| 133 | - $table->setColWidth($colIndex,$width); |
|
| 131 | + if (isset($this->_colWidths)) { |
|
| 132 | + foreach ($this->_colWidths as $colIndex=>$width) { |
|
| 133 | + $table->setColWidth($colIndex, $width); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - protected function _hideColumns(){ |
|
| 139 | - foreach ($this->_hiddenColumns as $colIndex){ |
|
| 138 | + protected function _hideColumns() { |
|
| 139 | + foreach ($this->_hiddenColumns as $colIndex) { |
|
| 140 | 140 | $this->_self->hideColumn($colIndex); |
| 141 | 141 | } |
| 142 | 142 | return $this; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - protected function _generateHeader(HtmlTable $table,$captions){ |
|
| 145 | + protected function _generateHeader(HtmlTable $table, $captions) { |
|
| 146 | 146 | $table->setHeaderValues($captions); |
| 147 | - if(isset($this->_sortable)){ |
|
| 147 | + if (isset($this->_sortable)) { |
|
| 148 | 148 | $table->setSortable($this->_sortable); |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | |
| 154 | - protected function _generateContent($table){ |
|
| 154 | + protected function _generateContent($table) { |
|
| 155 | 155 | $objects=$this->_modelInstance; |
| 156 | - if(isset($this->_pagination)){ |
|
| 156 | + if (isset($this->_pagination)) { |
|
| 157 | 157 | $objects=$this->_pagination->getObjects($this->_modelInstance); |
| 158 | 158 | } |
| 159 | 159 | InstanceViewer::setIndex(0); |
| 160 | 160 | $table->fromDatabaseObjects($objects, function($instance) use($table){ |
| 161 | 161 | return $this->_generateRow($instance, $table); |
| 162 | 162 | }); |
| 163 | - if($table->getRowCount()==0){ |
|
| 163 | + if ($table->getRowCount()==0) { |
|
| 164 | 164 | $result=$table->addRow(); |
| 165 | 165 | $result->mergeRow(); |
| 166 | 166 | $result->setValues([$this->_emptyMessage]); |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - protected function _generateRow($instance,&$table,$checkedClass=null){ |
|
| 170 | + protected function _generateRow($instance, &$table, $checkedClass=null) { |
|
| 171 | 171 | $this->_instanceViewer->setInstance($instance); |
| 172 | 172 | InstanceViewer::$index++; |
| 173 | - $values= $this->_instanceViewer->getValues(); |
|
| 173 | + $values=$this->_instanceViewer->getValues(); |
|
| 174 | 174 | $id=$this->_instanceViewer->getIdentifier(); |
| 175 | 175 | $dataAjax=$id; |
| 176 | 176 | $id=$this->cleanIdentifier($id); |
| 177 | - if($this->_hasCheckboxes){ |
|
| 178 | - $ck=new HtmlCheckbox("ck-".$this->identifier."-".$id,""); |
|
| 177 | + if ($this->_hasCheckboxes) { |
|
| 178 | + $ck=new HtmlCheckbox("ck-".$this->identifier."-".$id, ""); |
|
| 179 | 179 | $ck->setOnChange("event.stopPropagation();"); |
| 180 | 180 | $field=$ck->getField(); |
| 181 | - $field->setProperty("value",$dataAjax); |
|
| 181 | + $field->setProperty("value", $dataAjax); |
|
| 182 | 182 | $field->setProperty("name", "selection[]"); |
| 183 | - if(isset($checkedClass)) |
|
| 183 | + if (isset($checkedClass)) |
|
| 184 | 184 | $field->setClass($checkedClass); |
| 185 | 185 | \array_unshift($values, $ck); |
| 186 | 186 | } |
| 187 | 187 | $result=$table->newRow(); |
| 188 | 188 | $result->setIdentifier($this->identifier."-tr-".$id); |
| 189 | - $result->setProperty("data-ajax",$dataAjax); |
|
| 189 | + $result->setProperty("data-ajax", $dataAjax); |
|
| 190 | 190 | $result->setValues($values); |
| 191 | - $result->addToProperty("class",$this->_rowClass); |
|
| 191 | + $result->addToProperty("class", $this->_rowClass); |
|
| 192 | 192 | return $result; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - protected function _generatePagination($table,$js=NULL){ |
|
| 196 | - if(isset($this->_toolbar)){ |
|
| 197 | - if($this->_toolbarPosition==PositionInTable::FOOTER) |
|
| 195 | + protected function _generatePagination($table, $js=NULL) { |
|
| 196 | + if (isset($this->_toolbar)) { |
|
| 197 | + if ($this->_toolbarPosition==PositionInTable::FOOTER) |
|
| 198 | 198 | $this->_toolbar->setFloated("left"); |
| 199 | 199 | } |
| 200 | 200 | $footer=$table->getFooter(); |
| 201 | 201 | $footer->mergeCol(); |
| 202 | - $menu=new HtmlPaginationMenu("pagination-".$this->identifier,$this->_pagination->getPagesNumbers()); |
|
| 202 | + $menu=new HtmlPaginationMenu("pagination-".$this->identifier, $this->_pagination->getPagesNumbers()); |
|
| 203 | 203 | $menu->floatRight(); |
| 204 | 204 | $menu->setActiveItem($this->_pagination->getPage()-1); |
| 205 | 205 | $footer->addValues($menu); |
| 206 | - $this->_associatePaginationBehavior($menu,$js); |
|
| 206 | + $this->_associatePaginationBehavior($menu, $js); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - protected function _associatePaginationBehavior(HtmlMenu $menu,JsUtils $js=NULL){ |
|
| 210 | - if(isset($this->_urls["refresh"])){ |
|
| 211 | - $menu->postOnClick($this->_urls["refresh"],"{'p':$(this).attr('data-page')}",$this->getRefreshSelector(),["preventDefault"=>false,"jqueryDone"=>"replaceWith","hasLoader"=>false]); |
|
| 209 | + protected function _associatePaginationBehavior(HtmlMenu $menu, JsUtils $js=NULL) { |
|
| 210 | + if (isset($this->_urls["refresh"])) { |
|
| 211 | + $menu->postOnClick($this->_urls["refresh"], "{'p':$(this).attr('data-page')}", $this->getRefreshSelector(), ["preventDefault"=>false, "jqueryDone"=>"replaceWith", "hasLoader"=>false]); |
|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - protected function _getFieldName($index){ |
|
| 215 | + protected function _getFieldName($index) { |
|
| 216 | 216 | $fieldName=parent::_getFieldName($index); |
| 217 | - if(\is_object($fieldName)) |
|
| 217 | + if (\is_object($fieldName)) |
|
| 218 | 218 | $fieldName="field-".$index; |
| 219 | 219 | return $fieldName."[]"; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - protected function _getFieldCaption($index){ |
|
| 222 | + protected function _getFieldCaption($index) { |
|
| 223 | 223 | return null; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - protected function _setToolbarPosition($table,$captions=NULL){ |
|
| 227 | - switch ($this->_toolbarPosition){ |
|
| 226 | + protected function _setToolbarPosition($table, $captions=NULL) { |
|
| 227 | + switch ($this->_toolbarPosition) { |
|
| 228 | 228 | case PositionInTable::BEFORETABLE: |
| 229 | 229 | case PositionInTable::AFTERTABLE: |
| 230 | - if(isset($this->_compileParts)===false){ |
|
| 230 | + if (isset($this->_compileParts)===false) { |
|
| 231 | 231 | $this->content[$this->_toolbarPosition]=$this->_toolbar; |
| 232 | 232 | } |
| 233 | 233 | break; |
| 234 | 234 | case PositionInTable::HEADER: |
| 235 | 235 | case PositionInTable::FOOTER: |
| 236 | 236 | case PositionInTable::BODY: |
| 237 | - $this->addToolbarRow($this->_toolbarPosition,$table, $captions); |
|
| 237 | + $this->addToolbarRow($this->_toolbarPosition, $table, $captions); |
|
| 238 | 238 | break; |
| 239 | 239 | } |
| 240 | 240 | } |
@@ -246,16 +246,16 @@ discard block |
||
| 246 | 246 | * @param callable $callback function called after the field compilation |
| 247 | 247 | * @return DataTable |
| 248 | 248 | */ |
| 249 | - public function afterCompile($index,$callback){ |
|
| 250 | - $this->_instanceViewer->afterCompile($index,$callback); |
|
| 249 | + public function afterCompile($index, $callback) { |
|
| 250 | + $this->_instanceViewer->afterCompile($index, $callback); |
|
| 251 | 251 | return $this; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - private function addToolbarRow($part,$table,$captions){ |
|
| 254 | + private function addToolbarRow($part, $table, $captions) { |
|
| 255 | 255 | $hasPart=$table->hasPart($part); |
| 256 | - if($hasPart){ |
|
| 256 | + if ($hasPart) { |
|
| 257 | 257 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
| 258 | - }else{ |
|
| 258 | + } else { |
|
| 259 | 259 | $row=$table->getPart($part)->getRow(0); |
| 260 | 260 | } |
| 261 | 261 | $row->mergeCol(); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * @see Widget::getHtmlComponent() |
| 268 | 268 | * @return HtmlTable |
| 269 | 269 | */ |
| 270 | - public function getHtmlComponent(){ |
|
| 270 | + public function getHtmlComponent() { |
|
| 271 | 271 | return $this->content["table"]; |
| 272 | 272 | } |
| 273 | 273 | |
@@ -282,12 +282,12 @@ discard block |
||
| 282 | 282 | * @return DataTable |
| 283 | 283 | */ |
| 284 | 284 | public function setUrls($urls) { |
| 285 | - if(\is_array($urls)){ |
|
| 286 | - $this->_urls["refresh"]=JArray::getValue($urls, "refresh",0); |
|
| 287 | - $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
|
| 288 | - $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
|
| 289 | - }else{ |
|
| 290 | - $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls]; |
|
| 285 | + if (\is_array($urls)) { |
|
| 286 | + $this->_urls["refresh"]=JArray::getValue($urls, "refresh", 0); |
|
| 287 | + $this->_urls["edit"]=JArray::getValue($urls, "edit", 1); |
|
| 288 | + $this->_urls["delete"]=JArray::getValue($urls, "delete", 2); |
|
| 289 | + } else { |
|
| 290 | + $this->_urls=["refresh"=>$urls, "edit"=>$urls, "delete"=>$urls]; |
|
| 291 | 291 | } |
| 292 | 292 | return $this; |
| 293 | 293 | } |
@@ -300,8 +300,8 @@ discard block |
||
| 300 | 300 | * @param number $pages_visibles The number of visible pages in the Pagination component |
| 301 | 301 | * @return DataTable |
| 302 | 302 | */ |
| 303 | - public function paginate($page,$total_rowcount,$items_per_page=10,$pages_visibles=null){ |
|
| 304 | - $this->_pagination=new Pagination($items_per_page,$pages_visibles,$page,$total_rowcount); |
|
| 303 | + public function paginate($page, $total_rowcount, $items_per_page=10, $pages_visibles=null) { |
|
| 304 | + $this->_pagination=new Pagination($items_per_page, $pages_visibles, $page, $total_rowcount); |
|
| 305 | 305 | return $this; |
| 306 | 306 | } |
| 307 | 307 | |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | * @param number $pages_visibles The number of visible pages in the Pagination component |
| 313 | 313 | * @return DataTable |
| 314 | 314 | */ |
| 315 | - public function autoPaginate($page=1,$items_per_page=10,$pages_visibles=4){ |
|
| 316 | - $this->_pagination=new Pagination($items_per_page,$pages_visibles,$page); |
|
| 315 | + public function autoPaginate($page=1, $items_per_page=10, $pages_visibles=4) { |
|
| 316 | + $this->_pagination=new Pagination($items_per_page, $pages_visibles, $page); |
|
| 317 | 317 | return $this; |
| 318 | 318 | } |
| 319 | 319 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * @param array $compileParts |
| 324 | 324 | * @return DataTable |
| 325 | 325 | */ |
| 326 | - public function refresh($compileParts=["tbody"]){ |
|
| 326 | + public function refresh($compileParts=["tbody"]) { |
|
| 327 | 327 | $this->_compileParts=$compileParts; |
| 328 | 328 | return $this; |
| 329 | 329 | } |
@@ -334,14 +334,14 @@ discard block |
||
| 334 | 334 | * @param string $position |
| 335 | 335 | * @return \Ajax\common\html\HtmlDoubleElement |
| 336 | 336 | */ |
| 337 | - public function addSearchInToolbar($position=Direction::RIGHT){ |
|
| 337 | + public function addSearchInToolbar($position=Direction::RIGHT) { |
|
| 338 | 338 | return $this->addInToolbar($this->getSearchField())->setPosition($position); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - public function getSearchField(){ |
|
| 342 | - if(isset($this->_searchField)===false){ |
|
| 343 | - $this->_searchField=new HtmlInput("search-".$this->identifier,"search","","Search..."); |
|
| 344 | - $this->_searchField->addIcon("search",Direction::RIGHT); |
|
| 341 | + public function getSearchField() { |
|
| 342 | + if (isset($this->_searchField)===false) { |
|
| 343 | + $this->_searchField=new HtmlInput("search-".$this->identifier, "search", "", "Search..."); |
|
| 344 | + $this->_searchField->addIcon("search", Direction::RIGHT); |
|
| 345 | 345 | } |
| 346 | 346 | return $this->_searchField; |
| 347 | 347 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | * Returns a form corresponding to the Datatable |
| 362 | 362 | * @return \Ajax\semantic\html\collections\form\HtmlForm |
| 363 | 363 | */ |
| 364 | - public function asForm(){ |
|
| 364 | + public function asForm() { |
|
| 365 | 365 | return $this->getForm(); |
| 366 | 366 | } |
| 367 | 367 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | protected function getTargetSelector($op) { |
| 371 | 371 | $result=$this->_targetSelector; |
| 372 | - if(!isset($result[$op])) |
|
| 372 | + if (!isset($result[$op])) |
|
| 373 | 373 | $result="#".$this->identifier; |
| 374 | 374 | return $result[$op]; |
| 375 | 375 | } |
@@ -380,15 +380,15 @@ discard block |
||
| 380 | 380 | * @return DataTable |
| 381 | 381 | */ |
| 382 | 382 | public function setTargetSelector($_targetSelector) { |
| 383 | - if(!\is_array($_targetSelector)){ |
|
| 384 | - $_targetSelector=["edit"=>$_targetSelector,"delete"=>$_targetSelector]; |
|
| 383 | + if (!\is_array($_targetSelector)) { |
|
| 384 | + $_targetSelector=["edit"=>$_targetSelector, "delete"=>$_targetSelector]; |
|
| 385 | 385 | } |
| 386 | 386 | $this->_targetSelector=$_targetSelector; |
| 387 | 387 | return $this; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | public function getRefreshSelector() { |
| 391 | - if(isset($this->_refreshSelector)) |
|
| 391 | + if (isset($this->_refreshSelector)) |
|
| 392 | 392 | return $this->_refreshSelector; |
| 393 | 393 | return "#".$this->identifier." tbody"; |
| 394 | 394 | } |
@@ -406,9 +406,9 @@ discard block |
||
| 406 | 406 | * {@inheritDoc} |
| 407 | 407 | * @see \Ajax\common\Widget::show() |
| 408 | 408 | */ |
| 409 | - public function show($modelInstance){ |
|
| 410 | - if(\is_array($modelInstance)){ |
|
| 411 | - if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) |
|
| 409 | + public function show($modelInstance) { |
|
| 410 | + if (\is_array($modelInstance)) { |
|
| 411 | + if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) |
|
| 412 | 412 | $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
| 413 | 413 | } |
| 414 | 414 | $this->_modelInstance=$modelInstance; |
@@ -443,29 +443,29 @@ discard block |
||
| 443 | 443 | return $this; |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | - public function setActiveRowSelector($class="active",$event="click",$multiple=false){ |
|
| 447 | - $this->_self->setActiveRowSelector($class,$event,$multiple); |
|
| 446 | + public function setActiveRowSelector($class="active", $event="click", $multiple=false) { |
|
| 447 | + $this->_self->setActiveRowSelector($class, $event, $multiple); |
|
| 448 | 448 | return $this; |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | - public function hideColumn($colIndex){ |
|
| 452 | - if(!\is_array($this->_hiddenColumns)) |
|
| 451 | + public function hideColumn($colIndex) { |
|
| 452 | + if (!\is_array($this->_hiddenColumns)) |
|
| 453 | 453 | $this->_hiddenColumns=[]; |
| 454 | 454 | $this->_hiddenColumns[]=$colIndex; |
| 455 | 455 | return $this; |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - public function setColWidth($colIndex,$width){ |
|
| 458 | + public function setColWidth($colIndex, $width) { |
|
| 459 | 459 | $this->_colWidths[$colIndex]=$width; |
| 460 | 460 | return $this; |
| 461 | 461 | } |
| 462 | 462 | public function setColWidths($_colWidths) { |
| 463 | - $this->_colWidths = $_colWidths; |
|
| 463 | + $this->_colWidths=$_colWidths; |
|
| 464 | 464 | return $this; |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | - public function setColAlignment($colIndex,$alignment){ |
|
| 468 | - $this->content["table"]->setColAlignment($colIndex,$alignment); |
|
| 467 | + public function setColAlignment($colIndex, $alignment) { |
|
| 468 | + $this->content["table"]->setColAlignment($colIndex, $alignment); |
|
| 469 | 469 | return $this; |
| 470 | 470 | } |
| 471 | 471 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | use BaseTrait; |
| 23 | 23 | protected $_popup=NULL; |
| 24 | 24 | protected $_dimmer=NULL; |
| 25 | - protected $_params=array (); |
|
| 25 | + protected $_params=array(); |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @return HtmlDimmer |
| 79 | 79 | */ |
| 80 | 80 | public function addDimmer($params=array(), $content=NULL) { |
| 81 | - $dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content); |
|
| 81 | + $dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content); |
|
| 82 | 82 | $dimmer->setParams($params); |
| 83 | 83 | $dimmer->setContainer($this); |
| 84 | 84 | $this->addContent($dimmer); |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function addLabel($label, $before=false, $icon=NULL) { |
| 96 | 96 | $labelO=$label; |
| 97 | - if (\is_object($label) === false) { |
|
| 98 | - $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
|
| 97 | + if (\is_object($label)===false) { |
|
| 98 | + $labelO=new HtmlLabel("label-".$this->identifier, $label); |
|
| 99 | 99 | if (isset($icon)) |
| 100 | 100 | $labelO->addIcon($icon); |
| 101 | 101 | } else { |
| 102 | - $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
|
| 102 | + $labelO->addToPropertyCtrl("class", "label", array("label")); |
|
| 103 | 103 | } |
| 104 | 104 | $this->addContent($labelO, $before); |
| 105 | 105 | return $labelO; |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | * @param string $icon |
| 114 | 114 | * @return HtmlSemDoubleElement |
| 115 | 115 | */ |
| 116 | - public function attachLabel($label,$side=Side::TOP,$direction=Direction::NONE,$icon=NULL){ |
|
| 117 | - $label=$this->addLabel($label,true,$icon); |
|
| 118 | - $label->setAttached($side,$direction); |
|
| 116 | + public function attachLabel($label, $side=Side::TOP, $direction=Direction::NONE, $icon=NULL) { |
|
| 117 | + $label=$this->addLabel($label, true, $icon); |
|
| 118 | + $label->setAttached($side, $direction); |
|
| 119 | 119 | return $this; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | * Transforms the element into a link |
| 124 | 124 | * @return HtmlSemDoubleElement |
| 125 | 125 | */ |
| 126 | - public function asLink($href=NULL,$target=NULL) { |
|
| 126 | + public function asLink($href=NULL, $target=NULL) { |
|
| 127 | 127 | if (isset($href)) |
| 128 | 128 | $this->setProperty("href", $href); |
| 129 | - if(isset($target)) |
|
| 129 | + if (isset($target)) |
|
| 130 | 130 | $this->setProperty("target", $target); |
| 131 | 131 | return $this->setTagName("a"); |
| 132 | 132 | } |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function jsShowDimmer($show=true) { |
| 140 | 140 | $status="hide"; |
| 141 | - if ($show === true) |
|
| 141 | + if ($show===true) |
|
| 142 | 142 | $status="show"; |
| 143 | - return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
|
| 143 | + return '$("#.'.$this->identifier.').dimmer("'.$status.'");'; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @see HtmlDoubleElement::run() |
| 159 | 159 | */ |
| 160 | 160 | public function run(JsUtils $js) { |
| 161 | - $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); |
|
| 161 | + $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); |
|
| 162 | 162 | parent::run($js); |
| 163 | 163 | $this->addEventsOnRun($js); |
| 164 | 164 | if (isset($this->_popup)) { |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | return $this->_bsComponent; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - public function addList($items,$ordered=false){ |
|
| 171 | - $list=new HtmlList("list-".$this->identifier,$items); |
|
| 170 | + public function addList($items, $ordered=false) { |
|
| 171 | + $list=new HtmlList("list-".$this->identifier, $items); |
|
| 172 | 172 | $list->setOrdered($ordered); |
| 173 | 173 | $list->setClass("ui list"); |
| 174 | 174 | $this->addContent($list); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | private function addFunction($jsCode) { |
| 18 | 18 | if (!Text::startsWith($jsCode, "function")) |
| 19 | - $jsCode="%function(){" . $jsCode . "}%"; |
|
| 19 | + $jsCode="%function(){".$jsCode."}%"; |
|
| 20 | 20 | return $jsCode; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param array $parameters default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null) |
| 52 | 52 | * @return DialogButton |
| 53 | 53 | */ |
| 54 | - public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption="Okay",$parameters=[]) { |
|
| 55 | - return new DialogButton($caption, $js->postFormDeferred($url, $form, $responseElement,$parameters) . ";$( this ).dialog( 'close' );"); |
|
| 54 | + public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption="Okay", $parameters=[]) { |
|
| 55 | + return new DialogButton($caption, $js->postFormDeferred($url, $form, $responseElement, $parameters).";$( this ).dialog( 'close' );"); |
|
| 56 | 56 | } |
| 57 | 57 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $icon=JArray::getValue($value, "icon", 0); |
| 28 | 28 | $size=JArray::getValue($value, "size", 1); |
| 29 | 29 | } |
| 30 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
| 30 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
| 31 | 31 | if (isset($size)) { |
| 32 | 32 | $iconO->setSize($size); |
| 33 | 33 | } |
@@ -35,15 +35,15 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | protected function createCondition($value) { |
| 38 | - return ($value instanceof HtmlIcon) === false; |
|
| 38 | + return ($value instanceof HtmlIcon)===false; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function getIcon($index) { |
| 42 | 42 | return $this->content[$index]; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function run(JsUtils $js){ |
|
| 46 | - $result= parent::run($js); |
|
| 45 | + public function run(JsUtils $js) { |
|
| 46 | + $result=parent::run($js); |
|
| 47 | 47 | return $result->setItemSelector("i"); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | return $this; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public static function corner($mainIcon,$cornerIcon,$size="huge"){ |
|
| 56 | - $icons=new HtmlIconGroups("icons",[$mainIcon,$cornerIcon],$size); |
|
| 55 | + public static function corner($mainIcon, $cornerIcon, $size="huge") { |
|
| 56 | + $icons=new HtmlIconGroups("icons", [$mainIcon, $cornerIcon], $size); |
|
| 57 | 57 | return $icons->toCorner(1); |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -20,46 +20,46 @@ discard block |
||
| 20 | 20 | * @property string $identifier |
| 21 | 21 | */ |
| 22 | 22 | trait FieldsTrait { |
| 23 | - abstract public function addFields($fields=NULL,$label=NULL); |
|
| 23 | + abstract public function addFields($fields=NULL, $label=NULL); |
|
| 24 | 24 | abstract public function addItem($item); |
| 25 | 25 | |
| 26 | - protected function createItem($value){ |
|
| 27 | - if(\is_array($value)){ |
|
| 28 | - $itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null))); |
|
| 26 | + protected function createItem($value) { |
|
| 27 | + if (\is_array($value)) { |
|
| 28 | + $itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id", ""), JArray::getDefaultValue($value, "label", null), JArray::getDefaultValue($value, "type", "text"), JArray::getDefaultValue($value, "value", ""), JArray::getDefaultValue($value, "placeholder", JArray::getDefaultValue($value, "label", null))); |
|
| 29 | 29 | return $itemO; |
| 30 | - }elseif(\is_object($value)){ |
|
| 30 | + }elseif (\is_object($value)) { |
|
| 31 | 31 | $itemO=new HtmlFormField("field-".$this->identifier, $value); |
| 32 | 32 | return $itemO; |
| 33 | - }else |
|
| 33 | + } else |
|
| 34 | 34 | return new HtmlFormInput($value); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - protected function createCondition($value){ |
|
| 37 | + protected function createCondition($value) { |
|
| 38 | 38 | return \is_object($value)===false || $value instanceof \Ajax\semantic\html\elements\HtmlInput; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function addInputs($inputs,$fieldslabel=null){ |
|
| 41 | + public function addInputs($inputs, $fieldslabel=null) { |
|
| 42 | 42 | $fields=array(); |
| 43 | - foreach ($inputs as $input){ |
|
| 43 | + foreach ($inputs as $input) { |
|
| 44 | 44 | \extract($input); |
| 45 | - $f=new HtmlFormInput("",""); |
|
| 45 | + $f=new HtmlFormInput("", ""); |
|
| 46 | 46 | $f->fromArray($input); |
| 47 | 47 | $fields[]=$f; |
| 48 | 48 | } |
| 49 | - return $this->addFields($fields,$fieldslabel); |
|
| 49 | + return $this->addFields($fields, $fieldslabel); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - public function addFieldRule($index,$type,$prompt=NULL,$value=NULL){ |
|
| 52 | + public function addFieldRule($index, $type, $prompt=NULL, $value=NULL) { |
|
| 53 | 53 | $field=$this->getItem($index); |
| 54 | - if(isset($field)){ |
|
| 55 | - $field->addRule($type,$prompt,$value); |
|
| 54 | + if (isset($field)) { |
|
| 55 | + $field->addRule($type, $prompt, $value); |
|
| 56 | 56 | } |
| 57 | 57 | return $this; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public function addFieldRules($index,$rules){ |
|
| 60 | + public function addFieldRules($index, $rules) { |
|
| 61 | 61 | $field=$this->getItem($index); |
| 62 | - if(isset($field)){ |
|
| 62 | + if (isset($field)) { |
|
| 63 | 63 | $field->addRules($rules); |
| 64 | 64 | } |
| 65 | 65 | return $this; |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | * @param boolean $multiple |
| 75 | 75 | * @return HtmlFormDropdown |
| 76 | 76 | */ |
| 77 | - public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){ |
|
| 78 | - return $this->addItem(new HtmlFormDropdown($identifier,$items,$label,$value,$multiple)); |
|
| 77 | + public function addDropdown($identifier, $items=array(), $label=NULL, $value=NULL, $multiple=false) { |
|
| 78 | + return $this->addItem(new HtmlFormDropdown($identifier, $items, $label, $value, $multiple)); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | * @param boolean $asIcons |
| 86 | 86 | * @return HtmlButtonGroups |
| 87 | 87 | */ |
| 88 | - public function addButtonGroups($identifier,$elements=[],$asIcons=false){ |
|
| 89 | - return $this->addItem(new HtmlButtonGroups($identifier,$elements,$asIcons)); |
|
| 88 | + public function addButtonGroups($identifier, $elements=[], $asIcons=false) { |
|
| 89 | + return $this->addItem(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | * @param string $icon |
| 99 | 99 | * @return HtmlButtonGroups |
| 100 | 100 | */ |
| 101 | - public function addDropdownButton($identifier,$value,$items=[],$asCombo=false,$icon=null){ |
|
| 102 | - return $this->addItem(HtmlButton::dropdown($identifier, $value,$items,$asCombo,$icon)); |
|
| 101 | + public function addDropdownButton($identifier, $value, $items=[], $asCombo=false, $icon=null) { |
|
| 102 | + return $this->addItem(HtmlButton::dropdown($identifier, $value, $items, $asCombo, $icon)); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | * @param string $placeholder |
| 111 | 111 | * @return HtmlFormInput |
| 112 | 112 | */ |
| 113 | - public function addInput($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL){ |
|
| 114 | - return $this->addItem(new HtmlFormInput($identifier,$label,$type,$value,$placeholder)); |
|
| 113 | + public function addInput($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) { |
|
| 114 | + return $this->addItem(new HtmlFormInput($identifier, $label, $type, $value, $placeholder)); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -122,16 +122,16 @@ discard block |
||
| 122 | 122 | * @param int $rows |
| 123 | 123 | * @return HtmlTextarea |
| 124 | 124 | */ |
| 125 | - public function addTextarea($identifier, $label,$value=NULL,$placeholder=NULL,$rows=5){ |
|
| 126 | - return $this->addItem(new HtmlFormTextarea($identifier,$label,$value,$placeholder,$rows)); |
|
| 125 | + public function addTextarea($identifier, $label, $value=NULL, $placeholder=NULL, $rows=5) { |
|
| 126 | + return $this->addItem(new HtmlFormTextarea($identifier, $label, $value, $placeholder, $rows)); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - public function addPassword($identifier, $label=NULL){ |
|
| 130 | - return $this->addItem(new HtmlFormInput($identifier,$label,"password","","")); |
|
| 129 | + public function addPassword($identifier, $label=NULL) { |
|
| 130 | + return $this->addItem(new HtmlFormInput($identifier, $label, "password", "", "")); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - public function addButton($identifier,$value,$cssStyle=NULL,$onClick=NULL){ |
|
| 134 | - return $this->addItem(new HtmlButton($identifier,$value,$cssStyle,$onClick)); |
|
| 133 | + public function addButton($identifier, $value, $cssStyle=NULL, $onClick=NULL) { |
|
| 134 | + return $this->addItem(new HtmlButton($identifier, $value, $cssStyle, $onClick)); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -141,16 +141,16 @@ discard block |
||
| 141 | 141 | * @param string $type |
| 142 | 142 | * @return HtmlFormCheckbox |
| 143 | 143 | */ |
| 144 | - public function addCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){ |
|
| 145 | - return $this->addItem(new HtmlFormCheckbox($identifier,$label,$value,$type)); |
|
| 144 | + public function addCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) { |
|
| 145 | + return $this->addItem(new HtmlFormCheckbox($identifier, $label, $value, $type)); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - public function addRadio($identifier, $name,$label=NULL,$value=NULL){ |
|
| 149 | - return $this->addItem(new HtmlFormRadio($identifier,$name,$label,$value)); |
|
| 148 | + public function addRadio($identifier, $name, $label=NULL, $value=NULL) { |
|
| 149 | + return $this->addItem(new HtmlFormRadio($identifier, $name, $label, $value)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - public function addElement($identifier,$content,$label,$tagName="div",$baseClass=""){ |
|
| 153 | - $div=new HtmlSemDoubleElement($identifier,$tagName,$baseClass,$content); |
|
| 154 | - return $this->addItem(new HtmlFormField("field-".$identifier, $div,$label)); |
|
| 152 | + public function addElement($identifier, $content, $label, $tagName="div", $baseClass="") { |
|
| 153 | + $div=new HtmlSemDoubleElement($identifier, $tagName, $baseClass, $content); |
|
| 154 | + return $this->addItem(new HtmlFormField("field-".$identifier, $div, $label)); |
|
| 155 | 155 | } |
| 156 | 156 | } |
@@ -7,29 +7,29 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class HtmlFormDropdown extends HtmlFormField { |
| 9 | 9 | |
| 10 | - public function __construct($identifier,$items=array(), $label=NULL,$value="",$multiple=false,$associative=true) { |
|
| 11 | - parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier,$value,$items,$associative))->asSelect($identifier,$multiple), $label); |
|
| 10 | + public function __construct($identifier, $items=array(), $label=NULL, $value="", $multiple=false, $associative=true) { |
|
| 11 | + parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier, $value, $items, $associative))->asSelect($identifier, $multiple), $label); |
|
| 12 | 12 | $this->_identifier=$identifier; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - public function setItems($items){ |
|
| 15 | + public function setItems($items) { |
|
| 16 | 16 | return $this->getField()->setItems($items); |
| 17 | 17 | } |
| 18 | - public function addItem($item,$value=NULL,$image=NULL){ |
|
| 19 | - return $this->getField()->addItem($item,$value,$image); |
|
| 18 | + public function addItem($item, $value=NULL, $image=NULL) { |
|
| 19 | + return $this->getField()->addItem($item, $value, $image); |
|
| 20 | 20 | } |
| 21 | - public static function multipleDropdown($identifier,$items=array(), $label=NULL,$value="",$associative=true){ |
|
| 22 | - return new HtmlFormDropdown($identifier,$items,$label,$value,true,$associative); |
|
| 21 | + public static function multipleDropdown($identifier, $items=array(), $label=NULL, $value="", $associative=true) { |
|
| 22 | + return new HtmlFormDropdown($identifier, $items, $label, $value, true, $associative); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @return HtmlDropdown |
| 27 | 27 | */ |
| 28 | - public function getDataField(){ |
|
| 28 | + public function getDataField() { |
|
| 29 | 29 | return $this->getField()->getInput(); |
| 30 | 30 | } |
| 31 | - public function asSelect($name=NULL,$multiple=false,$selection=true){ |
|
| 32 | - $this->getField()->asSelect($name,$multiple,$selection); |
|
| 31 | + public function asSelect($name=NULL, $multiple=false, $selection=true) { |
|
| 32 | + $this->getField()->asSelect($name, $multiple, $selection); |
|
| 33 | 33 | return $this; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @param boolean $floating |
| 38 | 38 | * @return HtmlDropdown |
| 39 | 39 | */ |
| 40 | - public function asButton($floating=false){ |
|
| 40 | + public function asButton($floating=false) { |
|
| 41 | 41 | $field=$this->content["field"]; |
| 42 | 42 | $label=$this->content["label"]; |
| 43 | 43 | $field->addContent($label); |
@@ -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,39 +32,39 @@ 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>"); |
|
| 52 | - if(\is_string($icon)){ |
|
| 51 | + $this->wrapContent("<div class='content'>", "</div>"); |
|
| 52 | + if (\is_string($icon)) { |
|
| 53 | 53 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
| 54 | - }else{ |
|
| 54 | + } else { |
|
| 55 | 55 | $this->icon=$icon; |
| 56 | 56 | } |
| 57 | 57 | return $this; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public function addLoader($loaderIcon="notched circle"){ |
|
| 60 | + public function addLoader($loaderIcon="notched circle") { |
|
| 61 | 61 | $this->setIcon($loaderIcon); |
| 62 | 62 | $this->icon->addToIcon("loading"); |
| 63 | 63 | return $this; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public function setDismissable($dismiss=true){ |
|
| 67 | - if($dismiss===true) |
|
| 66 | + public function setDismissable($dismiss=true) { |
|
| 67 | + if ($dismiss===true) |
|
| 68 | 68 | $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
| 69 | 69 | else |
| 70 | 70 | $this->close=NULL; |
@@ -75,43 +75,43 @@ discard block |
||
| 75 | 75 | * {@inheritDoc} |
| 76 | 76 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
| 77 | 77 | */ |
| 78 | - public function run(JsUtils $js){ |
|
| 79 | - if(!isset($this->_bsComponent)){ |
|
| 80 | - if(isset($this->close)){ |
|
| 78 | + public function run(JsUtils $js) { |
|
| 79 | + if (!isset($this->_bsComponent)) { |
|
| 80 | + if (isset($this->close)) { |
|
| 81 | 81 | $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition})"); |
| 82 | 82 | } |
| 83 | - if(isset($this->_timeout)){ |
|
| 84 | - $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});",true); |
|
| 83 | + if (isset($this->_timeout)) { |
|
| 84 | + $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});", true); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | return parent::run($js); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public function setState($visible=true){ |
|
| 91 | - $visible=($visible===true)?"visible":"hidden"; |
|
| 92 | - return $this->addToPropertyCtrl("class", $visible, array("visible","hidden")); |
|
| 90 | + public function setState($visible=true) { |
|
| 91 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
| 92 | + return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden")); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function setVariation($value="floating"){ |
|
| 96 | - return $this->addToPropertyCtrl("class", $value, array("floating","compact")); |
|
| 95 | + public function setVariation($value="floating") { |
|
| 96 | + return $this->addToPropertyCtrl("class", $value, array("floating", "compact")); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - public function setStyle($style){ |
|
| 99 | + public function setStyle($style) { |
|
| 100 | 100 | return $this->addToPropertyCtrl("class", $style, Style::getConstants()); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - public function setError(){ |
|
| 103 | + public function setError() { |
|
| 104 | 104 | return $this->setStyle("error"); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - public function setWarning(){ |
|
| 107 | + public function setWarning() { |
|
| 108 | 108 | return $this->setStyle("warning"); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - public function setMessage($message){ |
|
| 112 | - if(\is_array($this->content)){ |
|
| 111 | + public function setMessage($message) { |
|
| 112 | + if (\is_array($this->content)) { |
|
| 113 | 113 | $this->content[\sizeof($this->content)-1]=$message; |
| 114 | - }else |
|
| 114 | + } else |
|
| 115 | 115 | $this->setContent($message); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -6,8 +6,8 @@ discard block |
||
| 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 | /** |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | return $value; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public static function prep_jquery_selector($value){ |
|
| 47 | - if(JString::startswith($value, '$(')===false){ |
|
| 46 | + public static function prep_jquery_selector($value) { |
|
| 47 | + if (JString::startswith($value, '$(')===false) { |
|
| 48 | 48 | return '$('.$value.')'; |
| 49 | 49 | } |
| 50 | 50 | return $value; |