Issue #1817698 by andyceo: Move contextual links field handler out of views.views.inc and put it into contextual_links() module.

8.0.x
catch 2012-10-29 15:37:46 +00:00
parent b2ca0f4148
commit 97b5c6d732
3 changed files with 26 additions and 13 deletions

View File

@ -0,0 +1,21 @@
<?php
/**
* @file
* Provide views data and handlers for contextual.module.
*
* @ingroup views_module_handlers
*/
/**
* Implements hook_views_data_alter().
*/
function contextual_views_data_alter(&$data) {
$data['views']['contextual_links'] = array(
'title' => t('Contextual Links'),
'help' => t('Display fields in a contextual links menu.'),
'field' => array(
'id' => 'contextual_links',
),
);
}

View File

@ -2,12 +2,13 @@
/**
* @file
* Definition of Drupal\views\Plugin\views\field\ContextualLinks.
* Definition of Drupal\contextual\Plugin\views\field\ContextualLinks.
*/
namespace Drupal\views\Plugin\views\field;
namespace Drupal\contextual\Plugin\views\field;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\field\FieldPluginBase;
/**
* Provides a handler that adds contextual links.
@ -15,7 +16,8 @@ use Drupal\Core\Annotation\Plugin;
* @ingroup views_field_handlers
*
* @Plugin(
* id = "contextual_links"
* id = "contextual_links",
* module = "contextual"
* )
*/
class ContextualLinks extends FieldPluginBase {

View File

@ -90,16 +90,6 @@ function views_views_data() {
),
);
if (module_exists('contextual')) {
$data['views']['contextual_links'] = array(
'title' => t('Contextual Links'),
'help' => t('Display fields in a contextual links menu.'),
'field' => array(
'id' => 'contextual_links',
),
);
}
$data['views']['combine'] = array(
'title' => t('Combine fields filter'),
'help' => t('Combine two fields together and search by them.'),