@@ -36,6 +36,10 @@ discard block |
||
36 | 36 | protected $_targetSelector; |
37 | 37 | protected $_checkedMessage; |
38 | 38 | |
39 | + /** |
|
40 | + * @param string $identifier |
|
41 | + * @param string $model |
|
42 | + */ |
|
39 | 43 | public function __construct($identifier,$model,$modelInstance=NULL) { |
40 | 44 | parent::__construct($identifier, $model,$modelInstance); |
41 | 45 | $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0,0), false); |
@@ -75,6 +79,9 @@ discard block |
||
75 | 79 | if(allChecked) {\$parentCheckbox.checkbox('set checked');}else if(allUnchecked){\$parentCheckbox.checkbox('set unchecked');}else{\$parentCheckbox.checkbox('set indeterminate');};".$checkedMessageCall); |
76 | 80 | } |
77 | 81 | |
82 | + /** |
|
83 | + * @param string $op |
|
84 | + */ |
|
78 | 85 | protected function _generateBehavior($op,JsUtils $js){ |
79 | 86 | if(isset($this->_urls[$op])) |
80 | 87 | $js->getOnClick("#".$this->identifier." .".$op, $this->_urls[$op],$this->getTargetSelector(),["preventDefault"=>false,"attr"=>"data-ajax"]); |
@@ -210,6 +217,9 @@ discard block |
||
210 | 217 | return $this; |
211 | 218 | } |
212 | 219 | |
220 | + /** |
|
221 | + * @param PositionInTable $part |
|
222 | + */ |
|
213 | 223 | private function addToolbarRow($part,$table,$captions){ |
214 | 224 | $hasPart=$table->hasPart($part); |
215 | 225 | if($hasPart){ |
@@ -12,14 +12,27 @@ discard block |
||
12 | 12 | * @property InstanceViewer $_instanceViewer |
13 | 13 | */ |
14 | 14 | trait DataTableFieldAsTrait{ |
15 | + |
|
16 | + /** |
|
17 | + * @param \Closure $field |
|
18 | + */ |
|
15 | 19 | abstract public function addField($field); |
20 | + |
|
21 | + /** |
|
22 | + * @param integer $index |
|
23 | + * @param \Closure $field |
|
24 | + */ |
|
16 | 25 | abstract public function insertField($index,$field); |
26 | + |
|
27 | + /** |
|
28 | + * @param \Closure $field |
|
29 | + */ |
|
17 | 30 | abstract public function insertInField($index,$field); |
18 | 31 | /** |
19 | 32 | * @param string $caption |
20 | 33 | * @param callable $callback |
21 | 34 | * @param boolean $visibleHover |
22 | - * @return callable |
|
35 | + * @return \Closure |
|
23 | 36 | */ |
24 | 37 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
25 | 38 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -29,7 +42,7 @@ discard block |
||
29 | 42 | * @param callable $thisCallback |
30 | 43 | * @param array $parameters |
31 | 44 | * @param callable $callback |
32 | - * @return callable |
|
45 | + * @return \Closure |
|
33 | 46 | */ |
34 | 47 | private function getCallable($thisCallback,$parameters,$callback=null){ |
35 | 48 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -81,6 +94,9 @@ discard block |
||
81 | 94 | }, $index,$attributes); |
82 | 95 | } |
83 | 96 | |
97 | + /** |
|
98 | + * @param HtmlButton $element |
|
99 | + */ |
|
84 | 100 | protected function _visibleOver($element){ |
85 | 101 | $this->_visibleHover=true; |
86 | 102 | return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;"); |
@@ -91,7 +107,7 @@ discard block |
||
91 | 107 | * @param string $caption |
92 | 108 | * @param callable $callback |
93 | 109 | * @param boolean $visibleHover |
94 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
110 | + * @return DataTableFieldAsTrait |
|
95 | 111 | */ |
96 | 112 | public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
97 | 113 | $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
@@ -103,7 +119,7 @@ discard block |
||
103 | 119 | * @param int $index |
104 | 120 | * @param string $caption |
105 | 121 | * @param callable $callback |
106 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
122 | + * @return DataTableFieldAsTrait |
|
107 | 123 | */ |
108 | 124 | public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
109 | 125 | $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
@@ -115,18 +131,26 @@ discard block |
||
115 | 131 | * @param int $index |
116 | 132 | * @param string $caption |
117 | 133 | * @param callable $callback |
118 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
134 | + * @return DataTableFieldAsTrait |
|
119 | 135 | */ |
120 | 136 | public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
121 | 137 | $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
122 | 138 | return $this; |
123 | 139 | } |
124 | 140 | |
141 | + /** |
|
142 | + * @param string $icon |
|
143 | + * @param string $class |
|
144 | + */ |
|
125 | 145 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
126 | 146 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
127 | 147 | return $this; |
128 | 148 | } |
129 | 149 | |
150 | + /** |
|
151 | + * @param string $icon |
|
152 | + * @param string $class |
|
153 | + */ |
|
130 | 154 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
131 | 155 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
132 | 156 | return $this; |
@@ -71,6 +71,10 @@ discard block |
||
71 | 71 | |
72 | 72 | |
73 | 73 | |
74 | + /** |
|
75 | + * @param string $name |
|
76 | + * @param string[] $typeCtrl |
|
77 | + */ |
|
74 | 78 | protected function setMemberCtrl(&$name, $value, $typeCtrl) { |
75 | 79 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
76 | 80 | return $name=$value; |
@@ -88,6 +92,10 @@ discard block |
||
88 | 92 | |
89 | 93 | |
90 | 94 | |
95 | + /** |
|
96 | + * @param string $name |
|
97 | + * @param string[] $typeCtrl |
|
98 | + */ |
|
91 | 99 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
92 | 100 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
93 | 101 | if (\is_array($typeCtrl)) { |
@@ -98,6 +106,9 @@ discard block |
||
98 | 106 | return $this; |
99 | 107 | } |
100 | 108 | |
109 | + /** |
|
110 | + * @param string $name |
|
111 | + */ |
|
101 | 112 | protected function addToMember(&$name, $value, $separator=" ") { |
102 | 113 | $name=str_ireplace($value, "", $name) . $separator . $value; |
103 | 114 | return $this; |
@@ -52,11 +52,17 @@ discard block |
||
52 | 52 | return $this; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param string $name |
|
57 | + */ |
|
55 | 58 | protected function removePropertyValue($name, $value) { |
56 | 59 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
57 | 60 | return $this; |
58 | 61 | } |
59 | 62 | |
63 | + /** |
|
64 | + * @param string $name |
|
65 | + */ |
|
60 | 66 | protected function removePropertyValues($name, $values) { |
61 | 67 | $this->removeOldValues($this->properties[$name], $values); |
62 | 68 | return $this; |
@@ -71,6 +77,9 @@ discard block |
||
71 | 77 | return $this->addToProperty($name, $value); |
72 | 78 | } |
73 | 79 | |
80 | + /** |
|
81 | + * @param string $name |
|
82 | + */ |
|
74 | 83 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
75 | 84 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
76 | 85 | } |
@@ -82,6 +91,9 @@ discard block |
||
82 | 91 | return $this; |
83 | 92 | } |
84 | 93 | |
94 | + /** |
|
95 | + * @param string $name |
|
96 | + */ |
|
85 | 97 | public function removeProperty($name) { |
86 | 98 | if (\array_key_exists($name, $this->properties)) |
87 | 99 | unset($this->properties[$name]); |
@@ -102,6 +114,10 @@ discard block |
||
102 | 114 | return $this; |
103 | 115 | } |
104 | 116 | |
117 | + /** |
|
118 | + * @param string $propertyName |
|
119 | + * @param string $value |
|
120 | + */ |
|
105 | 121 | protected function getElementByPropertyValue($propertyName,$value, $elements) { |
106 | 122 | if (\is_array($elements)) { |
107 | 123 | $flag=false; |