@@ -13,6 +13,9 @@ |
||
13 | 13 | */ |
14 | 14 | class HtmlIconGroups extends HtmlSemCollection { |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $identifier |
|
18 | + */ |
|
16 | 19 | public function __construct($identifier, $icons=array(), $size="") { |
17 | 20 | parent::__construct($identifier, "i", "icons"); |
18 | 21 | $this->addItems($icons); |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | $this->params["fields"]=[]; |
22 | 22 | } |
23 | 23 | |
24 | - public function addField($identifier){ |
|
24 | + public function addField($identifier) { |
|
25 | 25 | $this->params["fields"][$identifier]=new FieldValidation($identifier); |
26 | 26 | } |
27 | 27 | |
28 | - public function setInline($value){ |
|
28 | + public function setInline($value) { |
|
29 | 29 | return $this->setParam("inline", true); |
30 | 30 | } |
31 | 31 | |
32 | - public function setOn($value){ |
|
32 | + public function setOn($value) { |
|
33 | 33 | return $this->setParam("on", $value); |
34 | 34 | } |
35 | 35 | |
@@ -41,27 +41,27 @@ discard block |
||
41 | 41 | * @param mixed $value |
42 | 42 | * @param string|NULL $prompt |
43 | 43 | */ |
44 | - public function addFieldRule($identifier,$type,$prompt=NULL,$value=NULL){ |
|
45 | - if(isset($this->params["fields"][$identifier])===false){ |
|
44 | + public function addFieldRule($identifier, $type, $prompt=NULL, $value=NULL) { |
|
45 | + if (isset($this->params["fields"][$identifier])===false) { |
|
46 | 46 | $this->addField($identifier); |
47 | 47 | } |
48 | - $this->params["fields"][$identifier]->addRule($type,$prompt,$value); |
|
48 | + $this->params["fields"][$identifier]->addRule($type, $prompt, $value); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @param FieldValidation $fieldValidation |
53 | 53 | */ |
54 | - public function addFieldValidation($fieldValidation){ |
|
54 | + public function addFieldValidation($fieldValidation) { |
|
55 | 55 | $this->params["fields"][$fieldValidation->getIdentifier()]=$fieldValidation; |
56 | 56 | } |
57 | 57 | |
58 | - public function setJs(JsUtils $js){ |
|
58 | + public function setJs(JsUtils $js) { |
|
59 | 59 | $this->js=$js; |
60 | 60 | } |
61 | 61 | |
62 | 62 | public function getScript() { |
63 | 63 | $allParams=$this->params; |
64 | - $this->jquery_code_for_compile=array (); |
|
64 | + $this->jquery_code_for_compile=array(); |
|
65 | 65 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");"; |
66 | 66 | $this->compileEvents(); |
67 | 67 | return $this->compileJQueryCode(); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @version 1.001 |
6 | 6 | * Generates a JSON field validator |
7 | 7 | */ |
8 | -class FieldValidation implements \JsonSerializable{ |
|
8 | +class FieldValidation implements \JsonSerializable { |
|
9 | 9 | /** |
10 | 10 | * @var string |
11 | 11 | */ |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | protected $optional; |
24 | 24 | |
25 | - public function __construct($identifier){ |
|
25 | + public function __construct($identifier) { |
|
26 | 26 | $this->identifier=$identifier; |
27 | 27 | $this->rules=[]; |
28 | 28 | } |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | return $this->rules; |
41 | 41 | } |
42 | 42 | |
43 | - public function addRule($type,$prompt=NULL,$value=NULL){ |
|
44 | - if($type instanceof Rule) |
|
43 | + public function addRule($type, $prompt=NULL, $value=NULL) { |
|
44 | + if ($type instanceof Rule) |
|
45 | 45 | $this->rules[]=$type; |
46 | 46 | else |
47 | - $this->rules[]=new Rule($type,$prompt,$value); |
|
47 | + $this->rules[]=new Rule($type, $prompt, $value); |
|
48 | 48 | } |
49 | 49 | |
50 | - public function jsonSerialize(){ |
|
51 | - return ["identifier"=>$this->identifier,"rules"=>$this->rules]; |
|
50 | + public function jsonSerialize() { |
|
51 | + return ["identifier"=>$this->identifier, "rules"=>$this->rules]; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function setDepends($depends) { |
@@ -41,10 +41,11 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function addRule($type,$prompt=NULL,$value=NULL){ |
44 | - if($type instanceof Rule) |
|
45 | - $this->rules[]=$type; |
|
46 | - else |
|
47 | - $this->rules[]=new Rule($type,$prompt,$value); |
|
44 | + if($type instanceof Rule) { |
|
45 | + $this->rules[]=$type; |
|
46 | + } else { |
|
47 | + $this->rules[]=new Rule($type,$prompt,$value); |
|
48 | + } |
|
48 | 49 | } |
49 | 50 | |
50 | 51 | public function jsonSerialize(){ |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @version 1.001 |
6 | 6 | * Generates a JSON Rule for the validation of a field |
7 | 7 | */ |
8 | -class Rule implements \JsonSerializable{ |
|
8 | +class Rule implements \JsonSerializable { |
|
9 | 9 | /** |
10 | 10 | * @var string |
11 | 11 | */ |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | private $value; |
22 | 22 | |
23 | - public function __construct($type,$prompt=NULL,$value=NULL){ |
|
23 | + public function __construct($type, $prompt=NULL, $value=NULL) { |
|
24 | 24 | $this->type=$type; |
25 | 25 | $this->prompt=$prompt; |
26 | 26 | $this->value=$value; |
@@ -54,28 +54,28 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | public function jsonSerialize() { |
57 | - $result= ["type"=>$this->type]; |
|
58 | - if(isset($this->prompt)) |
|
57 | + $result=["type"=>$this->type]; |
|
58 | + if (isset($this->prompt)) |
|
59 | 59 | $result["prompt"]=$this->prompt; |
60 | - if(isset($this->value)) |
|
60 | + if (isset($this->value)) |
|
61 | 61 | $result["value"]=$this->value; |
62 | 62 | return $result; |
63 | 63 | } |
64 | 64 | |
65 | - public static function match($name,$prompt=null){ |
|
66 | - return new Rule("match[".$name."]",$prompt); |
|
65 | + public static function match($name, $prompt=null) { |
|
66 | + return new Rule("match[".$name."]", $prompt); |
|
67 | 67 | } |
68 | 68 | |
69 | - public static function integer($min=0,$max=100,$prompt=null){ |
|
70 | - return new Rule("integer[{$min}..{$max}]",$prompt); |
|
69 | + public static function integer($min=0, $max=100, $prompt=null) { |
|
70 | + return new Rule("integer[{$min}..{$max}]", $prompt); |
|
71 | 71 | } |
72 | 72 | |
73 | - public static function decimal($prompt=null){ |
|
74 | - return new Rule("decimal]",$prompt); |
|
73 | + public static function decimal($prompt=null) { |
|
74 | + return new Rule("decimal]", $prompt); |
|
75 | 75 | } |
76 | 76 | |
77 | - public static function number($prompt=null){ |
|
78 | - return new Rule("number",$prompt); |
|
77 | + public static function number($prompt=null) { |
|
78 | + return new Rule("number", $prompt); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -55,10 +55,12 @@ |
||
55 | 55 | |
56 | 56 | public function jsonSerialize() { |
57 | 57 | $result= ["type"=>$this->type]; |
58 | - if(isset($this->prompt)) |
|
59 | - $result["prompt"]=$this->prompt; |
|
60 | - if(isset($this->value)) |
|
61 | - $result["value"]=$this->value; |
|
58 | + if(isset($this->prompt)) { |
|
59 | + $result["prompt"]=$this->prompt; |
|
60 | + } |
|
61 | + if(isset($this->value)) { |
|
62 | + $result["value"]=$this->value; |
|
63 | + } |
|
62 | 64 | return $result; |
63 | 65 | } |
64 | 66 |
@@ -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 |