| Total Complexity | 9 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Overrides extends Views { |
||
| 8 | |||
| 9 | /** |
||
| 10 | * {@inheritdoc] |
||
| 11 | */ |
||
| 12 | public function init() { |
||
| 13 | $this->package_name = __NAMESPACE__; |
||
| 14 | $this->title = t('Non-default views'); |
||
| 15 | $this->description = t('Have any views been overridden or only created in the DB ? This is a performance and change management issue.'); |
||
| 16 | } |
||
| 17 | |||
| 18 | public function checkViewType($view) { |
||
| 19 | $status = $view->type == t('Default') ? 1 : 0; |
||
| 20 | if (!$status) { |
||
| 21 | $name = empty($view->human_name) ? $view->name : $view->human_name; |
||
| 22 | $result = [ |
||
| 23 | module_exists('views_ui') |
||
|
|
|||
| 24 | ? l($name, "admin/structure/views/view/{$view->name}/edit") |
||
| 25 | : $name, |
||
| 26 | $view->type |
||
| 27 | ]; |
||
| 28 | } |
||
| 29 | else { |
||
| 30 | $result = NULL; |
||
| 31 | } |
||
| 32 | $ret = [ |
||
| 33 | 'name' => $view->name, |
||
| 34 | 'status' => $status, |
||
| 35 | 'result' => $result, |
||
| 36 | ]; |
||
| 37 | return $ret; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function run(): Pass { |
||
| 61 | } |
||
| 62 | } |
||
| 63 |