@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | private static function tagAttributes($tag, $items) |
47 | 47 | { |
48 | 48 | $attr = $tag === 'div' ? |
49 | - ['id' => $items . '-list', 'class' => 'table'] : |
|
50 | - ['id' => $items . '-table', 'data-table' => 'js', |
|
49 | + ['id' => $items . '-list', 'class' => 'table'] : ['id' => $items . '-table', 'data-table' => 'js', |
|
51 | 50 | 'data-sort-a' => self::config('UTF8_ASC_SYMBOL'), |
52 | 51 | 'data-sort-d' => self::config('UTF8_DESC_SYMBOL')]; |
53 | 52 | if (array_key_exists($tag, self::$attributes)) { |
@@ -84,8 +83,7 @@ discard block |
||
84 | 83 | if (isset($arg['width'])) { // Width attribute -> style |
85 | 84 | $width = 'width:' . $arg['width'] . ';'; |
86 | 85 | $arg['style'] = isset($arg['style']) ? |
87 | - $width . $arg['style'] : |
|
88 | - $width; |
|
86 | + $width . $arg['style'] : $width; |
|
89 | 87 | } |
90 | 88 | |
91 | 89 | if (($del = isset($arg['type']) && $arg['type'] == 'delete')) { |
@@ -94,7 +92,7 @@ discard block |
||
94 | 92 | $sort = isset($arg['sort']) ? $arg['sort'] : $col; |
95 | 93 | } |
96 | 94 | |
97 | - return array_diff_key((array) $arg, ['sort', 'type', 'width']); |
|
95 | + return array_diff_key((array)$arg, ['sort', 'type', 'width']); |
|
98 | 96 | } |
99 | 97 | |
100 | 98 | private static function th($i, $attr, $sort, $del, $lbl) |
@@ -106,8 +104,7 @@ discard block |
||
106 | 104 | if (!$del) { |
107 | 105 | if ($sort == self::$t['order']['col']) { |
108 | 106 | $span = self::$t['order']['dir'] === 'desc' ? |
109 | - self::config('UTF8_DESC_SYMBOL') : |
|
110 | - self::config('UTF8_ASC_SYMBOL'); |
|
107 | + self::config('UTF8_DESC_SYMBOL') : self::config('UTF8_ASC_SYMBOL'); |
|
111 | 108 | } else { |
112 | 109 | $span = ""; |
113 | 110 | } |
@@ -126,29 +123,27 @@ discard block |
||
126 | 123 | |
127 | 124 | protected static function request() |
128 | 125 | { |
129 | - $export = function(){ |
|
126 | + $export = function() { |
|
130 | 127 | $exp = filter_input(INPUT_GET, 'export', FILTER_SANITIZE_STRING); |
131 | 128 | return in_array($exp, self::config('SAVES')) ? $exp : false; |
132 | 129 | }; |
133 | - $order_dir = function(){ |
|
130 | + $order_dir = function() { |
|
134 | 131 | $reset = filter_has_var(INPUT_GET, 'col') ? 'asc' : null; |
135 | 132 | return |
136 | 133 | in_array(filter_input(INPUT_GET, 'ord'), ['asc', 'desc']) ? |
137 | - filter_input(INPUT_GET, 'ord') : |
|
138 | - ($reset ?: self::$t['order']['dir']); |
|
134 | + filter_input(INPUT_GET, 'ord') : ($reset ?: self::$t['order']['dir']); |
|
139 | 135 | }; |
140 | - $order_col = function(){ |
|
136 | + $order_col = function() { |
|
141 | 137 | $col = filter_input(INPUT_GET, 'col', FILTER_VALIDATE_INT); |
142 | 138 | if ($col) { |
143 | 139 | return isset(self::$cols[$col][2]['sort']) ? |
144 | - self::$cols[$col][2]['sort'] : |
|
145 | - self::$cols[$col][1]; |
|
140 | + self::$cols[$col][2]['sort'] : self::$cols[$col][1]; |
|
146 | 141 | } |
147 | 142 | return self::$t['order']['col']; |
148 | 143 | }; |
149 | - $filter = function(){ |
|
144 | + $filter = function() { |
|
150 | 145 | $filter = filter_input(INPUT_GET, 'filter') ?: false; |
151 | - $filterByAll = function(){ |
|
146 | + $filterByAll = function() { |
|
152 | 147 | $by = []; |
153 | 148 | foreach (self::$cols as $v) { |
154 | 149 | if (isset($v[2]['sort']) && $v[2]['sort'] === false) { |
@@ -173,10 +168,9 @@ discard block |
||
173 | 168 | } |
174 | 169 | return $filter; |
175 | 170 | }; |
176 | - $page = function(){ |
|
171 | + $page = function() { |
|
177 | 172 | return filter_has_var(INPUT_GET, 'pg') && self::$export == false ? |
178 | - (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) : |
|
179 | - self::$t['page']; |
|
173 | + (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) : self::$t['page']; |
|
180 | 174 | }; |
181 | 175 | |
182 | 176 | self::$export = $export(); |