Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
311
Merge Requests
311
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
7c94e489
Commit
7c94e489
authored
Sep 15, 2012
by
dawehner
Committed by
tim.plunkett
Oct 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1783018
by dawehner: Fixed some of locale.views.inc and remove textgroup support.
parent
771925c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
133 deletions
+9
-133
lib/Views/locale/Plugin/views/argument/Group.php
lib/Views/locale/Plugin/views/argument/Group.php
+0
-52
lib/Views/locale/Plugin/views/field/Group.php
lib/Views/locale/Plugin/views/field/Group.php
+0
-33
lib/Views/locale/Plugin/views/filter/Group.php
lib/Views/locale/Plugin/views/filter/Group.php
+0
-35
modules/locale.views.inc
modules/locale.views.inc
+9
-13
No files found.
lib/Views/locale/Plugin/views/argument/Group.php
deleted
100644 → 0
View file @
771925c2
<?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'
);
}
}
lib/Views/locale/Plugin/views/field/Group.php
deleted
100644 → 0
View file @
771925c2
<?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
]
:
''
;
}
}
lib/Views/locale/Plugin/views/filter/Group.php
deleted
100644 → 0
View file @
771925c2
<?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
;
}
}
}
modules/locale.views.inc
View file @
7c94e489
...
...
@@ -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'
,
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment