@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | * @author jc |
13 | 13 | * @version 1.001 |
14 | 14 | */ |
15 | -class HtmlLabeledIconMenu extends HtmlMenu{ |
|
15 | +class HtmlLabeledIconMenu extends HtmlMenu { |
|
16 | 16 | |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param string $identifier |
20 | 20 | * @param array $items icons |
21 | 21 | */ |
22 | - public function __construct( $identifier, $items=array()){ |
|
23 | - parent::__construct( $identifier, $items); |
|
22 | + public function __construct($identifier, $items=array()) { |
|
23 | + parent::__construct($identifier, $items); |
|
24 | 24 | $this->addToProperty("class", "labeled icon"); |
25 | 25 | } |
26 | 26 | |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | protected function createItem($value) { |
32 | 32 | $text=""; |
33 | 33 | $v=$value; |
34 | - if(\is_array($value)){ |
|
34 | + if (\is_array($value)) { |
|
35 | 35 | $v=@$value[0]; |
36 | 36 | $text=@$value[1]; |
37 | 37 | } |
38 | 38 | $count=\sizeof($this->content); |
39 | 39 | $value=new HtmlIcon("icon-".$count, $v); |
40 | - $value->wrap("",$text); |
|
41 | - $itemO=new HtmlLink("item-".$count,"",$value); |
|
40 | + $value->wrap("", $text); |
|
41 | + $itemO=new HtmlLink("item-".$count, "", $value); |
|
42 | 42 | return $itemO->setClass("item"); |
43 | 43 | } |
44 | 44 | } |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | * @author jc |
13 | 13 | * @version 1.001 |
14 | 14 | */ |
15 | -class HtmlIconMenu extends HtmlMenu{ |
|
15 | +class HtmlIconMenu extends HtmlMenu { |
|
16 | 16 | |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param string $identifier |
20 | 20 | * @param array $items icons |
21 | 21 | */ |
22 | - public function __construct( $identifier, $items=array()){ |
|
23 | - parent::__construct( $identifier, $items); |
|
22 | + public function __construct($identifier, $items=array()) { |
|
23 | + parent::__construct($identifier, $items); |
|
24 | 24 | $this->addToProperty("class", "icon"); |
25 | 25 | } |
26 | 26 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | protected function createItem($value) { |
33 | 33 | $count=\sizeof($this->content); |
34 | 34 | $value=new HtmlIcon("icon-".$count, $value); |
35 | - $itemO=new HtmlLink("item-".$count,"",$value); |
|
35 | + $itemO=new HtmlLink("item-".$count, "", $value); |
|
36 | 36 | return $itemO->setClass("item"); |
37 | 37 | } |
38 | 38 | } |
@@ -3,5 +3,5 @@ |
||
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | |
5 | 5 | abstract class PositionInTable extends BaseEnum { |
6 | - const BEFORETABLE="beforeTable",AFTERTABLE="afterTable",HEADER="thead",FOOTER="tfoot",BODY="tbody"; |
|
6 | + const BEFORETABLE="beforeTable", AFTERTABLE="afterTable", HEADER="thead", FOOTER="tfoot", BODY="tbody"; |
|
7 | 7 | } |
@@ -10,50 +10,50 @@ |
||
10 | 10 | * @param string $identifier |
11 | 11 | * @param object $modelInstance |
12 | 12 | */ |
13 | - public function __construct($identifier,$modelInstance=null,$fieldsOrder=[],$fieldsDefinition=[],$fields=[],$captions=[],$separators=[]) { |
|
14 | - parent::__construct($identifier,$modelInstance,$fieldsOrder,$fieldsDefinition,$fields,$captions,$separators); |
|
13 | + public function __construct($identifier, $modelInstance=null, $fieldsOrder=[], $fieldsDefinition=[], $fields=[], $captions=[], $separators=[]) { |
|
14 | + parent::__construct($identifier, $modelInstance, $fieldsOrder, $fieldsDefinition, $fields, $captions, $separators); |
|
15 | 15 | } |
16 | 16 | |
17 | - protected function getDefaultModelInstance(){ |
|
17 | + protected function getDefaultModelInstance() { |
|
18 | 18 | return new UserModel(); |
19 | 19 | } |
20 | 20 | |
21 | - public static function regular($identifier,$modelInstance=null){ |
|
22 | - return new FormLogin($identifier,$modelInstance, |
|
23 | - ["message","login","password","remember","forget","submit","error"], |
|
24 | - ["message"=>[["icon"=>"sign in"]],"input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"checkbox","link","submit"=>["green fluid"],"message2"=>[["error"=>true]]], |
|
25 | - ["Connection","login","password","remember","forget","submit","error"], |
|
26 | - ["Please enter login and password to connect","Login","Password","Remember me.","Forgot your password?","Connection"], |
|
27 | - [0,2,4,5,6]); |
|
21 | + public static function regular($identifier, $modelInstance=null) { |
|
22 | + return new FormLogin($identifier, $modelInstance, |
|
23 | + ["message", "login", "password", "remember", "forget", "submit", "error"], |
|
24 | + ["message"=>[["icon"=>"sign in"]], "input0"=>[["rules"=>"empty"]], "input1"=>[["inputType"=>"password", "rules"=>"empty"]], "checkbox", "link", "submit"=>["green fluid"], "message2"=>[["error"=>true]]], |
|
25 | + ["Connection", "login", "password", "remember", "forget", "submit", "error"], |
|
26 | + ["Please enter login and password to connect", "Login", "Password", "Remember me.", "Forgot your password?", "Connection"], |
|
27 | + [0, 2, 4, 5, 6]); |
|
28 | 28 | } |
29 | 29 | |
30 | - public static function smallInline($identifier,$modelInstance=null){ |
|
31 | - $result=new FormLogin($identifier,$modelInstance, |
|
32 | - ["login","password","submit"], |
|
33 | - ["input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"submit"=>["green basic"]], |
|
34 | - ["login","password","submit"], |
|
35 | - ["","","Connection"], |
|
30 | + public static function smallInline($identifier, $modelInstance=null) { |
|
31 | + $result=new FormLogin($identifier, $modelInstance, |
|
32 | + ["login", "password", "submit"], |
|
33 | + ["input0"=>[["rules"=>"empty"]], "input1"=>[["inputType"=>"password", "rules"=>"empty"]], "submit"=>["green basic"]], |
|
34 | + ["login", "password", "submit"], |
|
35 | + ["", "", "Connection"], |
|
36 | 36 | [2]); |
37 | 37 | $result->addDividerBefore(0, "Connection"); |
38 | 38 | return $result; |
39 | 39 | } |
40 | 40 | |
41 | - public static function small($identifier,$modelInstance=null){ |
|
42 | - $result=new FormLogin($identifier,$modelInstance, |
|
43 | - ["login","password","submit"], |
|
44 | - ["input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"submit"=>["green basic"]], |
|
45 | - ["login","password","submit"], |
|
46 | - ["Login","Password","Connection"], |
|
47 | - [1,2]); |
|
41 | + public static function small($identifier, $modelInstance=null) { |
|
42 | + $result=new FormLogin($identifier, $modelInstance, |
|
43 | + ["login", "password", "submit"], |
|
44 | + ["input0"=>[["rules"=>"empty"]], "input1"=>[["inputType"=>"password", "rules"=>"empty"]], "submit"=>["green basic"]], |
|
45 | + ["login", "password", "submit"], |
|
46 | + ["Login", "Password", "Connection"], |
|
47 | + [1, 2]); |
|
48 | 48 | $result->addDividerBefore(0, "Connection"); |
49 | 49 | return $result; |
50 | 50 | } |
51 | 51 | |
52 | - public static function attachedSegment($identifier,$modelInstance=null){ |
|
53 | - $result=self::regular($identifier,$modelInstance); |
|
54 | - $result->fieldAsMessage("message",["icon"=>"sign in","attached"=>true]); |
|
55 | - $result->addWrapper("message",null,"<div class='ui attached segment'>"); |
|
56 | - $result->addWrapper("error", null,"</div>"); |
|
52 | + public static function attachedSegment($identifier, $modelInstance=null) { |
|
53 | + $result=self::regular($identifier, $modelInstance); |
|
54 | + $result->fieldAsMessage("message", ["icon"=>"sign in", "attached"=>true]); |
|
55 | + $result->addWrapper("message", null, "<div class='ui attached segment'>"); |
|
56 | + $result->addWrapper("error", null, "</div>"); |
|
57 | 57 | return $result; |
58 | 58 | } |
59 | 59 | } |
@@ -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 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | protected $attr; |
22 | 22 | |
23 | 23 | |
24 | - public function __construct($identifier,$tagName){ |
|
25 | - parent::__construct($identifier,$tagName); |
|
24 | + public function __construct($identifier, $tagName) { |
|
25 | + parent::__construct($identifier, $tagName); |
|
26 | 26 | $this->root=""; |
27 | 27 | $this->attr="data-ajax"; |
28 | 28 | } |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | * @param string $targetSelector the target of the get |
34 | 34 | * @return HtmlNavElement |
35 | 35 | */ |
36 | - public function autoGetOnClick($targetSelector){ |
|
37 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
36 | + public function autoGetOnClick($targetSelector) { |
|
37 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
38 | 38 | } |
39 | 39 | |
40 | - public function contentAsString(){ |
|
40 | + public function contentAsString() { |
|
41 | 41 | return implode("", $this->content); |
42 | 42 | } |
43 | 43 | } |
@@ -23,19 +23,19 @@ |
||
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | - public function addGlyph($glyphicon,$before=true){ |
|
26 | + public function addGlyph($glyphicon, $before=true) { |
|
27 | 27 | $glyph=new HtmlGlyphicon(""); |
28 | 28 | $glyph->setGlyphicon($glyphicon); |
29 | - $this->addContent($glyph,$before); |
|
29 | + $this->addContent($glyph, $before); |
|
30 | 30 | return $this; |
31 | 31 | } |
32 | 32 | |
33 | - public function wrapContentWithGlyph($glyphBefore,$glyphAfter=""){ |
|
33 | + public function wrapContentWithGlyph($glyphBefore, $glyphAfter="") { |
|
34 | 34 | $before=HtmlGlyphicon::getGlyphicon($glyphBefore)." "; |
35 | 35 | $after=""; |
36 | - if($glyphAfter!==""){ |
|
36 | + if ($glyphAfter!=="") { |
|
37 | 37 | $after=" ".HtmlGlyphicon::getGlyphicon($glyphAfter); |
38 | 38 | } |
39 | - return $this->wrapContent($before,$after); |
|
39 | + return $this->wrapContent($before, $after); |
|
40 | 40 | } |
41 | 41 | } |
@@ -69,7 +69,8 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | public function getPanel($index) { |
72 | - if ($index<sizeof($this->content)) |
|
73 | - return $this->content [$index]; |
|
72 | + if ($index<sizeof($this->content)) { |
|
73 | + return $this->content [$index]; |
|
74 | + } |
|
74 | 75 | } |
75 | 76 | } |
@@ -50,14 +50,14 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * render the content of $controller::$action and set the response to a new panel |
|
54 | - * @param JsUtils $js |
|
55 | - * @param string $title The panel title |
|
56 | - * @param object $initialController |
|
57 | - * @param string $controller a Phalcon controller |
|
58 | - * @param string $action a Phalcon action |
|
59 | - * @param array $params |
|
60 | - */ |
|
53 | + * render the content of $controller::$action and set the response to a new panel |
|
54 | + * @param JsUtils $js |
|
55 | + * @param string $title The panel title |
|
56 | + * @param object $initialController |
|
57 | + * @param string $controller a Phalcon controller |
|
58 | + * @param string $action a Phalcon action |
|
59 | + * @param array $params |
|
60 | + */ |
|
61 | 61 | public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){ |
62 | 62 | return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params)); |
63 | 63 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $this->setClass("panel-group"); |
20 | 20 | $this->setRole("tablist"); |
21 | 21 | $this->setProperty("aria-multiselectable", "true"); |
22 | - $this->content=array (); |
|
22 | + $this->content=array(); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function addPanel($title, $content) { |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | * @param string $viewName |
46 | 46 | * @param array $params The parameters to pass to the view |
47 | 47 | */ |
48 | - public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) { |
|
49 | - return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params)); |
|
48 | + public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) { |
|
49 | + return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | * @param string $action a Phalcon action |
59 | 59 | * @param array $params |
60 | 60 | */ |
61 | - public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){ |
|
62 | - return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params)); |
|
61 | + public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) { |
|
62 | + return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params)); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function run(JsUtils $js) { |
66 | - foreach ( $this->content as $content ) { |
|
66 | + foreach ($this->content as $content) { |
|
67 | 67 | $content->run($js); |
68 | 68 | } |
69 | 69 | } |
@@ -62,15 +62,15 @@ |
||
62 | 62 | */ |
63 | 63 | public function setIdentifier($identifier) { |
64 | 64 | parent::setIdentifier($identifier); |
65 | - if($this->content instanceof HtmlLink){ |
|
65 | + if ($this->content instanceof HtmlLink) { |
|
66 | 66 | $this->content->setIdentifier("link-".$identifier); |
67 | 67 | } |
68 | 68 | } |
69 | - public function setActive($value=true){ |
|
70 | - $this->setProperty("class", ($value)?"active":""); |
|
69 | + public function setActive($value=true) { |
|
70 | + $this->setProperty("class", ($value) ? "active" : ""); |
|
71 | 71 | } |
72 | 72 | |
73 | - public function disable(){ |
|
73 | + public function disable() { |
|
74 | 74 | $this->setProperty("class", "disabled"); |
75 | 75 | } |
76 | 76 | } |