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

Edit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A rowButton() 0 10 2
1
<?php
2
3
/**
4
 * Data manager edit action
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2016 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Ui\DataManager\Action;
13
14
class Edit extends \Ui\DataManager\Action
15
{
16
    public static $name = 'Редактировать';
17
    public static $groupAction = false;
18
    public static $rowAction = true;
19
20
    public static function rowButton($dataManager, $item, $params, $actionParams)
21
    {
22
        $formParams = [
23
            'dataManagerParams' => $params,
24
            'formName' => !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager'
25
        ];
26
27
        return '<a href ="#" onclick=\'inji.Ui.forms.popUp("' . addcslashes(get_class($item), '\\') . ':' . $item->pk() . '",' . json_encode($formParams) . ');
28
                                      return false;\'><i class="glyphicon glyphicon-edit"></i></a>';
29
    }
30
31
}
32