diff --git a/lib/Views/locale/Plugin/views/argument/Group.php b/lib/Views/locale/Plugin/views/argument/Group.php deleted file mode 100644 index 3a640a54c048a4a0aa98d18ced4816f0cf3d8ddf..0000000000000000000000000000000000000000 --- a/lib/Views/locale/Plugin/views/argument/Group.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * @file - * Definition of views_handler_argument_locale_group. - */ - -namespace Views\locale\Plugin\views\argument; - -use Drupal\views\Plugin\views\argument\ArgumentPluginBase; -use Drupal\Core\Annotation\Plugin; - -/** - * Argument handler to accept a language. - * - * @ingroup views_argument_handlers - * - * @Plugin( - * id = "locale_group", - * module = "locale" - * ) - */ -class Group extends ArgumentPluginBase { - - public function construct() { - parent::construct('group'); - } - - /** - * Override the behavior of summary_name(). Get the user friendly version - * of the group. - */ - function summary_name($data) { - return $this->locale_group($data->{$this->name_alias}); - } - - /** - * Override the behavior of title(). Get the user friendly version - * of the language. - */ - function title() { - return $this->locale_group($this->argument); - } - - function locale_group($group) { - $groups = module_invoke_all('locale', 'groups'); - // Sort the list. - asort($groups); - return isset($groups[$group]) ? $groups[$group] : t('Unknown group'); - } - -} diff --git a/lib/Views/locale/Plugin/views/field/Group.php b/lib/Views/locale/Plugin/views/field/Group.php deleted file mode 100644 index 5d5a7539f9f54a090be69135c94c7e4ff171c39b..0000000000000000000000000000000000000000 --- a/lib/Views/locale/Plugin/views/field/Group.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * @file - * Definition of views_handler_field_locale_group. - */ - -namespace Views\locale\Plugin\views\field; - -use Drupal\views\Plugin\views\field\FieldPluginBase; -use Drupal\Core\Annotation\Plugin; - -/** - * Field handler to translate a group into its readable form. - * - * @ingroup views_field_handlers - * - * @Plugin( - * id = "locale_group", - * module = "locale" - * ) - */ -class Group extends FieldPluginBase { - - function render($values) { - $groups = module_invoke_all('locale', 'groups'); - // Sort the list. - asort($groups); - $value = $this->get_value($values); - return isset($groups[$value]) ? $groups[$value] : ''; - } - -} diff --git a/lib/Views/locale/Plugin/views/filter/Group.php b/lib/Views/locale/Plugin/views/filter/Group.php deleted file mode 100644 index 69e238260b8dcb68d3e73e6036d83c12999a048f..0000000000000000000000000000000000000000 --- a/lib/Views/locale/Plugin/views/filter/Group.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * @file - * Definition of views_handler_filter_locale_group. - */ - -namespace Views\locale\Plugin\views\filter; - -use Drupal\Core\Annotation\Plugin; -use Drupal\views\Plugin\views\filter\InOperator; - -/** - * Filter by locale group. - * - * @ingroup views_filter_handlers - * - * @Plugin( - * id = "locale_group", - * module = "locale" - * ) - */ -class Group extends InOperator { - - function get_value_options() { - if (!isset($this->value_options)) { - $this->value_title = t('Group'); - $groups = module_invoke_all('locale', 'groups'); - // Sort the list. - asort($groups); - $this->value_options = $groups; - } - } - -} diff --git a/modules/locale.views.inc b/modules/locale.views.inc index a18c80ad5a89352c2deae275f1d25ebbea88d851..934a07787a94065764d1ea53dae15b3c572936c1 100644 --- a/modules/locale.views.inc +++ b/modules/locale.views.inc @@ -64,28 +64,24 @@ function locale_views_data() { ), ); - // Group field - $data['locales_source']['textgroup'] = array( + // Source field + $data['locales_source']['source'] = array( 'group' => t('Locale source'), - 'title' => t('Group'), - 'help' => t('The group the translation is in.'), + 'title' => t('Source'), + 'help' => t('The full original string.'), 'field' => array( - 'id' => 'locale_group', - 'click sortable' => TRUE, + 'id' => 'standard', ), 'filter' => array( - 'id' => 'locale_group', - ), - 'argument' => array( - 'id' => 'locale_group', + 'id' => 'string', ), ); // Source field - $data['locales_source']['source'] = array( + $data['locales_source']['context'] = array( 'group' => t('Locale source'), - 'title' => t('Source'), - 'help' => t('The full original string.'), + 'title' => t('Context'), + 'help' => t('The context this string applies to.'), 'field' => array( 'id' => 'standard', ),