@@ -67,8 +67,9 @@ discard block |
||
| 67 | 67 | if($index<$menu->count()){ |
| 68 | 68 | if(isset($this->content[$index])===false){ |
| 69 | 69 | $this->content[$index]=$this->createSegment($index, $content, $menu->getItem($index)->getIdentifier()); |
| 70 | - }else |
|
| 71 | - $this->content[$index]->setContent($content); |
|
| 70 | + } else { |
|
| 71 | + $this->content[$index]->setContent($content); |
|
| 72 | + } |
|
| 72 | 73 | } |
| 73 | 74 | return $this; |
| 74 | 75 | } |
@@ -228,15 +229,17 @@ discard block |
||
| 228 | 229 | * @see BaseHtml::run() |
| 229 | 230 | */ |
| 230 | 231 | public function run(JsUtils $js) { |
| 231 | - if(isset($this->_bsComponent)===false) |
|
| 232 | - $this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params); |
|
| 232 | + if(isset($this->_bsComponent)===false) { |
|
| 233 | + $this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params); |
|
| 234 | + } |
|
| 233 | 235 | $this->addEventsOnRun($js); |
| 234 | 236 | return $this->_bsComponent; |
| 235 | 237 | } |
| 236 | 238 | |
| 237 | 239 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 238 | - if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) |
|
| 239 | - $this->activate(0); |
|
| 240 | + if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) { |
|
| 241 | + $this->activate(0); |
|
| 242 | + } |
|
| 240 | 243 | return parent::compile($js,$view); |
| 241 | 244 | } |
| 242 | 245 | } |
| 243 | 246 | \ No newline at end of file |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | * @author jc |
| 15 | 15 | * @version 1.001 |
| 16 | 16 | */ |
| 17 | -class HtmlTab extends HtmlSemCollection{ |
|
| 17 | +class HtmlTab extends HtmlSemCollection { |
|
| 18 | 18 | |
| 19 | 19 | protected $params=array("debug"=>true); |
| 20 | 20 | |
| 21 | - public function __construct( $identifier, $tabs=array()){ |
|
| 22 | - parent::__construct( $identifier, "div", ""); |
|
| 21 | + public function __construct($identifier, $tabs=array()) { |
|
| 22 | + parent::__construct($identifier, "div", ""); |
|
| 23 | 23 | $menu=new HtmlMenu("menu".$this->identifier); |
| 24 | - $menu->asTab(false)->setAttachment(NULL,Side::TOP); |
|
| 24 | + $menu->asTab(false)->setAttachment(NULL, Side::TOP); |
|
| 25 | 25 | $this->content["menu"]=$menu; |
| 26 | 26 | $this->addItems($tabs); |
| 27 | 27 | } |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | * @see \Ajax\common\html\HtmlCollection::createItem() |
| 32 | 32 | * @return HtmlSegment |
| 33 | 33 | */ |
| 34 | - protected function createItem($value){ |
|
| 34 | + protected function createItem($value) { |
|
| 35 | 35 | $count=$this->count(); |
| 36 | 36 | $title=$value; |
| 37 | 37 | $content=NULL; |
| 38 | - if(\is_array($value)){ |
|
| 39 | - $title=@$value[0];$content=@$value[1]; |
|
| 38 | + if (\is_array($value)) { |
|
| 39 | + $title=@$value[0]; $content=@$value[1]; |
|
| 40 | 40 | } |
| 41 | 41 | $menuItem=$this->content["menu"]->addItem($title); |
| 42 | 42 | $menuItem->addToProperty("data-tab", $menuItem->getIdentifier()); |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * @param string $datatab |
| 51 | 51 | * @return \Ajax\semantic\html\elements\HtmlSegment |
| 52 | 52 | */ |
| 53 | - private function createSegment($count,$content,$datatab){ |
|
| 53 | + private function createSegment($count, $content, $datatab) { |
|
| 54 | 54 | $segment=new HtmlSegment("item-".$this->identifier."-".$count, $content); |
| 55 | - $segment->setAttachment(NULL,Side::BOTTOM)->addToProperty("class", "tab")->addToProperty("data-tab",$datatab); |
|
| 55 | + $segment->setAttachment(NULL, Side::BOTTOM)->addToProperty("class", "tab")->addToProperty("data-tab", $datatab); |
|
| 56 | 56 | return $segment; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | * @param String $content new content |
| 63 | 63 | * @return \Ajax\semantic\html\modules\HtmlTab |
| 64 | 64 | */ |
| 65 | - public function setTabContent($index,$content){ |
|
| 65 | + public function setTabContent($index, $content) { |
|
| 66 | 66 | $menu=$this->content["menu"]; |
| 67 | - if($index<$menu->count()){ |
|
| 68 | - if(isset($this->content[$index])===false){ |
|
| 67 | + if ($index<$menu->count()) { |
|
| 68 | + if (isset($this->content[$index])===false) { |
|
| 69 | 69 | $this->content[$index]=$this->createSegment($index, $content, $menu->getItem($index)->getIdentifier()); |
| 70 | - }else |
|
| 70 | + } else |
|
| 71 | 71 | $this->content[$index]->setContent($content); |
| 72 | 72 | } |
| 73 | 73 | return $this; |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | * @param array $contents |
| 79 | 79 | * @return \Ajax\semantic\html\modules\HtmlTab |
| 80 | 80 | */ |
| 81 | - public function setTabsContent($contents){ |
|
| 81 | + public function setTabsContent($contents) { |
|
| 82 | 82 | $size=\sizeof($contents); |
| 83 | - for($i=0;$i<$size;$i++){ |
|
| 83 | + for ($i=0; $i<$size; $i++) { |
|
| 84 | 84 | $this->setTabContent($i, $contents[$i]); |
| 85 | 85 | } |
| 86 | 86 | return $this; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @param int $index |
| 92 | 92 | * @return \Ajax\semantic\html\modules\HtmlTab |
| 93 | 93 | */ |
| 94 | - public function activate($index){ |
|
| 94 | + public function activate($index) { |
|
| 95 | 95 | $this->content["menu"]->getItem($index)->setActive(true); |
| 96 | 96 | $this->content[$index]->setActive(true); |
| 97 | 97 | return $this; |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | * @param string $content |
| 104 | 104 | * @return \Ajax\semantic\html\elements\HtmlSegment |
| 105 | 105 | */ |
| 106 | - public function addTab($title,$content){ |
|
| 107 | - return $this->addItem([$title,$content]); |
|
| 106 | + public function addTab($title, $content) { |
|
| 107 | + return $this->addItem([$title, $content]); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | * @param array $params |
| 119 | 119 | * @return \Ajax\semantic\html\elements\HtmlSegment |
| 120 | 120 | */ |
| 121 | - public function forwardTab($index,JsUtils $js,$title,$initialController,$controller,$action,$params=array()){ |
|
| 122 | - if(\array_key_exists($index, $this->content)){ |
|
| 123 | - $this->content[$index]=$js->forward($initialController, $controller, $action,$params); |
|
| 121 | + public function forwardTab($index, JsUtils $js, $title, $initialController, $controller, $action, $params=array()) { |
|
| 122 | + if (\array_key_exists($index, $this->content)) { |
|
| 123 | + $this->content[$index]=$js->forward($initialController, $controller, $action, $params); |
|
| 124 | 124 | return $this->content[$index]; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - return $this->addAndForwardTab($js, $title, $initialController, $controller, $action,$params); |
|
| 127 | + return $this->addAndForwardTab($js, $title, $initialController, $controller, $action, $params); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | * @param $params The parameters to pass to the view |
| 138 | 138 | * @return \Ajax\semantic\html\elements\HtmlSegment |
| 139 | 139 | */ |
| 140 | - public function renderViewTab($index,JsUtils $js,$title,$initialController, $viewName, $params=array()) { |
|
| 141 | - if(\array_key_exists($index, $this->content)){ |
|
| 142 | - $this->content[$index]=$js->renderContent($initialController, $viewName,$params); |
|
| 140 | + public function renderViewTab($index, JsUtils $js, $title, $initialController, $viewName, $params=array()) { |
|
| 141 | + if (\array_key_exists($index, $this->content)) { |
|
| 142 | + $this->content[$index]=$js->renderContent($initialController, $viewName, $params); |
|
| 143 | 143 | return $this->content[$index]; |
| 144 | 144 | } |
| 145 | - return $this->addAndRenderViewTab($js, $title, $initialController, $viewName,$params); |
|
| 145 | + return $this->addAndRenderViewTab($js, $title, $initialController, $viewName, $params); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | * @param array $params |
| 157 | 157 | * @return \Ajax\semantic\html\elements\HtmlSegment |
| 158 | 158 | */ |
| 159 | - public function addAndForwardTab(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){ |
|
| 160 | - return $this->addTab($title, $js->forward($initialController, $controller, $action,$params)); |
|
| 159 | + public function addAndForwardTab(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) { |
|
| 160 | + return $this->addTab($title, $js->forward($initialController, $controller, $action, $params)); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | * @param $params The parameters to pass to the view |
| 170 | 170 | * @return \Ajax\semantic\html\elements\HtmlSegment |
| 171 | 171 | */ |
| 172 | - public function addAndRenderViewTab(JsUtils $js,$title,$initialController, $viewName, $params=array()) { |
|
| 173 | - return $this->addTab($title, $js->renderContent($initialController, $viewName,$params)); |
|
| 172 | + public function addAndRenderViewTab(JsUtils $js, $title, $initialController, $viewName, $params=array()) { |
|
| 173 | + return $this->addTab($title, $js->renderContent($initialController, $viewName, $params)); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | public function setPointing($value=Direction::NONE) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @param int $index |
| 187 | 187 | * @return Ajax\semantic\html\content\HtmlMenuItem |
| 188 | 188 | */ |
| 189 | - public function getMenuTab($index){ |
|
| 189 | + public function getMenuTab($index) { |
|
| 190 | 190 | return $this->content["menu"]->getItem($index); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param int $index |
| 196 | 196 | * @return HtmlSegment |
| 197 | 197 | */ |
| 198 | - public function getTab($index){ |
|
| 198 | + public function getTab($index) { |
|
| 199 | 199 | return $this->content[$index]; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -204,22 +204,22 @@ discard block |
||
| 204 | 204 | * @param HtmlMenu $menu |
| 205 | 205 | * @return \Ajax\semantic\html\modules\HtmlTab |
| 206 | 206 | */ |
| 207 | - public function setMenu($menu){ |
|
| 207 | + public function setMenu($menu) { |
|
| 208 | 208 | $contentSize=\sizeof($this->content); |
| 209 | - for($i=0;$i<$contentSize;$i++){ |
|
| 210 | - if($menu->getItem($i)!==NULL){ |
|
| 211 | - if(isset($this->content[$i])){ |
|
| 212 | - $menu->getItem($i)->addToProperty("data-tab",$this->content[$i]->getProperty("data-tab")); |
|
| 209 | + for ($i=0; $i<$contentSize; $i++) { |
|
| 210 | + if ($menu->getItem($i)!==NULL) { |
|
| 211 | + if (isset($this->content[$i])) { |
|
| 212 | + $menu->getItem($i)->addToProperty("data-tab", $this->content[$i]->getProperty("data-tab")); |
|
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | $menuSize=$menu->count(); |
| 217 | - for($i=0;$i<$menuSize;$i++){ |
|
| 217 | + for ($i=0; $i<$menuSize; $i++) { |
|
| 218 | 218 | $menu->getItem($i)->removeProperty("href"); |
| 219 | - if(isset($this->content[$i])===false){ |
|
| 219 | + if (isset($this->content[$i])===false) { |
|
| 220 | 220 | $this->content[$i]=$this->createSegment($i, "New content", $menu->getItem($i)->getIdentifier()); |
| 221 | 221 | } |
| 222 | - $menu->getItem($i)->addToProperty("data-tab",$this->content[$i]->getProperty("data-tab")); |
|
| 222 | + $menu->getItem($i)->addToProperty("data-tab", $this->content[$i]->getProperty("data-tab")); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $this->content["menu"]=$menu; |
@@ -231,15 +231,15 @@ discard block |
||
| 231 | 231 | * @see BaseHtml::run() |
| 232 | 232 | */ |
| 233 | 233 | public function run(JsUtils $js) { |
| 234 | - if(isset($this->_bsComponent)===false) |
|
| 235 | - $this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params); |
|
| 234 | + if (isset($this->_bsComponent)===false) |
|
| 235 | + $this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item", $this->params); |
|
| 236 | 236 | $this->addEventsOnRun($js); |
| 237 | 237 | return $this->_bsComponent; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 241 | - if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) |
|
| 241 | + if ($this->content["menu"]->count()>0 && \sizeof($this->content)>1) |
|
| 242 | 242 | $this->activate(0); |
| 243 | - return parent::compile($js,$view); |
|
| 243 | + return parent::compile($js, $view); |
|
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | \ No newline at end of file |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function setWidth($width) { |
| 33 | 33 | if (\is_int($width)) { |
| 34 | - $width=Wide::getConstants()["W" . $width]; |
|
| 34 | + $width=Wide::getConstants()["W".$width]; |
|
| 35 | 35 | } |
| 36 | 36 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
| 37 | - return $this->addToPropertyCtrl("class", "wide", array ("wide" )); |
|
| 37 | + return $this->addToPropertyCtrl("class", "wide", array("wide")); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function setValue($value) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $divider->setVertical(); |
| 53 | 53 | else |
| 54 | 54 | $divider->setHorizontal(); |
| 55 | - $this->wrap($divider,""); |
|
| 55 | + $this->wrap($divider, ""); |
|
| 56 | 56 | return $divider; |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -20,8 +20,9 @@ discard block |
||
| 20 | 20 | public function __construct($identifier, $width=NULL) { |
| 21 | 21 | parent::__construct($identifier, "div"); |
| 22 | 22 | $this->setClass("column"); |
| 23 | - if (isset($width)) |
|
| 24 | - $this->setWidth($width); |
|
| 23 | + if (isset($width)) { |
|
| 24 | + $this->setWidth($width); |
|
| 25 | + } |
|
| 25 | 26 | } |
| 26 | 27 | |
| 27 | 28 | /** |
@@ -48,10 +49,11 @@ discard block |
||
| 48 | 49 | |
| 49 | 50 | public function addDivider($vertical=true, $content=NULL) { |
| 50 | 51 | $divider=new HtmlDivider("", $content); |
| 51 | - if ($vertical) |
|
| 52 | - $divider->setVertical(); |
|
| 53 | - else |
|
| 54 | - $divider->setHorizontal(); |
|
| 52 | + if ($vertical) { |
|
| 53 | + $divider->setVertical(); |
|
| 54 | + } else { |
|
| 55 | + $divider->setHorizontal(); |
|
| 56 | + } |
|
| 55 | 57 | $this->wrap($divider,""); |
| 56 | 58 | return $divider; |
| 57 | 59 | } |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | * @return $this |
| 28 | 28 | */ |
| 29 | 29 | public function setOnShow($jsCode) { |
| 30 | - $jsCode=str_ireplace("\"","%quote%", $jsCode); |
|
| 30 | + $jsCode=str_ireplace("\"", "%quote%", $jsCode); |
|
| 31 | 31 | return $this->setParam("onShow", "%function(){".$jsCode."}%"); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function setExclusive($value){ |
|
| 34 | + public function setExclusive($value) { |
|
| 35 | 35 | return $this->setParam("exclusive", $value); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | * @param string $popup the css selector of the popup |
| 41 | 41 | * @return \Ajax\semantic\components\Popup |
| 42 | 42 | */ |
| 43 | - public function setPopup($popup){ |
|
| 43 | + public function setPopup($popup) { |
|
| 44 | 44 | return $this->setParam("popup", $popup); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function setInline($value){ |
|
| 47 | + public function setInline($value) { |
|
| 48 | 48 | return $this->setParam("inline", $value); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public function setPosition($value){ |
|
| 51 | + public function setPosition($value) { |
|
| 52 | 52 | return $this->setParam("position", $value); |
| 53 | 53 | } |
| 54 | 54 | //TODO other events implementation |
@@ -12,34 +12,34 @@ discard block |
||
| 12 | 12 | use Ajax\semantic\html\base\traits\MenuItemTrait; |
| 13 | 13 | |
| 14 | 14 | class HtmlDropdownItem extends HtmlSemDoubleElement { |
| 15 | - use IconTrait,MenuItemTrait; |
|
| 16 | - public function __construct($identifier, $content="",$value=NULL,$image=NULL,$description=NULL) { |
|
| 15 | + use IconTrait, MenuItemTrait; |
|
| 16 | + public function __construct($identifier, $content="", $value=NULL, $image=NULL, $description=NULL) { |
|
| 17 | 17 | parent::__construct($identifier, "a"); |
| 18 | 18 | $this->setClass("item"); |
| 19 | 19 | $this->setContent($content); |
| 20 | - if($value!==NULL) |
|
| 20 | + if ($value!==NULL) |
|
| 21 | 21 | $this->setData($value); |
| 22 | - if($image!==NULL) |
|
| 22 | + if ($image!==NULL) |
|
| 23 | 23 | $this->asMiniAvatar($image); |
| 24 | - if($description!==NULL) |
|
| 24 | + if ($description!==NULL) |
|
| 25 | 25 | $this->setDescription($description); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function setDescription($description){ |
|
| 29 | - $descO=new HtmlDoubleElement("desc-".$this->identifier,"span"); |
|
| 28 | + public function setDescription($description) { |
|
| 29 | + $descO=new HtmlDoubleElement("desc-".$this->identifier, "span"); |
|
| 30 | 30 | $descO->setClass("description"); |
| 31 | 31 | $descO->setContent($description); |
| 32 | - return $this->addContent($descO,true); |
|
| 32 | + return $this->addContent($descO, true); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function setData($value){ |
|
| 35 | + public function setData($value) { |
|
| 36 | 36 | $this->setProperty("data-value", $value); |
| 37 | 37 | return $this; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function asOption(){ |
|
| 40 | + public function asOption() { |
|
| 41 | 41 | $this->tagName="option"; |
| 42 | - if($this->getProperty("data-value")!==null) |
|
| 42 | + if ($this->getProperty("data-value")!==null) |
|
| 43 | 43 | $this->setProperty("value", $this->getProperty("data-value")); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | * @param string $image the image src |
| 48 | 48 | * @return \Ajax\common\html\html5\HtmlImg |
| 49 | 49 | */ |
| 50 | - public function asMiniAvatar($image){ |
|
| 50 | + public function asMiniAvatar($image) { |
|
| 51 | 51 | $this->tagName="div"; |
| 52 | - $img=new HtmlImg("image-".$this->identifier,$image); |
|
| 52 | + $img=new HtmlImg("image-".$this->identifier, $image); |
|
| 53 | 53 | $img->setClass("ui mini avatar image"); |
| 54 | - $this->addContent($img,true); |
|
| 54 | + $this->addContent($img, true); |
|
| 55 | 55 | return $this; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | * @param string $icon |
| 61 | 61 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 62 | 62 | */ |
| 63 | - public function asIcon($caption,$icon){ |
|
| 63 | + public function asIcon($caption, $icon) { |
|
| 64 | 64 | $this->setContent($caption); |
| 65 | - $this->addContent(new HtmlIcon("", $icon),true); |
|
| 65 | + $this->addContent(new HtmlIcon("", $icon), true); |
|
| 66 | 66 | return $this; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -71,23 +71,23 @@ discard block |
||
| 71 | 71 | * @param string $color |
| 72 | 72 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 73 | 73 | */ |
| 74 | - public function asCircularLabel($caption,$color){ |
|
| 74 | + public function asCircularLabel($caption, $color) { |
|
| 75 | 75 | $this->setContent($caption); |
| 76 | 76 | $lbl=new HtmlLabel(""); |
| 77 | 77 | $lbl->setCircular()->setColor($color)->setEmpty(); |
| 78 | - $this->addContent($lbl,true); |
|
| 78 | + $this->addContent($lbl, true); |
|
| 79 | 79 | return $this; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | public function addMenuItem($items) { |
| 85 | - $menu=new HtmlMenu("menu-" . $this->identifier, $items); |
|
| 85 | + $menu=new HtmlMenu("menu-".$this->identifier, $items); |
|
| 86 | 86 | $content=$this->content; |
| 87 | 87 | $this->setTagName("div"); |
| 88 | 88 | $this->setProperty("class", "item"); |
| 89 | 89 | $icon=new HtmlIcon("", "dropdown"); |
| 90 | - $this->content=[$icon,new HtmlSemDoubleElement("","span","text",$content),$menu]; |
|
| 90 | + $this->content=[$icon, new HtmlSemDoubleElement("", "span", "text", $content), $menu]; |
|
| 91 | 91 | return $menu; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | * @param string $icon |
| 97 | 97 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 98 | 98 | */ |
| 99 | - public static function searchInput($placeholder=NULL,$icon=NULL){ |
|
| 100 | - return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon); |
|
| 99 | + public static function searchInput($placeholder=NULL, $icon=NULL) { |
|
| 100 | + return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | 104 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 105 | 105 | */ |
| 106 | - public static function divider(){ |
|
| 106 | + public static function divider() { |
|
| 107 | 107 | return (new HtmlDropdownItem(""))->asDivider(); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @param string $icon |
| 113 | 113 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 114 | 114 | */ |
| 115 | - public static function header($caption=NULL,$icon=NULL){ |
|
| 116 | - return (new HtmlDropdownItem(""))->asHeader($caption,$icon); |
|
| 115 | + public static function header($caption=NULL, $icon=NULL) { |
|
| 116 | + return (new HtmlDropdownItem(""))->asHeader($caption, $icon); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | * @param string $color |
| 122 | 122 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 123 | 123 | */ |
| 124 | - public static function circular($caption,$color){ |
|
| 125 | - return (new HtmlDropdownItem(""))->asCircularLabel($caption,$color); |
|
| 124 | + public static function circular($caption, $color) { |
|
| 125 | + return (new HtmlDropdownItem(""))->asCircularLabel($caption, $color); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | * @param string $icon |
| 131 | 131 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 132 | 132 | */ |
| 133 | - public static function icon($caption,$icon){ |
|
| 134 | - return (new HtmlDropdownItem(""))->asIcon($caption,$icon); |
|
| 133 | + public static function icon($caption, $icon) { |
|
| 134 | + return (new HtmlDropdownItem(""))->asIcon($caption, $icon); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @param unknown $image |
| 140 | 140 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
| 141 | 141 | */ |
| 142 | - public static function avatar($caption,$image){ |
|
| 143 | - return (new HtmlDropdownItem("",$caption))->asMiniAvatar($image); |
|
| 142 | + public static function avatar($caption, $image) { |
|
| 143 | + return (new HtmlDropdownItem("", $caption))->asMiniAvatar($image); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | \ No newline at end of file |
@@ -17,12 +17,15 @@ discard block |
||
| 17 | 17 | parent::__construct($identifier, "a"); |
| 18 | 18 | $this->setClass("item"); |
| 19 | 19 | $this->setContent($content); |
| 20 | - if($value!==NULL) |
|
| 21 | - $this->setData($value); |
|
| 22 | - if($image!==NULL) |
|
| 23 | - $this->asMiniAvatar($image); |
|
| 24 | - if($description!==NULL) |
|
| 25 | - $this->setDescription($description); |
|
| 20 | + if($value!==NULL) { |
|
| 21 | + $this->setData($value); |
|
| 22 | + } |
|
| 23 | + if($image!==NULL) { |
|
| 24 | + $this->asMiniAvatar($image); |
|
| 25 | + } |
|
| 26 | + if($description!==NULL) { |
|
| 27 | + $this->setDescription($description); |
|
| 28 | + } |
|
| 26 | 29 | } |
| 27 | 30 | |
| 28 | 31 | public function setDescription($description){ |
@@ -39,8 +42,9 @@ discard block |
||
| 39 | 42 | |
| 40 | 43 | public function asOption(){ |
| 41 | 44 | $this->tagName="option"; |
| 42 | - if($this->getProperty("data-value")!==null) |
|
| 43 | - $this->setProperty("value", $this->getProperty("data-value")); |
|
| 45 | + if($this->getProperty("data-value")!==null) { |
|
| 46 | + $this->setProperty("value", $this->getProperty("data-value")); |
|
| 47 | + } |
|
| 44 | 48 | } |
| 45 | 49 | |
| 46 | 50 | /** |
@@ -51,8 +51,9 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getSideContent($index){ |
| 53 | 53 | $item= $this->getItem($index); |
| 54 | - if(isset($item)) |
|
| 55 | - return $item->getContent(); |
|
| 54 | + if(isset($item)) { |
|
| 55 | + return $item->getContent(); |
|
| 56 | + } |
|
| 56 | 57 | return null; |
| 57 | 58 | } |
| 58 | 59 | |
@@ -85,15 +86,17 @@ discard block |
||
| 85 | 86 | * @see BaseHtml::run() |
| 86 | 87 | */ |
| 87 | 88 | public function run(JsUtils $js) { |
| 88 | - if (isset($this->_bsComponent) === false) |
|
| 89 | - $this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params); |
|
| 89 | + if (isset($this->_bsComponent) === false) { |
|
| 90 | + $this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params); |
|
| 91 | + } |
|
| 90 | 92 | $this->addEventsOnRun($js); |
| 91 | 93 | return $this->_bsComponent; |
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 96 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 95 | - if($this->_autoActive) |
|
| 96 | - $this->setActiveSide(0); |
|
| 97 | + if($this->_autoActive) { |
|
| 98 | + $this->setActiveSide(0); |
|
| 99 | + } |
|
| 97 | 100 | return parent::compile($js,$view); |
| 98 | 101 | } |
| 99 | 102 | } |
| 100 | 103 | \ No newline at end of file |
@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | use Ajax\common\html\BaseHtml; |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -class HtmlShape extends HtmlSemCollection{ |
|
| 11 | +class HtmlShape extends HtmlSemCollection { |
|
| 12 | 12 | |
| 13 | 13 | protected $_params=array(); |
| 14 | 14 | protected $_autoActive=true; |
| 15 | 15 | |
| 16 | - public function __construct( $identifier, $sides){ |
|
| 17 | - parent::__construct( $identifier, "div", "ui shape"); |
|
| 16 | + public function __construct($identifier, $sides) { |
|
| 17 | + parent::__construct($identifier, "div", "ui shape"); |
|
| 18 | 18 | $this->_template="<%tagName% id='%identifier%' %properties%><div class='sides'>%wrapContentBefore%%content%%wrapContentAfter%</div></%tagName%>"; |
| 19 | 19 | $this->addItems($sides); |
| 20 | 20 | } |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | * {@inheritDoc} |
| 24 | 24 | * @see \Ajax\common\html\HtmlCollection::createItem() |
| 25 | 25 | */ |
| 26 | - protected function createItem($value){ |
|
| 27 | - if(\is_object($value)===false){ |
|
| 28 | - $value=new HtmlSemDoubleElement("","div","content",$value); |
|
| 26 | + protected function createItem($value) { |
|
| 27 | + if (\is_object($value)===false) { |
|
| 28 | + $value=new HtmlSemDoubleElement("", "div", "content", $value); |
|
| 29 | 29 | } |
| 30 | 30 | return new HtmlShapeItem("side-".$this->identifier."-".$this->count(), $value); |
| 31 | 31 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * {@inheritDoc} |
| 35 | 35 | * @see \Ajax\common\html\HtmlCollection::createCondition() |
| 36 | 36 | */ |
| 37 | - protected function createCondition($value){ |
|
| 37 | + protected function createCondition($value) { |
|
| 38 | 38 | return ($value instanceof HtmlShapeItem)===false; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param int $index |
| 43 | 43 | * @return \Ajax\semantic\html\content\HtmlShapeItem |
| 44 | 44 | */ |
| 45 | - public function getSide($index){ |
|
| 45 | + public function getSide($index) { |
|
| 46 | 46 | return $this->getItem($index); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -50,96 +50,96 @@ discard block |
||
| 50 | 50 | * @param int $index |
| 51 | 51 | * @return mixed|NULL |
| 52 | 52 | */ |
| 53 | - public function getSideContent($index){ |
|
| 54 | - $item= $this->getItem($index); |
|
| 55 | - if(isset($item)) |
|
| 53 | + public function getSideContent($index) { |
|
| 54 | + $item=$this->getItem($index); |
|
| 55 | + if (isset($item)) |
|
| 56 | 56 | return $item->getContent(); |
| 57 | 57 | return null; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public function jsDo($action){ |
|
| 60 | + public function jsDo($action) { |
|
| 61 | 61 | return "$('#".$this->identifier."').shape('".$action."');"; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public function jsFlipLeft(){ |
|
| 64 | + public function jsFlipLeft() { |
|
| 65 | 65 | return $this->jsDo("flip left"); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function jsFlipRight(){ |
|
| 68 | + public function jsFlipRight() { |
|
| 69 | 69 | return $this->jsDo("flip right"); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function jsFlipUp(){ |
|
| 72 | + public function jsFlipUp() { |
|
| 73 | 73 | return $this->jsDo("flip up"); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function jsFlipDown(){ |
|
| 76 | + public function jsFlipDown() { |
|
| 77 | 77 | return $this->jsDo("flip down"); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public function jsFlipOver(){ |
|
| 80 | + public function jsFlipOver() { |
|
| 81 | 81 | return $this->jsDo("flip over"); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function jsFlipBack(){ |
|
| 84 | + public function jsFlipBack() { |
|
| 85 | 85 | return $this->jsDo("flip back"); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - private function doActionOn($element,$event,$what){ |
|
| 89 | - if($element instanceof BaseHtml){ |
|
| 90 | - return $element->on($event, $what,true,true); |
|
| 88 | + private function doActionOn($element, $event, $what) { |
|
| 89 | + if ($element instanceof BaseHtml) { |
|
| 90 | + return $element->on($event, $what, true, true); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public function flipLeftOn($element,$event){ |
|
| 94 | + public function flipLeftOn($element, $event) { |
|
| 95 | 95 | return $this->doActionOn($element, $event, $this->jsFlipLeft()); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - public function flipRightOn($element,$event){ |
|
| 98 | + public function flipRightOn($element, $event) { |
|
| 99 | 99 | return $this->doActionOn($element, $event, $this->jsFlipRight()); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - public function flipUpOn($element,$event){ |
|
| 102 | + public function flipUpOn($element, $event) { |
|
| 103 | 103 | return $this->doActionOn($element, $event, $this->jsFlipUp()); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - public function flipDownOn($element,$event){ |
|
| 106 | + public function flipDownOn($element, $event) { |
|
| 107 | 107 | return $this->doActionOn($element, $event, $this->jsFlipDown()); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - public function flipBackOn($element,$event){ |
|
| 110 | + public function flipBackOn($element, $event) { |
|
| 111 | 111 | return $this->doActionOn($element, $event, $this->jsFlipBack()); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - public function flipOverOn($element,$event){ |
|
| 114 | + public function flipOverOn($element, $event) { |
|
| 115 | 115 | return $this->doActionOn($element, $event, $this->jsFlipOver()); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - public function setActiveSide($index){ |
|
| 118 | + public function setActiveSide($index) { |
|
| 119 | 119 | $side=$this->getSide($index); |
| 120 | - if(isset($side)){ |
|
| 120 | + if (isset($side)) { |
|
| 121 | 121 | $side->setActive(true); |
| 122 | 122 | } |
| 123 | 123 | return $this; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - public function asCube(){ |
|
| 126 | + public function asCube() { |
|
| 127 | 127 | return $this->addToPropertyCtrl("class", "cube", ["cube"]); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - public function asText(){ |
|
| 130 | + public function asText() { |
|
| 131 | 131 | return $this->addToPropertyCtrl("class", "text", ["text"]); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - public function setWidth($width="initial"){ |
|
| 134 | + public function setWidth($width="initial") { |
|
| 135 | 135 | $this->_params["width"]=$width; |
| 136 | 136 | } |
| 137 | - public function onChange($jsCode){ |
|
| 138 | - return $this->_params["onChange"]="%function(){" . $jsCode . "}%"; |
|
| 137 | + public function onChange($jsCode) { |
|
| 138 | + return $this->_params["onChange"]="%function(){".$jsCode."}%"; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - public function beforeChange($jsCode){ |
|
| 142 | - return $this->_params["beforeChange"]="%function(){" . $jsCode . "}%"; |
|
| 141 | + public function beforeChange($jsCode) { |
|
| 142 | + return $this->_params["beforeChange"]="%function(){".$jsCode."}%"; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /* |
@@ -147,15 +147,15 @@ discard block |
||
| 147 | 147 | * @see BaseHtml::run() |
| 148 | 148 | */ |
| 149 | 149 | public function run(JsUtils $js) { |
| 150 | - if (isset($this->_bsComponent) === false) |
|
| 151 | - $this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params); |
|
| 150 | + if (isset($this->_bsComponent)===false) |
|
| 151 | + $this->_bsComponent=$js->semantic()->shape("#".$this->identifier, $this->_params); |
|
| 152 | 152 | $this->addEventsOnRun($js); |
| 153 | 153 | return $this->_bsComponent; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 157 | - if($this->_autoActive) |
|
| 157 | + if ($this->_autoActive) |
|
| 158 | 158 | $this->setActiveSide(0); |
| 159 | - return parent::compile($js,$view); |
|
| 159 | + return parent::compile($js, $view); |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | \ No newline at end of file |
@@ -5,13 +5,13 @@ |
||
| 5 | 5 | |
| 6 | 6 | class HtmlShapeItem extends HtmlSemDoubleElement { |
| 7 | 7 | public function __construct($identifier, $content) { |
| 8 | - parent::__construct($identifier,"div","side",$content); |
|
| 8 | + parent::__construct($identifier, "div", "side", $content); |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | - public function setActive($value=true){ |
|
| 12 | - if($value){ |
|
| 11 | + public function setActive($value=true) { |
|
| 12 | + if ($value) { |
|
| 13 | 13 | $this->addToPropertyCtrl("class", "active", ["active"]); |
| 14 | - }else{ |
|
| 14 | + } else { |
|
| 15 | 15 | $this->removePropertyValue("class", "active"); |
| 16 | 16 | } |
| 17 | 17 | return $this; |
@@ -4,6 +4,10 @@ |
||
| 4 | 4 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
| 5 | 5 | |
| 6 | 6 | class HtmlShapeItem extends HtmlSemDoubleElement { |
| 7 | + |
|
| 8 | + /** |
|
| 9 | + * @param string $identifier |
|
| 10 | + */ |
|
| 7 | 11 | public function __construct($identifier, $content) { |
| 8 | 12 | parent::__construct($identifier,"div","side",$content); |
| 9 | 13 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | public function setActive($value=true){ |
| 12 | 12 | if($value){ |
| 13 | 13 | $this->addToPropertyCtrl("class", "active", ["active"]); |
| 14 | - }else{ |
|
| 14 | + } else{ |
|
| 15 | 15 | $this->removePropertyValue("class", "active"); |
| 16 | 16 | } |
| 17 | 17 | return $this; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param int $colCount |
| 19 | 19 | * @return HtmlTable |
| 20 | 20 | */ |
| 21 | - public function htmlTable($identifier, $rowCount, $colCount){ |
|
| 21 | + public function htmlTable($identifier, $rowCount, $colCount) { |
|
| 22 | 22 | return $this->addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount)); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | * @param $styles string|array|NULL |
| 30 | 30 | * @return HtmlMessage |
| 31 | 31 | */ |
| 32 | - public function htmlMessage($identifier, $content="",$styles=NULL) { |
|
| 33 | - $msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
|
| 34 | - if(isset($msg)) |
|
| 32 | + public function htmlMessage($identifier, $content="", $styles=NULL) { |
|
| 33 | + $msg=$this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
|
| 34 | + if (isset($msg)) |
|
| 35 | 35 | $msg->setStyle($styles); |
| 36 | 36 | return $msg; |
| 37 | 37 | } |
@@ -31,8 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function htmlMessage($identifier, $content="",$styles=NULL) { |
| 33 | 33 | $msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
| 34 | - if(isset($msg)) |
|
| 35 | - $msg->setStyle($styles); |
|
| 34 | + if(isset($msg)) { |
|
| 35 | + $msg->setStyle($styles); |
|
| 36 | + } |
|
| 36 | 37 | return $msg; |
| 37 | 38 | } |
| 38 | 39 | |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | * @param string|array $params |
| 128 | 128 | * @return Modal |
| 129 | 129 | */ |
| 130 | - public function modal($attachTo=NULL, $params=NULL,$paramsParts=NULL) { |
|
| 131 | - $result= $this->addComponent(new Modal($this->js), $attachTo, $params); |
|
| 130 | + public function modal($attachTo=NULL, $params=NULL, $paramsParts=NULL) { |
|
| 131 | + $result=$this->addComponent(new Modal($this->js), $attachTo, $params); |
|
| 132 | 132 | $result->setParamParts($paramsParts); |
| 133 | 133 | return $result; |
| 134 | 134 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @return Tab |
| 140 | 140 | */ |
| 141 | 141 | public function tab($attachTo=NULL, $params=NULL) { |
| 142 | - $result= $this->addComponent(new Tab($this->js), $attachTo, $params); |
|
| 142 | + $result=$this->addComponent(new Tab($this->js), $attachTo, $params); |
|
| 143 | 143 | return $result; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @return Shape |
| 150 | 150 | */ |
| 151 | 151 | public function shape($attachTo=NULL, $params=NULL) { |
| 152 | - $result= $this->addComponent(new Shape($this->js), $attachTo, $params); |
|
| 152 | + $result=$this->addComponent(new Shape($this->js), $attachTo, $params); |
|
| 153 | 153 | return $result; |
| 154 | 154 | } |
| 155 | 155 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * @return Form |
| 160 | 160 | */ |
| 161 | 161 | public function form($attachTo=NULL, $params=NULL) { |
| 162 | - $result= $this->addComponent(new Form($this->js), $attachTo, $params); |
|
| 162 | + $result=$this->addComponent(new Form($this->js), $attachTo, $params); |
|
| 163 | 163 | return $result; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -20,15 +20,15 @@ discard block |
||
| 20 | 20 | $this->params["fields"]=[]; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function addField($identifier){ |
|
| 23 | + public function addField($identifier) { |
|
| 24 | 24 | $this->params["fields"][$identifier]=new FieldValidation($identifier); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function setInline($value){ |
|
| 27 | + public function setInline($value) { |
|
| 28 | 28 | return $this->setParam("inline", true); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function setOn($value){ |
|
| 31 | + public function setOn($value) { |
|
| 32 | 32 | return $this->setParam("on", $value); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -40,33 +40,33 @@ discard block |
||
| 40 | 40 | * @param mixed $value |
| 41 | 41 | * @param string|NULL $prompt |
| 42 | 42 | */ |
| 43 | - public function addFieldRule($identifier,$type,$prompt=NULL,$value=NULL){ |
|
| 44 | - if(isset($this->params["fields"][$identifier])===false){ |
|
| 43 | + public function addFieldRule($identifier, $type, $prompt=NULL, $value=NULL) { |
|
| 44 | + if (isset($this->params["fields"][$identifier])===false) { |
|
| 45 | 45 | $this->addField($identifier); |
| 46 | 46 | } |
| 47 | - $this->params["fields"][$identifier]->addRule($type,$prompt,$value); |
|
| 47 | + $this->params["fields"][$identifier]->addRule($type, $prompt, $value); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * @param FieldValidation $fieldValidation |
| 52 | 52 | */ |
| 53 | - public function addFieldValidation($fieldValidation){ |
|
| 53 | + public function addFieldValidation($fieldValidation) { |
|
| 54 | 54 | $this->params["fields"][$fieldValidation->getIdentifier()]=$fieldValidation; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function setJs(JsUtils $js){ |
|
| 57 | + public function setJs(JsUtils $js) { |
|
| 58 | 58 | $this->js=$js; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function getScript() { |
| 62 | 62 | $allParams=$this->params; |
| 63 | - $this->jquery_code_for_compile=array (); |
|
| 63 | + $this->jquery_code_for_compile=array(); |
|
| 64 | 64 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");"; |
| 65 | 65 | $this->compileEvents(); |
| 66 | 66 | return $this->compileJQueryCode(); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public function onValid($jsCode){ |
|
| 69 | + public function onValid($jsCode) { |
|
| 70 | 70 | $this->addComponentEvent("onValid", $jsCode); |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | $this->params["fields"]=[]; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $identifier |
|
| 25 | + */ |
|
| 23 | 26 | public function addField($identifier){ |
| 24 | 27 | $this->params["fields"][$identifier]=new FieldValidation($identifier); |
| 25 | 28 | } |