diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/block/block.tpl.php | 4 | ||||
-rw-r--r-- | modules/comment/comment-wrapper.tpl.php | 2 | ||||
-rw-r--r-- | modules/comment/comment.tpl.php | 4 | ||||
-rw-r--r-- | modules/field/field.module | 16 | ||||
-rw-r--r-- | modules/field/theme/field.tpl.php | 6 | ||||
-rw-r--r-- | modules/node/node.tpl.php | 4 |
6 files changed, 26 insertions, 10 deletions
diff --git a/modules/block/block.tpl.php b/modules/block/block.tpl.php index 77b1fa938..961cb01b0 100644 --- a/modules/block/block.tpl.php +++ b/modules/block/block.tpl.php @@ -35,9 +35,9 @@ * @see template_process() */ ?> -<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="<?php print $classes; ?>"> +<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>> <?php if ($block->subject): ?> - <h2><?php print $block->subject ?></h2> + <h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2> <?php endif;?> <div class="content"> diff --git a/modules/comment/comment-wrapper.tpl.php b/modules/comment/comment-wrapper.tpl.php index aabf3850f..1d1e1fe9b 100644 --- a/modules/comment/comment-wrapper.tpl.php +++ b/modules/comment/comment-wrapper.tpl.php @@ -30,7 +30,7 @@ * @see theme_comment_wrapper() */ ?> -<div id="comments" class="<?php print $classes; ?>"> +<div id="comments" class="<?php print $classes; ?>"<?php print $attributes; ?>> <?php if ($node->type != 'forum'): ?> <h2 class="comments"><?php print t('Comments'); ?></h2> <?php endif; ?> diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index cae102f85..e77785590 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -44,14 +44,14 @@ * @see theme_comment() */ ?> -<div class="<?php print $classes; ?> clearfix"> +<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>> <?php print $picture ?> <?php if ($new): ?> <span class="new"><?php print $new ?></span> <?php endif; ?> - <h3><?php print $title ?></h3> + <h3<?php print $title_attributes; ?>><?php print $title ?></h3> <div class="submitted"> <?php diff --git a/modules/field/field.module b/modules/field/field.module index 487ea3595..75dc3d431 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -756,8 +756,24 @@ function template_preprocess_field(&$variables) { ), ); $variables = array_merge($variables, $additions); + + // Initialize attributes for each item. + foreach ($variables['items'] as $delta => $item) { + $variables['item_attributes_array'][$delta] = array(); + } } /** + * Theme process function for field.tpl.php. + * + * @see field.tpl.php + */ +function template_process_field(&$variables) { + // Flatten out attributes for each item. + foreach ($variables['items'] as $delta => $item) { + $variables['item_attributes'][$delta] = drupal_attributes($variables['item_attributes_array'][$delta]); + } +} +/** * @} End of "defgroup field" */ diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php index 9018f45b5..312c4b844 100644 --- a/modules/field/theme/field.tpl.php +++ b/modules/field/theme/field.tpl.php @@ -39,13 +39,13 @@ */ ?> <?php if ($items) : ?> - <div class="field <?php print $classes; ?> clearfix"> + <div class="field <?php print $classes; ?> clearfix"<?php print $attributes; ?>> <?php if (!$label_hidden) : ?> - <div class="field-label"><?php print $label ?>: </div> + <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>: </div> <?php endif; ?> <div class="field-items"> <?php foreach ($items as $delta => $item) : ?> - <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"><?php print render($item); ?></div> + <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div> <?php endforeach; ?> </div> </div> diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php index c3aa23539..1bc4c2c6e 100644 --- a/modules/node/node.tpl.php +++ b/modules/node/node.tpl.php @@ -70,12 +70,12 @@ * @see template_process() */ ?> -<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"> +<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>> <?php print $user_picture; ?> <?php if (!$page): ?> - <h2><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> + <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> <?php endif; ?> <?php if ($display_submitted || !empty($content['links']['terms'])): ?> |