Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
20edb75f
Commit
20edb75f
authored
Jul 29, 2012
by
Daniel Wehner
Committed by
Tim Plunkett
Oct 21, 2012
Browse files
converted locale to plugins
parent
17fa51d0
Changes
13
Hide whitespace changes
Inline
Side-by-side
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_g
roup.
inc
→
lib/Drupal/locale/Plugin/views/argument/
G
roup.
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_l
anguage.
inc
→
lib/Drupal/locale/Plugin/views/argument/
L
anguage.
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_g
roup.
inc
→
lib/Drupal/locale/Plugin/views/field/
G
roup.
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_l
anguage.
inc
→
lib/Drupal/locale/Plugin/views/field/
L
anguage.
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_l
ink
_e
dit.
inc
→
lib/Drupal/locale/Plugin/views/field/
L
ink
E
dit.
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_n
ode
_l
anguage.
inc
→
lib/Drupal/locale/Plugin/views/field/
N
ode
L
anguage.
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_g
roup.
inc
→
lib/Drupal/locale/Plugin/views/filter/
G
roup.
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_l
anguage.
inc
→
lib/Drupal/locale/Plugin/views/filter/
L
anguage.
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_n
ode
_l
anguage.
inc
→
lib/Drupal/locale/Plugin/views/filter/
N
ode
L
anguage.
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_v
ersion.
inc
→
lib/Drupal/locale/Plugin/views/filter/
V
ersion.
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
Supports
Markdown
0%
Try again
or
attach a new 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