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
307
Merge Requests
307
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
9965220a
Commit
9965220a
authored
Aug 28, 2012
by
bojanz
Committed by
tim.plunkett
Oct 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1760396
by bojanz: Clean up PrerenderList.
parent
93cbe5c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
50 deletions
+3
-50
lib/Drupal/views/Plugin/views/field/PrerenderList.php
lib/Drupal/views/Plugin/views/field/PrerenderList.php
+1
-48
lib/Views/user/Plugin/views/field/Permissions.php
lib/Views/user/Plugin/views/field/Permissions.php
+1
-1
lib/Views/user/Plugin/views/field/Roles.php
lib/Views/user/Plugin/views/field/Roles.php
+1
-1
No files found.
lib/Drupal/views/Plugin/views/field/PrerenderList.php
View file @
9965220a
...
...
@@ -69,30 +69,6 @@ function options_form(&$form, &$form_state) {
parent
::
options_form
(
$form
,
$form_state
);
}
/**
* Render the field.
*
* This function is deprecated, but left in for older systems that have not
* yet or won't update their prerender list fields. If a render_item method
* exists, this will not get used by advanced_render.
*/
function
render
(
$values
)
{
$field
=
$this
->
get_value
(
$values
);
if
(
!
empty
(
$this
->
items
[
$field
]))
{
if
(
$this
->
options
[
'type'
]
==
'separator'
)
{
return
implode
(
$this
->
sanitize_value
(
$this
->
options
[
'separator'
]),
$this
->
items
[
$field
]);
}
else
{
return
theme
(
'item_list'
,
array
(
'items'
=>
$this
->
items
[
$field
],
'title'
=>
NULL
,
'type'
=>
$this
->
options
[
'type'
]
));
}
}
}
/**
* Render all items in this field together.
*
...
...
@@ -126,8 +102,7 @@ function render_items($items) {
* should also be in this array.
*/
function
get_items
(
$values
)
{
// Only the parent get_value returns a single field.
$field
=
parent
::
get_value
(
$values
);
$field
=
$this
->
get_value
(
$values
);
if
(
!
empty
(
$this
->
items
[
$field
]))
{
return
$this
->
items
[
$field
];
}
...
...
@@ -135,28 +110,6 @@ function get_items($values) {
return
array
();
}
/**
* Get the value that's supposed to be rendered.
*
* @param $values
* An object containing all retrieved values.
* @param $field
* Optional name of the field where the value is stored.
* @param $raw
* Use the raw data and not the data defined in pre_render
*/
function
get_value
(
$values
,
$field
=
NULL
,
$raw
=
FALSE
)
{
if
(
$raw
)
{
return
parent
::
get_value
(
$values
,
$field
);
}
$item
=
$this
->
get_items
(
$values
);
$item
=
(
array
)
$item
;
if
(
isset
(
$field
)
&&
isset
(
$item
[
$field
]))
{
return
$item
[
$field
];
}
return
$item
;
}
/**
* Determine if advanced rendering is allowed.
*
...
...
lib/Views/user/Plugin/views/field/Permissions.php
View file @
9965220a
...
...
@@ -37,7 +37,7 @@ function pre_render(&$values) {
$this
->
items
=
array
();
foreach
(
$values
as
$result
)
{
$uids
[]
=
$this
->
get_value
(
$result
,
NULL
,
TRUE
);
$uids
[]
=
$this
->
get_value
(
$result
);
}
if
(
$uids
)
{
...
...
lib/Views/user/Plugin/views/field/Roles.php
View file @
9965220a
...
...
@@ -37,7 +37,7 @@ function pre_render(&$values) {
$this
->
items
=
array
();
foreach
(
$values
as
$result
)
{
$uids
[]
=
$this
->
get_value
(
$result
,
NULL
,
TRUE
);
$uids
[]
=
$this
->
get_value
(
$result
);
}
if
(
$uids
)
{
...
...
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