Completed
Push — master ( f81666...55a9f3 )
by Alexey
05:42
created

Href   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A rowButton() 0 11 3
1
<?php
2
3
/**
4
 * Item name
5
 *
6
 * Info
7
 *
8
 * @author Alexey Krupskiy <[email protected]>
9
 * @link http://inji.ru/
10
 * @copyright 2016 Alexey Krupskiy
11
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
12
 */
13
14
namespace Ui\DataManager\Action;
15
16
class Href extends \Ui\DataManager\Action
17
{
18
    public static $name = 'Ссылка';
19
    public static $groupAction = false;
20
    public static $rowAction = true;
21
22
    public static function rowButton($dataManager, $item, $params, $actionParams)
23
    {
24
        $query = [
25
            'item_pk' => $item->pk(),
26
            'time' => time()
27
        ];
28
        if (!empty($actionParams['query'])) {
29
            $query = $query + $actionParams['query'];
30
        }
31
        return "<a class='" . (isset($actionParams['class']) ? $actionParams['class'] : '') . "' href='{$actionParams['href']}?" . http_build_query($query) . "'>{$actionParams['text']}</a>";
32
    }
33
34
}
35