@@ -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){ |
@@ -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; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @param array|string $properties |
| 22 | - * @return BaseHtml |
|
| 22 | + * @return BaseHtmlPropertiesTrait |
|
| 23 | 23 | */ |
| 24 | 24 | public function setProperties($properties) { |
| 25 | 25 | $this->properties=$properties; |
@@ -58,11 +58,17 @@ discard block |
||
| 58 | 58 | return $this; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $name |
|
| 63 | + */ |
|
| 61 | 64 | protected function removePropertyValue($name, $value) { |
| 62 | 65 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
| 63 | 66 | return $this; |
| 64 | 67 | } |
| 65 | 68 | |
| 69 | + /** |
|
| 70 | + * @param string $name |
|
| 71 | + */ |
|
| 66 | 72 | protected function removePropertyValues($name, $values) { |
| 67 | 73 | $this->removeOldValues($this->properties[$name], $values); |
| 68 | 74 | return $this; |
@@ -77,6 +83,9 @@ discard block |
||
| 77 | 83 | return $this->addToProperty($name, $value); |
| 78 | 84 | } |
| 79 | 85 | |
| 86 | + /** |
|
| 87 | + * @param string $name |
|
| 88 | + */ |
|
| 80 | 89 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
| 81 | 90 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
| 82 | 91 | } |
@@ -88,6 +97,9 @@ discard block |
||
| 88 | 97 | return $this; |
| 89 | 98 | } |
| 90 | 99 | |
| 100 | + /** |
|
| 101 | + * @param string $name |
|
| 102 | + */ |
|
| 91 | 103 | public function removeProperty($name) { |
| 92 | 104 | if (\array_key_exists($name, $this->properties)) |
| 93 | 105 | unset($this->properties[$name]); |
@@ -108,6 +120,10 @@ discard block |
||
| 108 | 120 | return $this; |
| 109 | 121 | } |
| 110 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $propertyName |
|
| 125 | + * @param string $value |
|
| 126 | + */ |
|
| 111 | 127 | protected function getElementByPropertyValue($propertyName,$value, $elements) { |
| 112 | 128 | if (\is_array($elements)) { |
| 113 | 129 | $flag=false; |
@@ -12,15 +12,28 @@ 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 | abstract public function fieldAs($index,$type,$attributes=NULL); |
| 19 | 32 | /** |
| 20 | 33 | * @param string $caption |
| 21 | 34 | * @param callable $callback |
| 22 | 35 | * @param boolean $visibleHover |
| 23 | - * @return callable |
|
| 36 | + * @return \Closure |
|
| 24 | 37 | */ |
| 25 | 38 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
| 26 | 39 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -30,7 +43,7 @@ discard block |
||
| 30 | 43 | * @param callable $thisCallback |
| 31 | 44 | * @param array $parameters |
| 32 | 45 | * @param callable $callback |
| 33 | - * @return callable |
|
| 46 | + * @return \Closure |
|
| 34 | 47 | */ |
| 35 | 48 | private function getCallable($thisCallback,$parameters,$callback=null){ |
| 36 | 49 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -82,6 +95,9 @@ discard block |
||
| 82 | 95 | }, $index,$attributes); |
| 83 | 96 | } |
| 84 | 97 | |
| 98 | + /** |
|
| 99 | + * @param HtmlButton $element |
|
| 100 | + */ |
|
| 85 | 101 | protected function _visibleOver($element){ |
| 86 | 102 | $this->_visibleHover=true; |
| 87 | 103 | return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;"); |
@@ -92,7 +108,7 @@ discard block |
||
| 92 | 108 | * @param string $caption |
| 93 | 109 | * @param callable $callback |
| 94 | 110 | * @param boolean $visibleHover |
| 95 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 111 | + * @return DataTableFieldAsTrait |
|
| 96 | 112 | */ |
| 97 | 113 | public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
| 98 | 114 | $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
@@ -104,7 +120,7 @@ discard block |
||
| 104 | 120 | * @param int $index |
| 105 | 121 | * @param string $caption |
| 106 | 122 | * @param callable $callback |
| 107 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 123 | + * @return DataTableFieldAsTrait |
|
| 108 | 124 | */ |
| 109 | 125 | public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 110 | 126 | $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
@@ -116,18 +132,26 @@ discard block |
||
| 116 | 132 | * @param int $index |
| 117 | 133 | * @param string $caption |
| 118 | 134 | * @param callable $callback |
| 119 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 135 | + * @return DataTableFieldAsTrait |
|
| 120 | 136 | */ |
| 121 | 137 | public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 122 | 138 | $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
| 123 | 139 | return $this; |
| 124 | 140 | } |
| 125 | 141 | |
| 142 | + /** |
|
| 143 | + * @param string $icon |
|
| 144 | + * @param string $class |
|
| 145 | + */ |
|
| 126 | 146 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
| 127 | 147 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 128 | 148 | return $this; |
| 129 | 149 | } |
| 130 | 150 | |
| 151 | + /** |
|
| 152 | + * @param string $icon |
|
| 153 | + * @param string $class |
|
| 154 | + */ |
|
| 131 | 155 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
| 132 | 156 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 133 | 157 | return $this; |