You are here

views_exposed_groups.install in Views exposed groups 7.2

Views Exposed Groups installation routines.

File

views_exposed_groups.install
View source
<?php

/**
 * @file
 * Views Exposed Groups installation routines.
 */

/**
 * Implements hook_disable().
 */
function views_exposed_groups_disable() {

  // Lists all enabled views that use the plugin.
  // @see better_exposed_filters_disable()
  $plugins = views_plugin_list();
  if (isset($plugins['exposed_form:views_exposed_groups']) && !empty($plugins['exposed_form:views_exposed_groups']['views'])) {
    $items = [];
    foreach ($plugins['exposed_form:views_exposed_groups']['views'] as $name) {
      $items[] = [
        'data' => l($name, 'admin/structure/views/view/' . $name . '/edit'),
      ];
    }
    $options = theme('item_list', [
      'items' => $items,
      'attributes' => [
        'class' => [
          'links',
        ],
      ],
    ]);
    drupal_set_message(t('The following Views are configured with Views Exposed Groups plugin, which is no longer enabled. You must update or disable any Views displays that use this plugin to avoid site errors: !list', [
      '!list' => $options,
    ]), 'warning');
  }
}

Functions

Namesort descending Description
views_exposed_groups_disable Implements hook_disable().