Issue #1817698 by andyceo: Move contextual links field handler out of views.views.inc and put it into contextual_links() module.
parent
b2ca0f4148
commit
97b5c6d732
|
@ -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',
|
||||
),
|
||||
);
|
||||
}
|
|
@ -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 {
|
|
@ -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.'),
|
||||
|
|
Loading…
Reference in New Issue