Conditions | 5 |
Paths | 10 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | function checkViewType($view) { |
||
|
|||
17 | $status = $view->type == t('Default') ? 1 : 0; |
||
18 | if (!$status) { |
||
19 | $name = empty($view->human_name) ? $view->name : $view->human_name; |
||
20 | $result = [ |
||
21 | module_exists('views_ui') |
||
22 | ? l($name, "admin/structure/views/view/{$view->name}/edit") |
||
23 | : $name, |
||
24 | $view->type |
||
25 | ]; |
||
26 | } |
||
27 | else { |
||
28 | $result = NULL; |
||
29 | } |
||
30 | $ret = [ |
||
31 | 'name' => $view->name, |
||
32 | 'status' => $status, |
||
33 | 'result' => $result, |
||
34 | ]; |
||
35 | return $ret; |
||
36 | } |
||
61 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.