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
9f723a46
Commit
9f723a46
authored
Apr 15, 2013
by
Angie Byron
Browse files
Issue
#1968322
by effulgentsia: Remove unused $id and $zebra variables from templates.
parent
677a98f6
Changes
7
Hide whitespace changes
Inline
Side-by-side
core/includes/theme.inc
View file @
9f723a46
...
...
@@ -1147,11 +1147,11 @@ function theme($hook, $variables = array()) {
// a function, but a template overrides that default implementation). In
// these cases, a template should still be able to expect to have access to
// the variables provided by template_preprocess(), so we add them here if
// they don't already exist. We don't want t
o run template_preprocess()
// t
wice (it would be inefficient and mess up zebra striping), so we use the
//
'directory' variable to
determine if it has already run, which while not
//
completely intuitive,
is reasonably safe, and allows us to save on the
//
overhead of adding some
new variable to track that.
// they don't already exist. We don't want t
he overhead of running
// t
emplate_preprocess() twice, so we use the 'directory' variable to
// determine if it has already run, which while not
completely intuitive,
// is reasonably safe, and allows us to save on the
overhead of adding some
// new variable to track that.
if
(
!
isset
(
$variables
[
'directory'
]))
{
$default_template_variables
=
array
();
template_preprocess
(
$default_template_variables
,
$hook
);
...
...
@@ -2615,13 +2615,6 @@ function template_preprocess(&$variables, $hook) {
global
$user
;
static
$count
=
array
(),
$default_attributes
;
// Track run count for each hook to provide zebra striping. See
// "template_preprocess_block()" which provides the same feature specific to
// blocks.
$count
[
$hook
]
=
isset
(
$count
[
$hook
])
&&
is_int
(
$count
[
$hook
])
?
$count
[
$hook
]
:
1
;
$variables
[
'zebra'
]
=
(
$count
[
$hook
]
%
2
)
?
'odd'
:
'even'
;
$variables
[
'id'
]
=
$count
[
$hook
]
++
;
// Tell all templates where they are located.
$variables
[
'directory'
]
=
path_to_theme
();
...
...
core/modules/block/block.module
View file @
9f723a46
...
...
@@ -539,14 +539,6 @@ function template_preprocess_block(&$variables) {
$variables
[
'block'
]
->
label
=
''
;
}
// All blocks get an independent counter for each region.
if
(
!
isset
(
$block_counter
[
$variables
[
'block'
]
->
region
]))
{
$block_counter
[
$variables
[
'block'
]
->
region
]
=
1
;
}
// Same with zebra striping.
$variables
[
'block_zebra'
]
=
(
$block_counter
[
$variables
[
'block'
]
->
region
]
%
2
)
?
'odd'
:
'even'
;
$variables
[
'block_id'
]
=
$block_counter
[
$variables
[
'block'
]
->
region
]
++
;
// Create the $content variable that templates expect.
$variables
[
'content'
]
=
$variables
[
'elements'
][
'#children'
];
...
...
core/modules/block/templates/block.tpl.php
View file @
9f723a46
...
...
@@ -27,10 +27,6 @@
* the template.
*
* Helper variables:
* - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
* - $zebra: Same output as $block_zebra but independent of any block region.
* - $block_id: Counter dependent on each block region.
* - $id: Same output as $block_id but independent of any block region.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
...
...
core/modules/node/templates/node.html.twig
View file @
9f723a46
...
...
@@ -43,9 +43,6 @@
* - comment_count: Number of comments attached to the node.
* - uid: User ID of the node author.
* - created: Time the node was published formatted as a Unix timestamp.
* - zebra: Outputs either "even" or "odd". Useful for zebra striping in
* teaser listings.
* - id: Position of the node. Increments each time it's output.
*
* Node status variables:
* - view_mode: View mode; for example, "teaser" or "full".
...
...
core/modules/node/templates/node.tpl.php
View file @
9f723a46
...
...
@@ -46,9 +46,6 @@
* - $comment_count: Number of comments attached to the node.
* - $uid: User ID of the node author.
* - $created: Time the node was published formatted in Unix timestamp.
* - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
* teaser listings.
* - $id: Position of the node. Increments each time it's output.
*
* Node status variables:
* - $view_mode: View mode; for example, "teaser" or "full".
...
...
core/modules/taxonomy/templates/taxonomy-term.tpl.php
View file @
9f723a46
...
...
@@ -23,9 +23,6 @@
* - $term: Full term object. Contains data that may not be safe.
* - $view_mode: View mode, e.g. 'full', 'teaser'...
* - $page: Flag for the full page state.
* - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
* teaser listings.
* - $id: Position of the term. Increments each time it's output.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
...
...
core/themes/bartik/templates/node.tpl.php
View file @
9f723a46
...
...
@@ -46,9 +46,6 @@
* - $comment_count: Number of comments attached to the node.
* - $uid: User ID of the node author.
* - $created: Time the node was published formatted in Unix timestamp.
* - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
* teaser listings.
* - $id: Position of the node. Increments each time it's output.
*
* Node status variables:
* - $view_mode: View mode; for example, "teaser" or "full".
...
...
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