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
304
Merge Requests
304
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
20edb75f
Commit
20edb75f
authored
Jul 29, 2012
by
dawehner
Committed by
tim.plunkett
Oct 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted locale to plugins
parent
17fa51d0
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
122 additions
and
26 deletions
+122
-26
includes/cache.inc
includes/cache.inc
+2
-2
lib/Drupal/locale/Plugin/views/argument/Group.php
lib/Drupal/locale/Plugin/views/argument/Group.php
+12
-1
lib/Drupal/locale/Plugin/views/argument/Language.php
lib/Drupal/locale/Plugin/views/argument/Language.php
+12
-1
lib/Drupal/locale/Plugin/views/field/Group.php
lib/Drupal/locale/Plugin/views/field/Group.php
+12
-1
lib/Drupal/locale/Plugin/views/field/Language.php
lib/Drupal/locale/Plugin/views/field/Language.php
+12
-1
lib/Drupal/locale/Plugin/views/field/LinkEdit.php
lib/Drupal/locale/Plugin/views/field/LinkEdit.php
+12
-1
lib/Drupal/locale/Plugin/views/field/NodeLanguage.php
lib/Drupal/locale/Plugin/views/field/NodeLanguage.php
+12
-1
lib/Drupal/locale/Plugin/views/filter/Group.php
lib/Drupal/locale/Plugin/views/filter/Group.php
+10
-1
lib/Drupal/locale/Plugin/views/filter/Language.php
lib/Drupal/locale/Plugin/views/filter/Language.php
+4
-1
lib/Drupal/locale/Plugin/views/filter/NodeLanguage.php
lib/Drupal/locale/Plugin/views/filter/NodeLanguage.php
+10
-1
lib/Drupal/locale/Plugin/views/filter/Version.php
lib/Drupal/locale/Plugin/views/filter/Version.php
+10
-1
modules/comment.views.inc
modules/comment.views.inc
+3
-3
modules/locale.views.inc
modules/locale.views.inc
+11
-11
No files found.
includes/cache.inc
View file @
20edb75f
...
...
@@ -87,8 +87,6 @@ function _views_data_process_entity_types(&$data) {
* Fetch the plugin data from cache.
*/
function
_views_fetch_plugin_data
(
$type
=
NULL
,
$plugin_id
=
NULL
,
$reset
=
FALSE
)
{
$manager
=
views_get_plugin_manager
(
$type
);
if
(
!
$type
&&
!
$plugin_id
)
{
$plugins
=
array
();
$plugin_types
=
array
(
'access'
,
'argument_default'
,
'argument_validator'
,
'cache'
,
'display_extender'
,
'display'
,
'exposed_form'
,
'localization'
,
'pager'
,
'query'
,
'row'
,
'style'
,
'wizard'
);
...
...
@@ -99,6 +97,8 @@ function _views_fetch_plugin_data($type = NULL, $plugin_id = NULL, $reset = FALS
return
$plugins
;
}
$manager
=
views_get_plugin_manager
(
$type
);
if
(
!
$plugin_id
)
{
return
$manager
->
getDefinitions
();
}
...
...
lib/Drupal/locale/Plugin/views/argument/
views_handler_argument_locale_group.inc
→
lib/Drupal/locale/Plugin/views/argument/
Group.php
View file @
20edb75f
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_argument_locale_group.
*/
namespace
Drupal\locale\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\ArgumentPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler to accept a language.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_locale_group
extends
views_handler_argument
{
/**
* @Plugin(
* plugin_id = "locale_group"
* )
*/
class
Group
extends
ArgumentPluginBase
{
function
construct
()
{
parent
::
construct
(
'group'
);
}
...
...
lib/Drupal/locale/Plugin/views/argument/
views_handler_argument_locale_language.inc
→
lib/Drupal/locale/Plugin/views/argument/
Language.php
View file @
20edb75f
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_argument_locale_language.
*/
namespace
Drupal\locale\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\ArgumentPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler to accept a language.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_locale_language
extends
views_handler_argument
{
/**
* @Plugin(
* plugin_id = "locale_language"
* )
*/
class
Language
extends
ArgumentPluginBase
{
function
construct
()
{
parent
::
construct
(
'language'
);
}
...
...
lib/Drupal/locale/Plugin/views/field/
views_handler_field_locale_group.inc
→
lib/Drupal/locale/Plugin/views/field/
Group.php
View file @
20edb75f
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_locale_group.
*/
namespace
Drupal\locale\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to translate a group into its readable form.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_locale_group
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "locale_group"
* )
*/
class
Group
extends
FieldPluginBase
{
function
render
(
$values
)
{
$groups
=
module_invoke_all
(
'locale'
,
'groups'
);
// Sort the list.
...
...
lib/Drupal/locale/Plugin/views/field/
views_handler_field_locale_language.inc
→
lib/Drupal/locale/Plugin/views/field/
Language.php
View file @
20edb75f
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_locale_language.
*/
namespace
Drupal\locale\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to translate a language into its readable form.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_locale_language
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "locale_language"
* )
*/
class
Language
extends
FieldPluginBase
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'native_language'
]
=
array
(
'default'
=>
FALSE
,
'bool'
=>
TRUE
);
...
...
lib/Drupal/locale/Plugin/views/field/
views_handler_field_locale_link_edit.inc
→
lib/Drupal/locale/Plugin/views/field/
LinkEdit.php
View file @
20edb75f
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_locale_link_edit.
*/
namespace
Drupal\locale\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to present a link to edit a translation.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_locale_link_edit
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "locale_link_edit"
* )
*/
class
LinkEdit
extends
FieldPluginBase
{
function
construct
()
{
parent
::
construct
();
$this
->
additional_fields
[
'lid'
]
=
'lid'
;
...
...
lib/Drupal/locale/Plugin/views/field/
views_handler_field_node_language.inc
→
lib/Drupal/locale/Plugin/views/field/
NodeLanguage.php
View file @
20edb75f
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_node_language.
*/
namespace
Drupal\locale\Plugin\views\field
;
use
Drupal\node\Plugin\views\field\Node
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to translate a language into its readable form.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_node_language
extends
views_handler_field_node
{
/**
* @Plugin(
* plugin_id = "node_language"
* )
*/
class
NodeLanguage
extends
Node
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'native_language'
]
=
array
(
'default'
=>
FALSE
,
'bool'
=>
TRUE
);
...
...
lib/Drupal/locale/Plugin/views/filter/
views_handler_filter_locale_group.inc
→
lib/Drupal/locale/Plugin/views/filter/
Group.php
View file @
20edb75f
...
...
@@ -5,6 +5,9 @@
* Definition of views_handler_filter_locale_group.
*/
namespace
Drupal\locale\Plugin\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugins\views\filter\InOperator
;
/**
...
...
@@ -12,7 +15,13 @@
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_locale_group
extends
InOperator
{
/**
* @Plugin(
* plugin_id = "locale_group"
* )
*/
class
Group
extends
InOperator
{
function
get_value_options
()
{
if
(
!
isset
(
$this
->
value_options
))
{
$this
->
value_title
=
t
(
'Group'
);
...
...
lib/Drupal/locale/Plugin/views/filter/
views_handler_filter_locale_language.inc
→
lib/Drupal/locale/Plugin/views/filter/
Language.php
View file @
20edb75f
...
...
@@ -5,6 +5,9 @@
* Definition of views_handler_filter_locale_language.
*/
namespace
Drupal\locale\Plugin\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugins\views\filter\InOperator
;
/**
...
...
@@ -12,7 +15,7 @@
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_locale_l
anguage
extends
InOperator
{
class
L
anguage
extends
InOperator
{
function
get_value_options
()
{
if
(
!
isset
(
$this
->
value_options
))
{
$this
->
value_title
=
t
(
'Language'
);
...
...
lib/Drupal/locale/Plugin/views/filter/
views_handler_filter_node_language.inc
→
lib/Drupal/locale/Plugin/views/filter/
NodeLanguage.php
View file @
20edb75f
...
...
@@ -5,6 +5,9 @@
* Definition of views_handler_filter_node_language.
*/
namespace
Drupal\locale\Plugin\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugins\views\filter\InOperator
;
/**
...
...
@@ -12,7 +15,13 @@
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_node_language
extends
InOperator
{
/**
* @Plugin(
* plugin_id = "node_language"
* )
*/
class
NodeLanguage
extends
InOperator
{
function
get_value_options
()
{
if
(
!
isset
(
$this
->
value_options
))
{
$this
->
value_title
=
t
(
'Language'
);
...
...
lib/Drupal/locale/Plugin/views/filter/
views_handler_filter_locale_version.inc
→
lib/Drupal/locale/Plugin/views/filter/
Version.php
View file @
20edb75f
...
...
@@ -5,6 +5,9 @@
* Definition of views_handler_filter_locale_version.
*/
namespace
Drupal\locale\Plugin\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugins\views\filter\InOperator
;
/**
...
...
@@ -12,7 +15,13 @@
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_locale_version
extends
InOperator
{
/**
* @Plugin(
* plugin_id = "locale_version"
* )
*/
class
Version
extends
InOperator
{
function
get_value_options
()
{
if
(
!
isset
(
$this
->
value_options
))
{
$this
->
value_title
=
t
(
'Version'
);
...
...
modules/comment.views.inc
View file @
20edb75f
...
...
@@ -175,14 +175,14 @@ function comment_views_data() {
'title'
=>
t
(
'Language'
),
'help'
=>
t
(
'The language the comment is in.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
locale_language'
,
'
plugin_id'
=>
'
locale_language'
,
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_
locale_language'
,
'
plugin_id'
=>
'
locale_language'
,
),
'argument'
=>
array
(
'
handler'
=>
'views_handler_argument_
locale_language'
,
'
plugin_id'
=>
'
locale_language'
,
),
'sort'
=>
array
(
'plugin_id'
=>
'standard'
,
...
...
modules/locale.views.inc
View file @
20edb75f
...
...
@@ -70,14 +70,14 @@ function locale_views_data() {
'title'
=>
t
(
'Group'
),
'help'
=>
t
(
'The group the translation is in.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
locale_group'
,
'
plugin_id'
=>
'
locale_group'
,
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_
locale_group'
,
'
plugin_id'
=>
'
locale_group'
,
),
'argument'
=>
array
(
'
handler'
=>
'views_handler_argument_
locale_group'
,
'
plugin_id'
=>
'
locale_group'
,
),
);
...
...
@@ -104,7 +104,7 @@ function locale_views_data() {
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_
locale_version'
,
'
plugin_id'
=>
'
locale_version'
,
),
'argument'
=>
array
(
'plugin_id'
=>
'string'
,
...
...
@@ -116,7 +116,7 @@ function locale_views_data() {
'field'
=>
array
(
'title'
=>
t
(
'Edit link'
),
'help'
=>
t
(
'Provide a simple link to edit the translations.'
),
'
handler'
=>
'views_handler_field_
locale_link_edit'
,
'
plugin_id'
=>
'
locale_link_edit'
,
),
);
...
...
@@ -154,14 +154,14 @@ function locale_views_data() {
'title'
=>
t
(
'Language'
),
'help'
=>
t
(
'The language this translation is in.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
locale_language'
,
'
plugin_id'
=>
'
locale_language'
,
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_
locale_language'
,
'
plugin_id'
=>
'
locale_language'
,
),
'argument'
=>
array
(
'
handler'
=>
'views_handler_argument_
locale_language'
,
'
plugin_id'
=>
'
locale_language'
,
),
);
...
...
@@ -205,14 +205,14 @@ function locale_views_data_alter(&$data) {
'title'
=>
t
(
'Language'
),
'help'
=>
t
(
'The language the content is in.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
node_language'
,
'
plugin_id'
=>
'
node_language'
,
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_
node_language'
,
'
plugin_id'
=>
'
node_language'
,
),
'argument'
=>
array
(
'
handler'
=>
'views_handler_argument_
node_language'
,
'
plugin_id'
=>
'
node_language'
,
),
'sort'
=>
array
(
'plugin_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