embed_views.module in Embed Views Display 7
Same filename and directory in other branches
Integration with the views module to create the new embed views display.
File
embed_views.moduleView 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' => 'embed',
),
),
);
}
/**
* Implements hook_views_plugins_alter().
*
* - Override views' built-in embed display.
*/
function embed_views_views_plugins_alter(&$plugins) {
$embed_views_display = embed_views_views_plugins();
$plugins['display']['embed'] = array_merge($plugins['display']['embed'], $embed_views_display['display']['embed']);
}
/**
* 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
Name![]() |
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 |
embed_views_views_plugins_alter | Implements hook_views_plugins_alter(). |