You are here

embed_views.module in Embed Views Display 6

Same filename and directory in other branches
  1. 7.2 embed_views.module
  2. 7 embed_views.module

Integration with the views module to create the new embed views display.

File

embed_views.module
View source
<?php

/**
 * @file
 * Integration with the views module to create the new embed views display.
 */

/**
 * Advertise the current views api version
 */
function embed_views_api_version() {
  return 2.0;
}

/**
 * Implementation of hook_views_plugins
 */
function embed_views_views_plugins() {
  return array(
    'display' => array(
      'embed' => array(
        'title' => t('Embed'),
        'help' => t('Creates a display specifically for embed.'),
        'handler' => 'embed_views_plugin_display_embed',
        'theme' => 'views_view',
        'theme path' => drupal_get_path('module', 'views') . '/theme',
        'use ajax' => TRUE,
        'use pager' => TRUE,
        'use more' => TRUE,
        'accept attachments' => TRUE,
        'help topic' => 'display-default',
      ),
    ),
  );
}

/**
* Implementation of hook_form_FORM_ID_alter().
*/
function embed_views_form_views_exposed_form_alter(&$form, &$form_state) {

  // Change the action of the form for all embed views.
  if ($form_state['display']->display_plugin == 'embed') {
    $form['#action'] = url(drupal_get_path_alias($_GET['q']));
  }
}

Functions

Namesort descending Description
embed_views_api_version Advertise the current views api version
embed_views_form_views_exposed_form_alter Implementation of hook_form_FORM_ID_alter().
embed_views_views_plugins Implementation of hook_views_plugins