| Conditions | 6 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | function smarty_function_defaultsort($params, Smarty_Internal_Template $template) |
||
|
|
|||
| 18 | { |
||
| 19 | if (empty($params['id'])) { |
||
| 20 | return ""; |
||
| 21 | } |
||
| 22 | |||
| 23 | $attr = 'data-sortname="' . htmlspecialchars($params['id'], ENT_QUOTES) . '"'; |
||
| 24 | |||
| 25 | if (empty($params['req'])) { |
||
| 26 | return $attr; |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($params['dir'] !== 'asc' && $params['dir'] !== 'desc') { |
||
| 30 | $params['dir'] = 'asc'; |
||
| 31 | } |
||
| 32 | |||
| 33 | $sort = ''; |
||
| 34 | if ($params['req'] === $params['id']) { |
||
| 35 | $sort = ' data-defaultsort="' . htmlspecialchars($params['dir'], ENT_QUOTES) . '"'; |
||
| 36 | } |
||
| 37 | |||
| 38 | return $attr . $sort; |
||
| 39 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.