ShowHideColumns::getMsSearchable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @company MTE Telecom, Ltd.
4
 * @author Ushkov Nikolai <[email protected]>
5
 * Date: 19.04.16
6
 * Time: 13:45
7
 */
8
9
namespace Nnx\DataGrid\Button;
10
11
/**
12
 * Class ShowHideColums
13
 * @package Nnx\DataGrid\Button
14
 */
15
class ShowHideColumns extends Simple
16
{
17
    protected $name ='showhidecolums';
18
19
    protected $title = 'Столбцы';
20
21
    protected $attributes = [
22
        'class' => 'btn btn-default',
23
        'id' => 'show-hide-columns'
24
    ];
25
26
    protected $url = '#';
27
28
    /** @var string  */
29
    protected $msSearchable = false;
30
31
    protected $js =
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $js. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
32
        '$("a#show-hide-columns").on("click", function () {
33
            $("#grid-%gridName%").jqGrid("columnChooser",{
34
                msel_opts : {searchable : %msSearchable%},
35
                jqModal : true,
36
                done: function(perm) {
37
                    NNX.jqGrid.saveColums($(this),perm);
38
                }
39
            });
40
            return false;
41
        });';
42
43
    public function __construct($options)
44
    {
45
        parent::__construct($options);
46
        $this->setJs(preg_replace('/%msSearchable%/', (int)$this->msSearchable, $this->js));
47
    }
48
49
    public function setMsSearchable($msSearchable)
50
    {
51
        $this->msSearchable = $msSearchable;
52
    }
53
54
    public function getMsSearchable()
55
    {
56
        return $this->msSearchable;
57
    }
58
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
59