summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-09 01:00:08 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-09 01:00:08 +0000
commitc05f2181dc8556cb6700e8c6bb6e6ded43273192 (patch)
tree5446facb7f5f18dfaac48aade56c0d86f1477fff /themes
parent48dd14a898420ae98984c951f59e8d299080bee8 (diff)
downloadbrdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.gz
brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.bz2
- Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot.
Diffstat (limited to 'themes')
-rw-r--r--themes/garland/template.php22
-rw-r--r--themes/seven/template.php16
2 files changed, 23 insertions, 15 deletions
diff --git a/themes/garland/template.php b/themes/garland/template.php
index 154216c41..a3fccfb6f 100644
--- a/themes/garland/template.php
+++ b/themes/garland/template.php
@@ -8,7 +8,9 @@
* An array containing the breadcrumb links.
* @return a string containing the breadcrumb output.
*/
-function garland_breadcrumb($breadcrumb) {
+function garland_breadcrumb($variables) {
+ $breadcrumb = $variables['breadcrumb'];
+
if (!empty($breadcrumb)) {
// Provide a navigational heading to give context for breadcrumb links to
// screen-reader users. Make the heading invisible with .element-invisible.
@@ -36,31 +38,33 @@ function garland_process_html(&$vars) {
function garland_preprocess_page(&$vars) {
$vars['tabs2'] = menu_secondary_local_tasks();
if (isset($vars['main_menu'])) {
- $vars['primary_nav'] = theme('links', $vars['main_menu'],
- array(
+ $vars['primary_nav'] = theme('links', array(
+ 'links' => $vars['main_menu'],
+ 'attributes' => array(
'class' => array('links', 'main-menu'),
),
- array(
+ 'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
)
- );
+ ));
}
else {
$vars['primary_nav'] = FALSE;
}
if (isset($vars['secondary_menu'])) {
- $vars['secondary_nav'] = theme('links', $vars['secondary_menu'],
- array(
+ $vars['secondary_nav'] = theme('links', array(
+ 'links' => $vars['secondary_menu'],
+ 'attributes' => array(
'class' => array('links', 'secondary-menu'),
),
- array(
+ 'heading' => array(
'text' => t('Secondary menu'),
'level' => 'h2',
'class' => array('element-invisible'),
)
- );
+ ));
}
else {
$vars['secondary_nav'] = FALSE;
diff --git a/themes/seven/template.php b/themes/seven/template.php
index 6f40681ff..1065b44cf 100644
--- a/themes/seven/template.php
+++ b/themes/seven/template.php
@@ -15,7 +15,8 @@ function seven_preprocess_page(&$vars) {
/**
* Display the list of available node types for node creation.
*/
-function seven_node_add_list($content) {
+function seven_node_add_list($variables) {
+ $content = $variables['content'];
$output = '';
if ($content) {
$output = '<ul class="node-type-list">';
@@ -35,7 +36,8 @@ function seven_node_add_list($content) {
*
* Use unordered list markup in both compact and extended move.
*/
-function seven_admin_block_content($content) {
+function seven_admin_block_content($variables) {
+ $content = $variables['content'];
$output = '';
if (!empty($content)) {
$output = system_admin_compact_mode() ? '<ul class="admin-list compact">' : '<ul class="admin-list">';
@@ -57,13 +59,14 @@ function seven_admin_block_content($content) {
*
* Use our own image versions, so they show up as black and not gray on gray.
*/
-function seven_tablesort_indicator($style) {
+function seven_tablesort_indicator($variables) {
+ $style = $variables['style'];
$theme_path = drupal_get_path('theme', 'seven');
if ($style == "asc") {
- return theme('image', $theme_path . '/images/arrow-asc.png', t('sort icon'), t('sort ascending'));
+ return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort icon'), 'title' => t('sort ascending')));
}
else {
- return theme('image', $theme_path . '/images/arrow-desc.png', t('sort icon'), t('sort descending'));
+ return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort icon'), 'title' => t('sort descending')));
}
}
@@ -72,7 +75,8 @@ function seven_tablesort_indicator($style) {
*
* Add span to legend tag, so we can style it to be inside the fieldset.
*/
-function seven_fieldset($element) {
+function seven_fieldset($variables) {
+ $element = $variables['element'];
if (!empty($element['#collapsible'])) {
drupal_add_js('misc/collapse.js');