diff --git a/includes/common.inc b/includes/common.inc index 910f4028a9b..a7947828efa 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2286,12 +2286,7 @@ function l($text, $path, array $options = array()) { // Append active class. if (($path == $_GET['q'] || ($path == '' && drupal_is_front_page())) && (empty($options['language']) || $options['language']->language == $language->language)) { - if (isset($options['attributes']['class'])) { - $options['attributes']['class'] .= ' active'; - } - else { - $options['attributes']['class'] = 'active'; - } + $options['attributes']['class'][] = 'active'; } // Remove all HTML and PHP tags from a tooltip. For best performance, we act only @@ -3265,7 +3260,7 @@ function drupal_get_library($module, $name) { * In a situation where a single weight column is being sorted in the table, the * classes could be added like this (in the theme function): * @code - * $form['my_elements'][$delta]['weight']['#attributes']['class'] = "my-elements-weight"; + * $form['my_elements'][$delta]['weight']['#attributes']['class'] = array('my-elements-weight'); * @endcode * * Each row of the table must also have a class of "draggable" in order to enable the @@ -3274,7 +3269,7 @@ function drupal_get_library($module, $name) { * $row = array(...); * $rows[] = array( * 'data' => $row, - * 'class' => 'draggable', + * 'class' => array('draggable'), * ); * @endcode * @@ -3292,7 +3287,7 @@ function drupal_get_library($module, $name) { * the block regions on the admin/structure/block page), a separate subgroup class * must also be added to differentiate the groups. * @code - * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-" . $region; + * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = array('my-elements-weight', 'my-elements-weight-' . $region); * @endcode * * $group is still 'my-element-weight', and the additional $subgroup variable @@ -4262,7 +4257,7 @@ function drupal_common_theme() { 'arguments' => array('display' => NULL), ), 'links' => array( - 'arguments' => array('links' => NULL, 'attributes' => array('class' => 'links')), + 'arguments' => array('links' => NULL, 'attributes' => array('class' => array('links'))), ), 'image' => array( 'arguments' => array('path' => NULL, 'alt' => '', 'title' => '', 'attributes' => array(), 'getsize' => TRUE), diff --git a/includes/form.inc b/includes/form.inc index ee35a6b1639..bfacdad9931 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1595,12 +1595,12 @@ function theme_fieldset($element) { drupal_add_js('misc/collapse.js'); if (!isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = ''; + $element['#attributes']['class'] = array(); } - $element['#attributes']['class'] .= ' collapsible'; + $element['#attributes']['class'][] = 'collapsible'; if (!empty($element['#collapsed'])) { - $element['#attributes']['class'] .= ' collapsed'; + $element['#attributes']['class'][] = 'collapsed'; } } $element['#attributes']['id'] = $element['#id']; @@ -1649,8 +1649,8 @@ function theme_radio($element) { */ function theme_radios($element) { $class = 'form-radios'; - if (isset($element['#attributes']['class'])) { - $class .= ' ' . $element['#attributes']['class']; + if (!empty($element['#attributes']['class'])) { + $class .= ' ' . implode(' ', $element['#attributes']['class']); } $element['#children'] = '
' . (!empty($element['#children']) ? $element['#children'] : '') . '
'; @@ -1666,14 +1666,14 @@ function form_process_password_confirm($element) { '#title' => t('Password'), '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'], '#required' => $element['#required'], - '#attributes' => array('class' => 'password-field'), + '#attributes' => array('class' => array('password-field')), ); $element['pass2'] = array( '#type' => 'password', '#title' => t('Confirm password'), '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'], '#required' => $element['#required'], - '#attributes' => array('class' => 'password-confirm'), + '#attributes' => array('class' => array('password-confirm')), ); $element['#element_validate'] = array('password_confirm_validate'); $element['#tree'] = TRUE; @@ -1986,8 +1986,8 @@ function theme_checkbox($element) { */ function theme_checkboxes($element) { $class = 'form-checkboxes'; - if (isset($element['#attributes']['class'])) { - $class .= ' ' . $element['#attributes']['class']; + if (!empty($element['#attributes']['class'])) { + $class .= ' ' . implode(' ', $element['#attributes']['class']); } $element['#children'] = '
' . (!empty($element['#children']) ? $element['#children'] : '') . '
'; @@ -2049,9 +2049,9 @@ function form_process_checkboxes($element) { * @code * $options = array(); * $options[0]['title'] = "A red row" - * $options[0]['#attributes'] = array ('class' => 'red-row'); + * $options[0]['#attributes'] = array ('class' => array('red-row')); * $options[1]['title'] = "A blue row" - * $options[1]['#attributes'] = array ('class' => 'blue-row'); + * $options[1]['#attributes'] = array ('class' => array('blue-row')); * * $form['myselector'] = array ( * '#type' => 'tableselect', @@ -2278,7 +2278,7 @@ function form_process_vertical_tabs($element, &$form_state) { $element[$name . '__active_tab'] = array( '#type' => 'hidden', '#default_value' => $element['#default_tab'], - '#attributes' => array('class' => 'vertical-tabs-active-tab'), + '#attributes' => array('class' => array('vertical-tabs-active-tab')), ); return $element; @@ -2331,13 +2331,7 @@ function theme_submit($element) { * @ingroup themeable */ function theme_button($element) { - // Make sure not to overwrite classes. - if (isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class']; - } - else { - $element['#attributes']['class'] = 'form-' . $element['#button_type']; - } + $element['#attributes']['class'][] = 'form-' . $element['#button_type']; return '\n"; } @@ -2353,13 +2347,7 @@ function theme_button($element) { * @ingroup themeable */ function theme_image_button($element) { - // Make sure not to overwrite classes. - if (isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class']; - } - else { - $element['#attributes']['class'] = 'form-' . $element['#button_type']; - } + $element['#attributes']['class'][] = 'form-' . $element['#button_type']; return ' 'weight', '#default_value' => $language->weight, - '#attributes' => array('class' => 'language-order-weight'), + '#attributes' => array('class' => array('language-order-weight')), ); $form['name'][$langcode] = array('#markup' => check_plain($language->name)); $form['native'][$langcode] = array('#markup' => check_plain($language->native)); @@ -91,7 +91,7 @@ function theme_locale_languages_overview_form($form) { drupal_render($form['weight'][$key]), l(t('edit'), 'admin/config/regional/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/config/regional/language/delete/' . $key) : '') ), - 'class' => 'draggable' + 'class' => array('draggable'), ); } } @@ -2303,8 +2303,8 @@ function _locale_translate_seek() { array('data' => check_plain(truncate_utf8($string['source'], 150, FALSE, TRUE)) . '
' . $string['location'] . ''), $string['context'], array('data' => _locale_translate_language_list($string['languages'], $limit_language), 'align' => 'center'), - array('data' => l(t('edit'), "admin/config/regional/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'), - array('data' => l(t('delete'), "admin/config/regional/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'), + array('data' => l(t('edit'), "admin/config/regional/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')), + array('data' => l(t('delete'), "admin/config/regional/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')), ); } diff --git a/includes/pager.inc b/includes/pager.inc index 2b6a0329197..26b9eb83345 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -298,13 +298,13 @@ function theme_pager($tags = array(), $element = 0, $parameters = array(), $quan if ($pager_total[$element] > 1) { if ($li_first) { $items[] = array( - 'class' => 'pager-first', + 'class' => array('pager-first'), 'data' => $li_first, ); } if ($li_previous) { $items[] = array( - 'class' => 'pager-previous', + 'class' => array('pager-previous'), 'data' => $li_previous, ); } @@ -313,7 +313,7 @@ function theme_pager($tags = array(), $element = 0, $parameters = array(), $quan if ($i != $pager_max) { if ($i > 1) { $items[] = array( - 'class' => 'pager-ellipsis', + 'class' => array('pager-ellipsis'), 'data' => '…', ); } @@ -321,26 +321,26 @@ function theme_pager($tags = array(), $element = 0, $parameters = array(), $quan for (; $i <= $pager_last && $i <= $pager_max; $i++) { if ($i < $pager_current) { $items[] = array( - 'class' => 'pager-item', + 'class' => array('pager-item'), 'data' => theme('pager_previous', $i, $element, ($pager_current - $i), $parameters), ); } if ($i == $pager_current) { $items[] = array( - 'class' => 'pager-current', + 'class' => array('pager-current'), 'data' => $i, ); } if ($i > $pager_current) { $items[] = array( - 'class' => 'pager-item', + 'class' => array('pager-item'), 'data' => theme('pager_next', $i, $element, ($i - $pager_current), $parameters), ); } } if ($i < $pager_max) { $items[] = array( - 'class' => 'pager-ellipsis', + 'class' => array('pager-ellipsis'), 'data' => '…', ); } @@ -348,17 +348,17 @@ function theme_pager($tags = array(), $element = 0, $parameters = array(), $quan // End generation. if ($li_next) { $items[] = array( - 'class' => 'pager-next', + 'class' => array('pager-next'), 'data' => $li_next, ); } if ($li_last) { $items[] = array( - 'class' => 'pager-last', + 'class' => array('pager-last'), 'data' => $li_last, ); } - return theme('item_list', $items, NULL, 'ul', array('class' => 'pager')); + return theme('item_list', $items, NULL, 'ul', array('class' => array('pager'))); } } diff --git a/includes/tablesort.inc b/includes/tablesort.inc index e6a7b785a2a..8259a9af4d4 100644 --- a/includes/tablesort.inc +++ b/includes/tablesort.inc @@ -185,12 +185,7 @@ function tablesort_header($cell, $header, $ts) { $title = t('sort by @s', array('@s' => $cell['data'])); if ($cell['data'] == $ts['name']) { $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc'); - if (isset($cell['class'])) { - $cell['class'] .= ' active'; - } - else { - $cell['class'] = 'active'; - } + $cell['class'][] = 'active'; $image = theme('tablesort_indicator', $ts['sort']); } else { @@ -228,15 +223,10 @@ function tablesort_header($cell, $header, $ts) { function tablesort_cell($cell, $header, $ts, $i) { if (isset($header[$i]['data']) && $header[$i]['data'] == $ts['name'] && !empty($header[$i]['field'])) { if (is_array($cell)) { - if (isset($cell['class'])) { - $cell['class'] .= ' active'; - } - else { - $cell['class'] = 'active'; - } + $cell['class'][] = 'active'; } else { - $cell = array('data' => $cell, 'class' => 'active'); + $cell = array('data' => $cell, 'class' => array('active')); } } return $cell; diff --git a/includes/theme.inc b/includes/theme.inc index 50c78987b04..d0adb23ed14 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1389,7 +1389,7 @@ function theme_status_messages($display = NULL) { * @return * A string containing an unordered list of links. */ -function theme_links($links, $attributes = array('class' => 'links')) { +function theme_links($links, $attributes = array('class' => array('links'))) { global $language; $output = ''; @@ -1400,18 +1400,18 @@ function theme_links($links, $attributes = array('class' => 'links')) { $i = 1; foreach ($links as $key => $link) { - $class = $key; + $class = array($key); // Add first, last and active classes to the list of links to help out themers. if ($i == 1) { - $class .= ' first'; + $class[] = 'first'; } if ($i == $num_links) { - $class .= ' last'; + $class[] = 'last'; } if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '' && drupal_is_front_page())) && (empty($link['language']) || $link['language']->language == $language->language)) { - $class .= ' active'; + $class[] = 'active'; } $output .= ' $class)) . '>'; @@ -1519,7 +1519,7 @@ function theme_submenu($links) { * ), * // Row with attributes on the row and some of its cells. * array( - * 'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)), 'class' => 'funky' + * 'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)), 'class' => array('funky') * ) * ); * @endverbatim @@ -1541,17 +1541,17 @@ function theme_submenu($links) { * // COLGROUP with one COL element. * array( * array( - * 'class' => 'funky', // Attribute for the COL element. + * 'class' => array('funky'), // Attribute for the COL element. * ), * ), * // Colgroup with attributes and inner COL elements. * array( * 'data' => array( * array( - * 'class' => 'funky', // Attribute for the COL element. + * 'class' => array('funky'), // Attribute for the COL element. * ), * ), - * 'class' => 'jazzy', // Attribute for the COLGROUP element. + * 'class' => array('jazzy'), // Attribute for the COLGROUP element. * ), * ); * @endverbatim @@ -1570,7 +1570,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL, $co drupal_add_js('misc/tableheader.js'); // Add 'sticky-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. - $attributes['class'] = empty($attributes['class']) ? 'sticky-enabled' : ($attributes['class'] . ' sticky-enabled'); + $attributes['class'][] = 'sticky-enabled'; } $output = '\n"; @@ -1656,12 +1656,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL, $co if (count($cells)) { // Add odd/even class $class = $flip[$class]; - if (isset($attributes['class'])) { - $attributes['class'] .= ' ' . $class; - } - else { - $attributes['class'] = $class; - } + $attributes['class'][] = $class; // Build row $output .= ' '; @@ -1686,7 +1681,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL, $co function theme_table_select_header_cell() { drupal_add_js('misc/tableselect.js'); - return array('class' => 'select-all'); + return array('class' => array('select-all')); } /** @@ -1778,10 +1773,10 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu $data .= theme_item_list($children, NULL, $type, $attributes); // Render nested list } if ($i == 0) { - $attributes['class'] = empty($attributes['class']) ? 'first' : ($attributes['class'] . ' first'); + $attributes['class'][] = 'first'; } if ($i == $num_items - 1) { - $attributes['class'] = empty($attributes['class']) ? 'last' : ($attributes['class'] . ' last'); + $attributes['class'][] = 'last'; } $output .= '' . $data . "\n"; } diff --git a/install.php b/install.php index 35f8dc722ef..127076a7f9f 100644 --- a/install.php +++ b/install.php @@ -1561,7 +1561,7 @@ function _install_configure_form(&$form_state, &$install_state) { '#description' => st('Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.'), '#required' => TRUE, '#weight' => -10, - '#attributes' => array('class' => 'username'), + '#attributes' => array('class' => array('username')), ); $form['admin_account']['account']['mail'] = array('#type' => 'textfield', @@ -1601,13 +1601,13 @@ function _install_configure_form(&$form_state, &$install_state) { '#options' => system_time_zones(), '#description' => st('By default, dates in this site will be displayed in the chosen time zone.'), '#weight' => 5, - '#attributes' => array('class' => 'timezone-detect'), + '#attributes' => array('class' => array('timezone-detect')), ); $form['server_settings']['clean_url'] = array( '#type' => 'hidden', '#default_value' => 0, - '#attributes' => array('class' => 'install'), + '#attributes' => array('class' => array('install')), ); $form['update_notifications'] = array( diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc index 2c971fd1463..b6361aba6a4 100644 --- a/modules/aggregator/aggregator.admin.inc +++ b/modules/aggregator/aggregator.admin.inc @@ -30,7 +30,7 @@ function aggregator_view() { $rows[] = array(l($feed->title, "aggregator/sources/$feed->fid"), format_plural($feed->items, '1 item', '@count items'), ($feed->checked ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $feed->checked))) : t('never')), ($feed->checked && $feed->refresh ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - REQUEST_TIME))) : t('never')), l(t('edit'), "admin/settings/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/settings/aggregator/remove/$feed->fid"), l(t('update items'), "admin/settings/aggregator/update/$feed->fid")); } if (empty($rows)) { - $rows[] = array(array('data' => t('No feeds available. Add feed.', array('@link' => url('admin/settings/aggregator/add/feed'))), 'colspan' => '5', 'class' => 'message')); + $rows[] = array(array('data' => t('No feeds available. Add feed.', array('@link' => url('admin/content/aggregator/add/feed'))), 'colspan' => '5', 'class' => array('message'))); } $output .= theme('table', $header, $rows); @@ -44,7 +44,7 @@ function aggregator_view() { $rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '@count items'), l(t('edit'), "admin/settings/aggregator/edit/category/$category->cid")); } if (empty($rows)) { - $rows[] = array(array('data' => t('No categories available. Add category.', array('@link' => url('admin/settings/aggregator/add/category'))), 'colspan' => '5', 'class' => 'message')); + $rows[] = array(array('data' => t('No categories available. Add category.', array('@link' => url('admin/content/aggregator/add/category'))), 'colspan' => '5', 'class' => array('message'))); } $output .= theme('table', $header, $rows); diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc index 29996e5b98b..463872c107b 100644 --- a/modules/aggregator/aggregator.pages.inc +++ b/modules/aggregator/aggregator.pages.inc @@ -242,7 +242,7 @@ function theme_aggregator_categorize_items($form) { foreach (element_children($form['items']) as $key) { $rows[] = array( drupal_render($form['items'][$key]), - array('data' => drupal_render($form['categories'][$key]), 'class' => 'categorize-item'), + array('data' => drupal_render($form['categories'][$key]), 'class' => array('categorize-item')), ); } } diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 436ca29b36e..ddf9a8d4b0b 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -515,12 +515,12 @@ function template_preprocess_block_admin_display_form(&$variables) { $region = $block['region']['#default_value']; // Set special classes needed for table drag and drop. - $variables['form'][$i]['region']['#attributes']['class'] = 'block-region-select block-region-' . $region; - $variables['form'][$i]['weight']['#attributes']['class'] = 'block-weight block-weight-' . $region; + $variables['form'][$i]['region']['#attributes']['class'] = array('block-region-select', 'block-region-' . $region); + $variables['form'][$i]['weight']['#attributes']['class'] = array('block-weight', 'block-weight-' . $region); $variables['block_listing'][$region][$i] = new stdClass(); - $variables['block_listing'][$region][$i]->row_class = isset($block['#attributes']['class']) ? $block['#attributes']['class'] : ''; - $variables['block_listing'][$region][$i]->block_modified = isset($block['#attributes']['class']) && strpos($block['#attributes']['class'], 'block-modified') !== FALSE; + $variables['block_listing'][$region][$i]->row_class = !empty($block['#attributes']['class']) ? implode(' ', $block['#attributes']['class']) : ''; + $variables['block_listing'][$region][$i]->block_modified = !empty($block['#attributes']['class']) && in_array('block-modified', $block['#attributes']['class']); $variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']); $variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']); $variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']); diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 9ca7ff9af90..1c43261a15c 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -28,7 +28,7 @@ function blog_user_view($account) { '#type' => 'user_profile_item', '#title' => t('Blog'), '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => $account->name))))), - '#attributes' => array('class' => 'blog'), + '#attributes' => array('class' => array('blog')), ); } } @@ -79,7 +79,7 @@ function blog_node_view($node, $build_mode = 'full') { $node->content['links']['blog'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); } } diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index 1205a1a3b36..8af9b195cd1 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -236,9 +236,9 @@ function theme_book_admin_table($form) { $href = $form[$key]['href']['#value']; // Add special classes to be used with tabledrag.js. - $form[$key]['plid']['#attributes']['class'] = 'book-plid'; - $form[$key]['mlid']['#attributes']['class'] = 'book-mlid'; - $form[$key]['weight']['#attributes']['class'] = 'book-weight'; + $form[$key]['plid']['#attributes']['class'] = array('book-plid'); + $form[$key]['mlid']['#attributes']['class'] = array('book-mlid'); + $form[$key]['weight']['#attributes']['class'] = array('book-weight'); $data = array( theme('indentation', $form[$key]['depth']['#value'] - 2) . drupal_render($form[$key]['title']), @@ -252,7 +252,7 @@ function theme_book_admin_table($form) { if (isset($form[$key]['#attributes'])) { $row = array_merge($row, $form[$key]['#attributes']); } - $row['class'] = empty($row['class']) ? 'draggable' : $row['class'] . ' draggable'; + $row['class'][] = 'draggable'; $rows[] = $row; } diff --git a/modules/book/book.module b/modules/book/book.module index 3b5e8886899..4e5ac9597eb 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -91,7 +91,7 @@ function book_node_view_link($node, $build_mode) { $node->content['links']['book'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); } } @@ -296,7 +296,7 @@ function book_block_save($delta = '', $edit = array()) { * @ingroup themeable */ function theme_book_title_link($link) { - $link['options']['attributes']['class'] = 'book-title'; + $link['options']['attributes']['class'] = array('book-title'); return l($link['title'], $link['href'], $link['options']); } @@ -416,7 +416,7 @@ function _book_parent_select($book_link) { '#default_value' => $book_link['plid'], '#description' => t('The parent page in the book. The maximum depth for a book and all child pages is !maxdepth. Some pages in the selected book may not be available as parents if selecting them would exceed this limit.', array('!maxdepth' => MENU_MAX_DEPTH)), '#options' => book_toc($book_link['bid'], $book_link['parent_depth_limit'], array($book_link['mlid'])), - '#attributes' => array('class' => 'book-title-select'), + '#attributes' => array('class' => array('book-title-select')), ); } @@ -439,7 +439,7 @@ function _book_add_form_elements(&$form, $node) { '#group' => 'additional_settings', '#attached_js' => array(drupal_get_path('module', 'book') . '/book.js'), '#tree' => TRUE, - '#attributes' => array('class' => 'book-outline-form'), + '#attributes' => array('class' => array('book-outline-form')), ); foreach (array('menu_name', 'mlid', 'nid', 'router_path', 'has_children', 'options', 'module', 'original_bid', 'parent_depth_limit') as $key) { $form['book'][$key] = array( @@ -489,7 +489,7 @@ function _book_add_form_elements(&$form, $node) { '#access' => (bool)$options, '#description' => t('Your page will be a part of the selected book.'), '#weight' => -5, - '#attributes' => array('class' => 'book-title-select'), + '#attributes' => array('class' => array('book-title-select')), '#ajax' => array( 'path' => 'book/js/form', 'wrapper' => 'edit-book-plid-wrapper', diff --git a/modules/book/book.test b/modules/book/book.test index b577cf05d36..bfb093f02d7 100644 --- a/modules/book/book.test +++ b/modules/book/book.test @@ -110,15 +110,15 @@ class BookTestCase extends DrupalWebTestCase { // Check previous, up, and next links. if ($previous) { - $this->assertRaw(l('‹ ' . $previous->title, 'node/' . $previous->nid, array('attributes' => array('class' => 'page-previous', 'title' => t('Go to previous page')))), t('Prevoius page link found.')); + $this->assertRaw(l('‹ ' . $previous->title, 'node/' . $previous->nid, array('attributes' => array('class' => array('page-previous'), 'title' => t('Go to previous page')))), t('Prevoius page link found.')); } if ($up) { - $this->assertRaw(l('up', 'node/' . $up->nid, array('attributes' => array('class' => 'page-up', 'title' => t('Go to parent page')))), t('Up page link found.')); + $this->assertRaw(l('up', 'node/' . $up->nid, array('attributes' => array('class' => array('page-up'), 'title' => t('Go to parent page')))), t('Up page link found.')); } if ($next) { - $this->assertRaw(l($next->title . ' ›', 'node/' . $next->nid, array('attributes' => array('class' => 'page-next', 'title' => t('Go to next page')))), t('Next page link found.')); + $this->assertRaw(l($next->title . ' ›', 'node/' . $next->nid, array('attributes' => array('class' => array('page-next'), 'title' => t('Go to next page')))), t('Next page link found.')); } // Compute the expected breadcrumb. diff --git a/modules/color/color.module b/modules/color/color.module index 691025289e5..d3ddeadc1f7 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -60,7 +60,7 @@ function _color_theme_select_form_alter(&$form, &$form_state) { foreach (element_children($form) as $theme) { if ($screenshot = variable_get('color_' . $theme . '_screenshot')) { if (isset($form[$theme]['screenshot'])) { - $form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE); + $form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => array('screenshot')), FALSE); } } } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index b06b186a400..41c621945d9 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -552,7 +552,7 @@ function comment_node_view($node, $build_mode) { $node->content['links']['comment'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); // Only append comments when we are building a node on its own node detail @@ -825,7 +825,7 @@ function comment_build_content($comment, $build_mode = 'full') { $comment->content['links']['comment'] = array( '#theme' => 'links', '#links' => comment_links($comment), - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); } diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index 43bb48d34ea..9623cc1e8f6 100644 --- a/modules/dblog/dblog.admin.inc +++ b/modules/dblog/dblog.admin.inc @@ -84,7 +84,7 @@ function dblog_overview() { $dblog->link, ), // Attributes for tr - 'class' => "dblog-" . preg_replace('/[^a-z]/i', '-', $dblog->type) . ' ' . $classes[$dblog->severity] + 'class' => array('dblog-' . preg_replace('/[^a-z]/i', '-', $dblog->type), $classes[$dblog->severity]), ); } @@ -196,7 +196,7 @@ function dblog_event($id) { $build['dblog_table'] = array( '#theme' => 'table', '#rows' => $rows, - '#attributes' => array('class' => 'dblog-event'), + '#attributes' => array('class' => array('dblog-event')), ); return $build; } diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 17d79a7a7c3..088642dafa1 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -209,7 +209,7 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form, // the relevant field using these entries. '#field_name' => $field_name, '#bundle' => $instance['bundle'], - '#attributes' => array('class' => 'field-add-more-submit'), + '#attributes' => array('class' => array('field-add-more-submit')), '#language' => $langcode, ); } @@ -236,7 +236,7 @@ function theme_field_multiple_value_form($element) { array( 'data' => '", 'colspan' => 2, - 'class' => 'field-label', + 'class' => array('field-label'), ), t('Order'), ); @@ -257,21 +257,21 @@ function theme_field_multiple_value_form($element) { // Add the items as table rows. foreach ($items as $key => $item) { - $item['_weight']['#attributes']['class'] = $order_class; + $item['_weight']['#attributes']['class'] = array($order_class); $delta_element = drupal_render($item['_weight']); $cells = array( - array('data' => '', 'class' => 'field-multiple-drag'), + array('data' => '', 'class' => array('field-multiple-drag')), drupal_render($item), - array('data' => $delta_element, 'class' => 'delta-order'), + array('data' => $delta_element, 'class' => array('delta-order')), ); $rows[] = array( 'data' => $cells, - 'class' => 'draggable', + 'class' => array('draggable'), ); } $output = '
'; - $output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => 'field-multiple-table')); + $output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => array('field-multiple-table'))); $output .= $element['#description'] ? '
' . $element['#description'] . '
' : ''; $output .= '
' . drupal_render($add_more_button) . '
'; $output .= '
'; diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module index b956a9e779e..58eb3802e0f 100644 --- a/modules/field/modules/number/number.module +++ b/modules/field/modules/number/number.module @@ -377,7 +377,7 @@ function number_elements_process($element, $form_state, $form) { // for some configurations where all characters won't fit in input field. '#size' => $field['type'] == 'number_decimal' ? $field['settings']['precision'] + 2 : 12, '#maxlength' => $field['type'] == 'number_decimal' ? $field['settings']['precision'] : 10, - '#attributes' => array('class' => 'number'), + '#attributes' => array('class' => array('number')), // The following values were set by the Field module and need // to be passed down to the nested element. '#title' => $element['#title'], @@ -497,4 +497,4 @@ function number_decimal_validate($element, &$form_state) { */ function theme_number($element) { return $element['#children']; -} \ No newline at end of file +} diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module index b1d287e329a..bfb398f4c0b 100644 --- a/modules/field/modules/text/text.module +++ b/modules/field/modules/text/text.module @@ -658,7 +658,7 @@ function text_textfield_elements_process($element, $form_state, $form) { '#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : NULL, '#autocomplete_path' => $element['#autocomplete_path'], '#size' => $instance['widget']['settings']['size'], - '#attributes' => array('class' => 'text'), + '#attributes' => array('class' => array('text')), '#title' => $element['#title'], '#description' => $element['#description'], '#required' => $element['#required'], @@ -803,7 +803,7 @@ function theme_text_textarea_with_summary($element) { $fieldset = array( '#title' => $element['#title'], '#value' => $element['#children'], - '#attributes' => array('class' => 'text-textarea'), + '#attributes' => array('class' => array('text-textarea')), '#id' => str_replace('_', '-', $element['#field_name']) . '-summary-wrapper', ); return theme('fieldset', $fieldset); diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index 45d36e8574e..eec5cb525ee 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -22,7 +22,7 @@ function field_ui_fields_list() { $rows[$field_name]['data'][0] = $field['locked'] ? t('@field_name (Locked)', array('@field_name' => $field_name)) : $field_name; $rows[$field_name]['data'][1] = t($field_types[$field['type']]['label']); $rows[$field_name]['data'][2][] = l($bundles[$bundle]['label'], $admin_path . '/fields'); - $rows[$field_name]['class'] = $field['locked'] ? 'menu-disabled' : ''; + $rows[$field_name]['class'] = $field['locked'] ? array('menu-disabled') : array(''); } } foreach ($rows as $field_name => $cell) { @@ -298,19 +298,19 @@ function template_preprocess_field_ui_field_overview_form(&$vars) { $row = new stdClass(); // Add target classes for the tabledrag behavior. - $element['weight']['#attributes']['class'] = 'field-weight'; - $element['hidden_name']['#attributes']['class'] = 'field-name'; + $element['weight']['#attributes']['class'][] = 'field-weight'; + $element['hidden_name']['#attributes']['class'][] = 'field-name'; // Add target classes for the update selects behavior. switch ($element['#row_type']) { case 'add_new_field': - $element['type']['#attributes']['class'] = 'field-type-select'; - $element['widget_type']['#attributes']['class'] = 'widget-type-select'; + $element['type']['#attributes']['class'][] = 'field-type-select'; + $element['widget_type']['#attributes']['class'][] = 'widget-type-select'; break; case 'add_existing_field': - $element['field_name']['#attributes']['class'] = 'field-select'; - $element['widget_type']['#attributes']['class'] = 'widget-type-select'; - $element['label']['#attributes']['class'] = 'label-textfield'; + $element['field_name']['#attributes']['class'][] = 'field-select'; + $element['widget_type']['#attributes']['class'][] = 'widget-type-select'; + $element['label']['#attributes']['class'][] = 'label-textfield'; break; } foreach (element_children($element) as $child) { diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index 096520e701a..f827218a13d 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -69,7 +69,7 @@ function theme_filter_admin_overview($form) { foreach (element_children($form) as $id) { $element = $form[$id]; if (isset($element['roles']) && is_array($element['roles'])) { - $element['weight']['#attributes']['class'] = 'text-format-order-weight'; + $element['weight']['#attributes']['class'] = array('text-format-order-weight'); $rows[] = array( 'data' => array( check_plain($element['name']['#markup']), @@ -79,7 +79,7 @@ function theme_filter_admin_overview($form) { drupal_render($element['configure']), drupal_render($element['delete']), ), - 'class' => 'draggable', + 'class' => array('draggable'), ); unset($form[$id]); } @@ -419,10 +419,10 @@ function theme_filter_admin_order($form) { foreach (element_children($form['names']) as $id) { // Don't take form control structures. if (is_array($form['names'][$id])) { - $form['weights'][$id]['#attributes']['class'] = 'filter-order-weight'; + $form['weights'][$id]['#attributes']['class'] = array('filter-order-weight'); $rows[] = array( 'data' => array(drupal_render($form['names'][$id]), drupal_render($form['weights'][$id])), - 'class' => 'draggable', + 'class' => array('draggable'), ); } } diff --git a/modules/filter/filter.module b/modules/filter/filter.module index ddefa3cb539..f347fcc3252 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -224,15 +224,15 @@ function _filter_html_tips($format, $long = FALSE) { if (array_key_exists($tag, $tips)) { if ($tips[$tag]) { $rows[] = array( - array('data' => $tips[$tag][0], 'class' => 'description'), - array('data' => '' . check_plain($tips[$tag][1]) . '', 'class' => 'type'), - array('data' => $tips[$tag][1], 'class' => 'get') + array('data' => $tips[$tag][0], 'class' => array('description')), + array('data' => '' . check_plain($tips[$tag][1]) . '', 'class' => array('type')), + array('data' => $tips[$tag][1], 'class' => array('get')) ); } } else { $rows[] = array( - array('data' => t('No help provided for tag %tag.', array('%tag' => $tag)), 'class' => 'description', 'colspan' => 3), + array('data' => t('No help provided for tag %tag.', array('%tag' => $tag)), 'class' => array('description'), 'colspan' => 3), ); } } @@ -251,9 +251,9 @@ function _filter_html_tips($format, $long = FALSE) { unset($rows); foreach ($entities as $entity) { $rows[] = array( - array('data' => $entity[0], 'class' => 'description'), - array('data' => '' . check_plain($entity[1]) . '', 'class' => 'type'), - array('data' => $entity[1], 'class' => 'get') + array('data' => $entity[0], 'class' => array('description')), + array('data' => '' . check_plain($entity[1]) . '', 'class' => array('type')), + array('data' => $entity[1], 'class' => array('get')) ); } $output .= theme('table', $header, $rows); @@ -495,7 +495,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = $form = array( '#type' => 'fieldset', '#weight' => $weight, - '#attributes' => array('class' => 'filter-wrapper'), + '#attributes' => array('class' => array('filter-wrapper')), ); $form['format_guidelines'] = array( '#prefix' => '
', @@ -516,7 +516,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = '#parents' => $parents, '#access' => count($formats) > 1, '#id' => $element_id, - '#attributes' => array('class' => 'filter-list'), + '#attributes' => array('class' => array('filter-list')), ); $form['format_help'] = array( '#prefix' => '
', diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index 79279fcb2a1..996c1427080 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -580,7 +580,7 @@ function theme_image_style_list($styles) { $row[] = l($style['name'], 'admin/config/media/image-styles/edit/' . $style['name']); $link_attributes = array( 'attributes' => array( - 'class' => 'image-style-link', + 'class' => array('image-style-link'), ), ); $row[] = l(t('edit'), 'admin/config/media/image-styles/edit/' . $style['name'], $link_attributes); @@ -610,7 +610,7 @@ function theme_image_style_effects($form) { foreach (element_children($form) as $key) { if (is_numeric($key)) { - $form[$key]['weight']['#attributes']['class'] = 'image-effect-order-weight'; + $form[$key]['weight']['#attributes']['class'] = array('image-effect-order-weight'); $summary = drupal_render($form[$key]['summary']); $row = array(); $row[] = drupal_render($form[$key]['label']) . (empty($summary) ? '' : ' ' . $summary); @@ -620,7 +620,7 @@ function theme_image_style_effects($form) { } else { // Add the row for adding a new image effect. - $form['new']['weight']['#attributes']['class'] = 'image-effect-order-weight'; + $form['new']['weight']['#attributes']['class'] = array('image-effect-order-weight'); $row = array(); $row[] = '
' . drupal_render($form['new']['new']) . drupal_render($form['new']['add']) . '
'; $row[] = drupal_render($form['new']['weight']); @@ -629,7 +629,7 @@ function theme_image_style_effects($form) { $rows[] = array( 'data' => $row, - 'class' => 'draggable', + 'class' => array('draggable'), ); } @@ -743,7 +743,7 @@ function theme_image_anchor($element) { } } - return theme('table', array(), $rows, array('class' => 'image-anchor')); + return theme('table', array(), $rows, array('class' => array('image-anchor'))); } /** diff --git a/modules/locale/locale.api.php b/modules/locale/locale.api.php index 16f4d008c5c..5d0852b51ae 100644 --- a/modules/locale/locale.api.php +++ b/modules/locale/locale.api.php @@ -40,7 +40,7 @@ function hook_translation_link_alter(array &$links, $path) { if (isset($links[$language])) { foreach ($links[$language] as $link) { - $link['attributes']['class'] .= ' active-language'; + $link['attributes']['class'][] = 'active-language'; } } } diff --git a/modules/locale/locale.module b/modules/locale/locale.module index dc99bac250b..77c85ea8ff7 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -632,7 +632,7 @@ function locale_block_view($delta = '') { 'href' => $path, 'title' => $language->native, 'language' => $language, - 'attributes' => array('class' => 'language-link'), + 'attributes' => array('class' => array('language-link')), ); } diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index 153e7cf6652..0fb43aa67e6 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -82,7 +82,7 @@ function _menu_overview_tree_form($tree) { if ($item && $item['hidden'] >= 0) { $mlid = 'mlid:' . $item['mlid']; $form[$mlid]['#item'] = $item; - $form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => 'menu-disabled') : array('class' => 'menu-enabled'); + $form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => array('menu-disabled')) : array('class' => array('menu-enabled')); $form[$mlid]['title']['#markup'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' (' . t('disabled') . ')' : ''); $form[$mlid]['hidden'] = array( '#type' => 'checkbox', @@ -188,8 +188,8 @@ function theme_menu_overview_form($form) { $header = array( t('Menu link'), - array('data' => t('Enabled'), 'class' => 'checkbox'), - array('data' => t('Show as expanded'), 'class' => 'checkbox'), + array('data' => t('Enabled'), 'class' => array('checkbox')), + array('data' => t('Show as expanded'), 'class' => array('checkbox')), t('Weight'), array('data' => t('Operations'), 'colspan' => '3'), ); @@ -208,22 +208,22 @@ function theme_menu_overview_form($form) { } // Add special classes to be used for tabledrag.js. - $element['plid']['#attributes']['class'] = 'menu-plid'; - $element['mlid']['#attributes']['class'] = 'menu-mlid'; - $element['weight']['#attributes']['class'] = 'menu-weight'; + $element['plid']['#attributes']['class'] = array('menu-plid'); + $element['mlid']['#attributes']['class'] = array('menu-mlid'); + $element['weight']['#attributes']['class'] = array('menu-weight'); // Change the parent field to a hidden. This allows any value but hides the field. $element['plid']['#type'] = 'hidden'; $row = array(); $row[] = theme('indentation', $element['#item']['depth'] - 1) . drupal_render($element['title']); - $row[] = array('data' => drupal_render($element['hidden']), 'class' => 'checkbox'); - $row[] = array('data' => drupal_render($element['expanded']), 'class' => 'checkbox'); + $row[] = array('data' => drupal_render($element['hidden']), 'class' => array('checkbox')); + $row[] = array('data' => drupal_render($element['expanded']), 'class' => array('checkbox')); $row[] = drupal_render($element['weight']) . drupal_render($element['plid']) . drupal_render($element['mlid']); $row = array_merge($row, $operations); $row = array_merge(array('data' => $row), $element['#attributes']); - $row['class'] = !empty($row['class']) ? $row['class'] . ' draggable' : 'draggable'; + $row['class'][] = 'draggable'; $rows[] = $row; } } @@ -247,7 +247,7 @@ function menu_edit_item(&$form_state, $type, $item, $menu) { '#collapsible' => FALSE, '#tree' => TRUE, '#weight' => -2, - '#attributes' => array('class' => 'menu-item-form'), + '#attributes' => array('class' => array('menu-item-form')), '#item' => $item, ); if ($type == 'add' || empty($item)) { @@ -329,7 +329,7 @@ function menu_edit_item(&$form_state, $type, $item, $menu) { '#default_value' => $default, '#options' => $options, '#description' => t('The maximum depth for a link and all its children is fixed at !maxdepth. Some menu links may not be available as parents if selecting them would exceed this limit.', array('!maxdepth' => MENU_MAX_DEPTH)), - '#attributes' => array('class' => 'menu-title-select'), + '#attributes' => array('class' => array('menu-title-select')), ); $form['menu']['weight'] = array( '#type' => 'weight', diff --git a/modules/menu/menu.module b/modules/menu/menu.module index f8916ec90b1..3bab4280c10 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -405,7 +405,7 @@ function menu_form_alter(&$form, $form_state, $form_id) { '#attached_js' => array(drupal_get_path('module', 'menu') . '/menu.js'), '#tree' => TRUE, '#weight' => -2, - '#attributes' => array('class' => 'menu-item-form'), + '#attributes' => array('class' => array('menu-item-form')), ); $item = $form['#node']->menu; @@ -443,7 +443,7 @@ function menu_form_alter(&$form, $form_state, $form_id) { '#default_value' => $default, '#options' => $options, '#description' => t('The maximum depth for an item and all its children is fixed at !maxdepth. Some menu items may not be available as parents if selecting them would exceed this limit.', array('!maxdepth' => MENU_MAX_DEPTH)), - '#attributes' => array('class' => 'menu-title-select'), + '#attributes' => array('class' => array('menu-title-select')), ); $form['#submit'][] = 'menu_node_form_submit'; diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index bd68d05e3d1..005603c06e6 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -35,7 +35,7 @@ function node_overview_types() { } if (empty($rows)) { - $rows[] = array(array('data' => t('No content types available. Add content type.', array('@link' => url('admin/structure/types/add'))), 'colspan' => '5', 'class' => 'message')); + $rows[] = array(array('data' => t('No content types available. Add content type.', array('@link' => url('admin/structure/types/add'))), 'colspan' => '5', 'class' => array('message'))); } $build['node_table'] = array( diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 889a405ed46..274a7d3a780 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -376,7 +376,7 @@ function node_admin_content($form_state) { if (_node_add_access()) { $form['add_content'] = array( '#type' => 'markup', - '#markup' => l(t('Add new content'), 'node/add', array('attributes' => array('class' => 'node-admin-add-content'))), + '#markup' => l(t('Add new content'), 'node/add', array('attributes' => array('class' => array('node-admin-add-content')))), ); } $form[] = node_filter_form(); @@ -599,4 +599,4 @@ function node_multiple_delete_confirm_submit($form, &$form_state) { function node_modules_installed($modules) { // Clear node type cache for node permissions. node_type_clear(); -} \ No newline at end of file +} diff --git a/modules/node/node.module b/modules/node/node.module index 64a324bacc2..5d5c0c12c2c 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1203,7 +1203,7 @@ function node_build_content($node, $build_mode = 'full') { $node->content['links']['node'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); // Allow modules to make their own additions to the node. @@ -2116,7 +2116,7 @@ function node_form_search_form_alter(&$form, $form_state) { '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, - '#attributes' => array('class' => 'search-advanced'), + '#attributes' => array('class' => array('search-advanced')), ); $form['advanced']['keywords'] = array( '#prefix' => '
', diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index df66459e629..46a07c1cd48 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -502,8 +502,8 @@ function node_revision_overview($node) { if ($revision->current_vid > 0) { $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"), '!username' => theme('username', $revision))) . (($revision->log != '') ? '

' . filter_xss($revision->log) . '

' : ''), - 'class' => 'revision-current'); - $operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => 'revision-current', 'colspan' => 2); + 'class' => array('revision-current')); + $operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => array('revision-current'), 'colspan' => 2); } else { $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision))) diff --git a/modules/openid/openid.module b/modules/openid/openid.module index 787e23bca8e..842606d7d8c 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -96,11 +96,11 @@ function _openid_user_login_form_alter(&$form, &$form_state) { $items = array(); $items[] = array( 'data' => l(t('Log in using OpenID'), '#'), - 'class' => 'openid-link', + 'class' => array('openid-link'), ); $items[] = array( 'data' => l(t('Cancel OpenID login'), '#'), - 'class' => 'user-link', + 'class' => array('user-link'), ); $form['openid_links'] = array( diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc index 2809b7090ad..4f65379a638 100644 --- a/modules/path/path.admin.inc +++ b/modules/path/path.admin.inc @@ -42,9 +42,6 @@ function path_admin_overview($keys = NULL) { $destination = drupal_get_destination(); foreach ($result as $data) { $row = array( - // If the system path maps to a different URL alias, highlight this table - // row to let the user know of old aliases. - 'class' => ($data->dst != drupal_get_path_alias($data->src, $data->language) ? 'warning' : NULL), 'data' => array( l($data->dst, $data->src), l($data->src, $data->src, array('alias' => TRUE)), @@ -52,6 +49,11 @@ function path_admin_overview($keys = NULL) { l(t('delete'), "admin/settings/path/delete/$data->pid", array('query' => $destination)), ), ); + // If the system path maps to a different URL alias, highlight this table + // row to let the user know of old aliases. + if ($data->dst != drupal_get_path_alias($data->src, $data->language)) { + $row['class'] = array('warning'); + } if ($multilanguage) { array_splice($row['data'], 2, 0, module_invoke('locale', 'language_name', $data->language)); } @@ -208,7 +210,7 @@ function path_admin_delete_confirm_submit($form, &$form_state) { * @see path_admin_filter_form_submit() */ function path_admin_filter_form(&$form_state, $keys = '') { - $form['#attributes'] = array('class' => 'search-form'); + $form['#attributes'] = array('class' => array('search-form')); $form['basic'] = array('#type' => 'fieldset', '#title' => t('Filter aliases') ); diff --git a/modules/poll/poll.module b/modules/poll/poll.module index f8d3b37c09f..84a84b0e0b2 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -758,21 +758,23 @@ function theme_poll_choices($form) { foreach (element_children($form) as $key) { $delta++; // Set special classes for drag and drop updating. - $form[$key]['weight']['#attributes']['class'] = 'poll-weight'; + $form[$key]['weight']['#attributes']['class'] = array('poll-weight'); // Build the table row. $row = array( 'data' => array( - array('class' => 'choice-flag'), + array('class' => array('choice-flag')), drupal_render($form[$key]['chtext']), drupal_render($form[$key]['chvotes']), drupal_render($form[$key]['weight']), ), - 'class' => 'draggable', + 'class' => array('draggable'), ); // Add any additional classes set on the row. - $row['class'] .= isset($form[$key]['#attributes']['class']) ? ' ' . $form[$key]['#attributes']['class'] : ''; + if (!empty($form[$key]['#attributes']['class'])) { + $row['class'] = array_merge($row['class'], $form[$key]['#attributes']['class']); + } $rows[] = $row; } diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 95b2c5a0a62..f1bf2855c41 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -116,9 +116,9 @@ function theme_profile_admin_overview($form) { // Category classes are given numeric IDs because there's no guarantee // class names won't contain invalid characters. $categories[$category] = $category_number; - $category_field['#attributes']['class'] = 'profile-category profile-category-' . $category_number; - $rows[] = array(array('data' => $category, 'colspan' => 7, 'class' => 'category')); - $rows[] = array('data' => array(array('data' => '' . t('No fields in this category. If this category remains empty when saved, it will be removed.') . '', 'colspan' => 7)), 'class' => 'category-' . $category_number . '-message category-message category-populated'); + $category_field['#attributes']['class'] = array('profile-category', 'profile-category-' . $category_number); + $rows[] = array(array('data' => $category, 'colspan' => 7, 'class' => array('category'))); + $rows[] = array('data' => array(array('data' => '' . t('No fields in this category. If this category remains empty when saved, it will be removed.') . '', 'colspan' => 7)), 'class' => array('category-' . $category_number . '-message', 'category-message', 'category-populated')); // Make it draggable only if there is more than one field if (isset($form['submit'])) { @@ -129,8 +129,8 @@ function theme_profile_admin_overview($form) { } // Add special drag and drop classes that group fields together. - $field['weight']['#attributes']['class'] = 'profile-weight profile-weight-' . $categories[$category]; - $field['category']['#attributes']['class'] = 'profile-category profile-category-' . $categories[$category]; + $field['weight']['#attributes']['class'] = array('profile-weight', 'profile-weight-' . $categories[$category]); + $field['category']['#attributes']['class'] = array('profile-category', 'profile-category-' . $categories[$category]); // Add the row $row = array(); @@ -143,7 +143,7 @@ function theme_profile_admin_overview($form) { } $row[] = drupal_render($field['edit']); $row[] = drupal_render($field['delete']); - $rows[] = array('data' => $row, 'class' => 'draggable'); + $rows[] = array('data' => $row, 'class' => array('draggable')); } } if (empty($rows)) { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 7fbd0952af8..ea99c4dc21b 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -351,7 +351,7 @@ function profile_user_view($account) { '#title' => $title, '#markup' => $value, '#weight' => $field->weight, - '#attributes' => array('class' => 'profile-' . $field->name), + '#attributes' => array('class' => array('profile-' . $field->name)), ); } } diff --git a/modules/search/search.module b/modules/search/search.module index 479010d972c..e8d63ea9688 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -1070,7 +1070,7 @@ function search_form(&$form_state, $action = '', $keys = '', $type = NULL, $prom $form = array( '#action' => $action, - '#attributes' => array('class' => 'search-form'), + '#attributes' => array('class' => array('search-form')), ); $form['module'] = array('#type' => 'value', '#value' => $type); $form['basic'] = array('#type' => 'item', '#title' => $prompt, '#id' => 'edit-keys'); diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index 04ab6fe2234..4816cf74e0a 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -72,8 +72,8 @@ function theme_simpletest_test_table($table) { // Create header for test selection table. $header = array( theme('table_select_header_cell'), - array('data' => t('Test'), 'class' => 'simpletest_test'), - array('data' => t('Description'), 'class' => 'simpletest_description'), + array('data' => t('Test'), 'class' => array('simpletest_test')), + array('data' => t('Description'), 'class' => array('simpletest_description')), ); // Define the images used to expand/collapse the test groups. @@ -100,7 +100,7 @@ function theme_simpletest_test_table($table) { $image_index = $collapsed ? 0 : 1; // Place-holder for checkboxes to select group of tests. - $row[] = array('id' => $test_class, 'class' => 'simpletest-select-all'); + $row[] = array('id' => $test_class, 'class' => array('simpletest-select-all')); // Expand/collapse image and group title. $row[] = array( @@ -111,7 +111,7 @@ function theme_simpletest_test_table($table) { $row[] = ' '; - $rows[] = array('data' => $row, 'class' => 'simpletest-group'); + $rows[] = array('data' => $row, 'class' => array('simpletest-group')); // Add individual tests to group. $current_js = array( @@ -145,7 +145,7 @@ function theme_simpletest_test_table($table) { $row[] = theme('indentation', 1) . ''; $row[] = '
' . $description . '
'; - $rows[] = array('data' => $row, 'class' => $test_class . '-test' . ($collapsed ? ' js-hide' : '')); + $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($collapsed ? 'js-hide' : ''))); } $js['simpletest-test-group-' . $test_class] = $current_js; unset($table[$key]); @@ -259,7 +259,7 @@ function simpletest_result_form(&$form_state, $test_id) { if ($assertion->message_group == 'Debug') { $class = 'simpletest-debug'; } - $rows[] = array('data' => $row, 'class' => $class); + $rows[] = array('data' => $row, 'class' => array($class)); $group_summary['#' . $assertion->status]++; $form['result']['summary']['#' . $assertion->status]++; @@ -286,7 +286,7 @@ function simpletest_result_form(&$form_state, $test_id) { $form['action'] = array( '#type' => 'fieldset', '#title' => t('Actions'), - '#attributes' => array('class' => 'container-inline'), + '#attributes' => array('class' => array('container-inline')), '#weight' => -11, ); diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index 80ef997cf96..bbf60ccda41 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -29,7 +29,7 @@ function statistics_recent_hits() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'), + array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), theme('username', $log), l(t('details'), "admin/reports/access/$log->aid")); diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 0463c015834..9194fcd4962 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -116,7 +116,7 @@ function statistics_node_view($node, $build_mode) { $node->content['links']['statistics'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); } } diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc index d51da7456f4..1dcd3e0fac5 100644 --- a/modules/statistics/statistics.pages.inc +++ b/modules/statistics/statistics.pages.inc @@ -31,7 +31,7 @@ function statistics_node_tracker() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'), + array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), _statistics_link($log->url), theme('username', $log), l(t('details'), "admin/reports/access/$log->aid"), @@ -74,7 +74,7 @@ function statistics_user_tracker() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'), + array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), l(t('details'), "admin/reports/access/$log->aid")); } diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php index ef8cfdf4a35..39127200ef6 100644 --- a/modules/system/page.tpl.php +++ b/modules/system/page.tpl.php @@ -154,7 +154,7 @@ @@ -192,7 +192,7 @@
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 8b9a5dd7a07..88c8f2f703a 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -223,7 +223,7 @@ function system_themes_form() { break; } } - $screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $theme->info['name'])), '', array('class' => 'screenshot'), FALSE) : t('no screenshot'); + $screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $theme->info['name'])), '', array('class' => array('screenshot')), FALSE) : t('no screenshot'); $form[$theme->name]['screenshot'] = array('#markup' => $screenshot); $form[$theme->name]['info'] = array( @@ -479,7 +479,7 @@ function system_theme_settings(&$form_state, $key = '') { '#type' => 'fieldset', '#title' => t('Logo image settings'), '#description' => t('If toggled on, the following logo will be displayed.'), - '#attributes' => array('class' => 'theme-settings-bottom'), + '#attributes' => array('class' => array('theme-settings-bottom')), ); $form['logo']['default_logo'] = array( '#type' => 'checkbox', @@ -720,7 +720,7 @@ function system_modules($form_state = array()) { '#collapsible' => TRUE, '#theme' => 'system_modules_fieldset', '#header' => array( - array('data' => t('Enabled'), 'class' => 'checkbox'), + array('data' => t('Enabled'), 'class' => array('checkbox')), t('Name'), t('Version'), t('Description'), @@ -1625,7 +1625,7 @@ function system_regional_settings() { '#title' => t('Default country'), '#default_value' => variable_get('site_default_country', ''), '#options' => $countries, - '#attributes' => array('class' => 'country-detect'), + '#attributes' => array('class' => array('country-detect')), ); $form['locale']['date_first_day'] = array( @@ -1690,7 +1690,7 @@ function system_regional_settings() { '#suffix' => '
', '#type' => 'select', '#title' => t('Short date format'), - '#attributes' => array('class' => 'date-format'), + '#attributes' => array('class' => array('date-format')), '#default_value' => (isset($date_short_choices[$date_format_short]) ? $date_format_short : 'custom'), '#options' => $date_short_choices, ); @@ -1701,7 +1701,7 @@ function system_regional_settings() { '#suffix' => '', '#type' => 'textfield', '#title' => t('Custom short date format'), - '#attributes' => array('class' => 'custom-format'), + '#attributes' => array('class' => array('custom-format')), '#default_value' => $default_short_custom, '#description' => t('A user-defined short date format. See the PHP manual for available options. This format is currently set to display as %date.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(REQUEST_TIME, 'custom', $default_short_custom))), ); @@ -1712,7 +1712,7 @@ function system_regional_settings() { '#suffix' => '', '#type' => 'select', '#title' => t('Medium date format'), - '#attributes' => array('class' => 'date-format'), + '#attributes' => array('class' => array('date-format')), '#default_value' => (isset($date_medium_choices[$date_format_medium]) ? $date_format_medium : 'custom'), '#options' => $date_medium_choices, ); @@ -1723,7 +1723,7 @@ function system_regional_settings() { '#suffix' => '', '#type' => 'textfield', '#title' => t('Custom medium date format'), - '#attributes' => array('class' => 'custom-format'), + '#attributes' => array('class' => array('custom-format')), '#default_value' => $default_medium_custom, '#description' => t('A user-defined medium date format. See the PHP manual for available options. This format is currently set to display as %date.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(REQUEST_TIME, 'custom', $default_medium_custom))), ); @@ -1734,7 +1734,7 @@ function system_regional_settings() { '#suffix' => '', '#type' => 'select', '#title' => t('Long date format'), - '#attributes' => array('class' => 'date-format'), + '#attributes' => array('class' => array('date-format')), '#default_value' => (isset($date_long_choices[$date_format_long]) ? $date_format_long : 'custom'), '#options' => $date_long_choices, ); @@ -1745,7 +1745,7 @@ function system_regional_settings() { '#suffix' => '', '#type' => 'textfield', '#title' => t('Custom long date format'), - '#attributes' => array('class' => 'custom-format'), + '#attributes' => array('class' => array('custom-format')), '#default_value' => $default_long_custom, '#description' => t('A user-defined long date format. See the PHP manual for available options. This format is currently set to display as %date.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(REQUEST_TIME, 'custom', $default_long_custom))), ); @@ -2140,7 +2140,7 @@ function theme_system_modules_fieldset($form) { $module = $form[$key]; $row = array(); unset($module['enable']['#title']); - $row[] = array('class' => 'checkbox', 'data' => drupal_render($module['enable'])); + $row[] = array('class' => array('checkbox'), 'data' => drupal_render($module['enable'])); $label = ' implode(', ', $module['#required_by']))) . ''; } - $row[] = array('data' => $description, 'class' => 'description'); + $row[] = array('data' => $description, 'class' => array('description')); $rows[] = $row; } @@ -2208,13 +2208,13 @@ function theme_system_modules_uninstall($form) { $rows[] = array( array('data' => drupal_render($form['uninstall'][$module]), 'align' => 'center'), '', - array('data' => drupal_render($form['modules'][$module]['description']), 'class' => 'description'), + array('data' => drupal_render($form['modules'][$module]['description']), 'class' => array('description')), ); } // Only display table if there are modules that can be uninstalled. if (empty($rows)) { - $rows[] = array(array('data' => t('No modules are available to uninstall.'), 'colspan' => '3', 'align' => 'center', 'class' => 'message')); + $rows[] = array(array('data' => t('No modules are available to uninstall.'), 'colspan' => '3', 'align' => 'center', 'class' => array('message'))); } $output = theme('table', $header, $rows); diff --git a/modules/system/system.module b/modules/system/system.module index bd98c860606..5088b4cf8d2 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1468,7 +1468,7 @@ function system_user_timezone(&$edit, &$form) { ); if (!$edit['timezone'] && $edit['uid'] == $user->uid) { $form['timezone']['#description'] = t('Your time zone setting will be automatically detected if possible. Please confirm the selection and click save.'); - $form['timezone']['timezone']['#attributes'] = array('class' => 'timezone-detect'); + $form['timezone']['timezone']['#attributes'] = array('class' => array('timezone-detect')); drupal_add_js('misc/timezone.js'); } } @@ -1524,7 +1524,7 @@ function system_block_configure($delta = '') { $form['wrapper']['preview'] = array( '#type' => 'item', '#title' => 'Preview', - '#markup' => theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'), array('class' => 'powered-by-preview'), FALSE), + '#markup' => theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'), array('class' => array('powered-by-preview')), FALSE), ); return $form; } @@ -2195,7 +2195,7 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, // Confirm form fails duplication check, as the form values rarely change -- so skip it. $form['#skip_duplicate_check'] = TRUE; - $form['#attributes'] = array('class' => 'confirmation'); + $form['#attributes'] = array('class' => array('confirmation')); $form['description'] = array('#markup' => $description); $form[$name] = array('#type' => 'hidden', '#value' => 1); diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index a3cf566449e..dacdb4c0672 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -73,13 +73,13 @@ function theme_taxonomy_overview_vocabularies($form) { $row[] = drupal_render($vocabulary['name']); $row[] = drupal_render($vocabulary['types']); if (isset($vocabulary['weight'])) { - $vocabulary['weight']['#attributes']['class'] = 'vocabulary-weight'; + $vocabulary['weight']['#attributes']['class'] = array('vocabulary-weight'); $row[] = drupal_render($vocabulary['weight']); } $row[] = drupal_render($vocabulary['edit']); $row[] = drupal_render($vocabulary['list']); $row[] = drupal_render($vocabulary['add']); - $rows[] = array('data' => $row, 'class' => 'draggable'); + $rows[] = array('data' => $row, 'class' => array('draggable')); } } @@ -601,9 +601,9 @@ function theme_taxonomy_overview_terms($form) { $row = array(); $row[] = (isset($term['#term']['depth']) && $term['#term']['depth'] > 0 ? theme('indentation', $term['#term']['depth']) : '') . drupal_render($term['view']); if ($form['#parent_fields']) { - $term['tid']['#attributes']['class'] = 'term-id'; - $term['parent']['#attributes']['class'] = 'term-parent'; - $term['depth']['#attributes']['class'] = 'term-depth'; + $term['tid']['#attributes']['class'] = array('term-id'); + $term['parent']['#attributes']['class'] = array('term-parent'); + $term['depth']['#attributes']['class'] = array('term-depth'); $row[0] .= drupal_render($term['parent']) . drupal_render($term['tid']) . drupal_render($term['depth']); } $row[] = drupal_render($term['edit']); @@ -616,32 +616,31 @@ function theme_taxonomy_overview_terms($form) { // Add necessary classes to rows. $row_position = 0; foreach ($rows as $key => $row) { - $classes = array(); + $rows[$key]['class'] = array(); if (isset($form['#parent_fields'])) { - $classes[] = 'draggable'; + $rows[$key]['class'][] = 'draggable'; } // Add classes that mark which terms belong to previous and next pages. if ($row_position < $back_peddle || $row_position >= $page_entries - $forward_peddle) { - $classes[] = 'taxonomy-term-preview'; + $rows[$key]['class'][] = 'taxonomy-term-preview'; } if ($row_position !== 0 && $row_position !== count($rows) - 1) { if ($row_position == $back_peddle - 1 || $row_position == $page_entries - $forward_peddle - 1) { - $classes[] = 'taxonomy-term-divider-top'; + $rows[$key]['class'][] = 'taxonomy-term-divider-top'; } elseif ($row_position == $back_peddle || $row_position == $page_entries - $forward_peddle) { - $classes[] = 'taxonomy-term-divider-bottom'; + $rows[$key]['class'][] = 'taxonomy-term-divider-bottom'; } } // Add an error class if this row contains a form error. foreach ($errors as $error_key => $error) { if (strpos($error_key, $key) === 0) { - $classes[] = 'error'; + $rows[$key]['class'][] = 'error'; } } - $rows[$key]['class'] = implode(' ', $classes); $row_position++; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 36459f73bd1..254013eb808 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -163,7 +163,7 @@ function taxonomy_node_view($node, $build_mode) { $node->content['links']['terms'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), '#sorted' => TRUE, ); } @@ -2178,7 +2178,7 @@ function taxonomy_autocomplete_elements_process($element, &$form_state, $form) { '#default_value' => $typed_string, '#autocomplete_path' => 'taxonomy/autocomplete/'. $element['#field_name'] .'/'. $element['#bundle'], '#size' => $instance['widget']['settings']['size'], - '#attributes' => array('class' => 'text'), + '#attributes' => array('class' => array('text')), '#title' => $element['#title'], '#description' => $element['#description'], '#required' => $element['#required'], diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index 0ca9cf714d7..e650d8b157c 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -146,7 +146,7 @@ function toolbar_menu_navigation_links($tree) { // Add icon placeholder. $link['title'] = '' . $item['link']['title']; // Add admin link ID and to-overlay class for the overlay. - $link['attributes'] = array('id' => 'toolbar-link-' . $id, 'class' => 'to-overlay'); + $link['attributes'] = array('id' => 'toolbar-link-' . $id, 'class' => array('to-overlay')); $link['html'] = TRUE; $class = ' path-' . $id; diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc index b97933233f4..07226b8a81e 100644 --- a/modules/tracker/tracker.pages.inc +++ b/modules/tracker/tracker.pages.inc @@ -59,7 +59,7 @@ function tracker_page($account = NULL, $set_title = FALSE) { check_plain(node_type_get_name($node->type)), l($node->title, "node/$node->nid") . ' ' . theme('mark', node_mark($node->nid, $node->changed)), theme('username', $node), - array('class' => 'replies', 'data' => $comments), + array('class' => array('replies'), 'data' => $comments), t('!time ago', array('!time' => format_interval(REQUEST_TIME - $node->last_updated))) ); } diff --git a/modules/translation/translation.module b/modules/translation/translation.module index 270d9d543de..6bfef4e18b3 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -178,12 +178,12 @@ function translation_node_view($node, $build_mode) { 'title' => $language->native, 'href' => 'node/' . $translations[$langcode]->nid, 'language' => $language, - 'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link') + 'attributes' => array('title' => $translations[$langcode]->title, 'class' => array('translation-link')), ); $node->content['links']['translation'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); } } diff --git a/modules/update/update.api.php b/modules/update/update.api.php index a7dd3f69886..f28b6c0bf9f 100644 --- a/modules/update/update.api.php +++ b/modules/update/update.api.php @@ -95,7 +95,7 @@ function hook_update_status_alter(&$projects) { $projects[$project]['reason'] = t('Ignored from settings'); if (!empty($settings[$project]['notes'])) { $projects[$project]['extra'][] = array( - 'class' => 'admin-note', + 'class' => array('admin-note'), 'label' => t('Administrator note'), 'data' => $settings[$project]['notes'], ); diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc index 0cfc83775aa..b9d60c155f2 100644 --- a/modules/update/update.compare.inc +++ b/modules/update/update.compare.inc @@ -275,7 +275,7 @@ function update_calculate_project_data($available) { $projects[$project]['extra'] = array(); } $projects[$project]['extra'][] = array( - 'class' => 'project-not-secure', + 'class' => array('project-not-secure'), 'label' => t('Project not secure'), 'data' => t('This project has been labeled insecure by the Drupal security team, and is no longer available for download. Immediately disabling everything included by this project is strongly recommended!'), ); @@ -287,7 +287,7 @@ function update_calculate_project_data($available) { $projects[$project]['extra'] = array(); } $projects[$project]['extra'][] = array( - 'class' => 'project-revoked', + 'class' => array('project-revoked'), 'label' => t('Project revoked'), 'data' => t('This project has been revoked, and is no longer available for download. Disabling everything included by this project is strongly recommended!'), ); @@ -298,7 +298,7 @@ function update_calculate_project_data($available) { $projects[$project]['extra'] = array(); } $projects[$project]['extra'][] = array( - 'class' => 'project-not-supported', + 'class' => array('project-not-supported'), 'label' => t('Project not supported'), 'data' => t('This project is no longer supported, and is no longer available for download. Disabling everything included by this project is strongly recommended!'), ); @@ -387,7 +387,7 @@ function update_calculate_project_data($available) { $projects[$project]['extra'] = array(); } $projects[$project]['extra'][] = array( - 'class' => 'release-revoked', + 'class' => array('release-revoked'), 'label' => t('Release revoked'), 'data' => t('Your currently installed release has been revoked, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'), ); @@ -399,7 +399,7 @@ function update_calculate_project_data($available) { $projects[$project]['extra'] = array(); } $projects[$project]['extra'][] = array( - 'class' => 'release-not-supported', + 'class' => array('release-not-supported'), 'label' => t('Release not supported'), 'data' => t('Your currently installed release is now unsupported, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'), ); diff --git a/modules/update/update.module b/modules/update/update.module index b418f1ebb99..626560e9257 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -162,7 +162,7 @@ function update_theme() { 'arguments' => array('data' => NULL), ), 'update_version' => array( - 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => NULL), + 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => array()), ), ); } diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index 46550951653..2133510f0ca 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -121,8 +121,8 @@ function theme_update_report($data) { $security_class = ' version-recommended version-recommended-strong'; } else { - $security_class = ''; - $version_class = 'version-recommended'; + $security_class = array(); + $version_class[] = 'version-recommended'; // Apply an extra class if we're displaying both a recommended // version and anything else for an extra visual hint. if ($project['recommended'] !== $project['latest_version'] @@ -134,7 +134,7 @@ function theme_update_report($data) { || (isset($project['security updates'][0]) && $project['recommended'] !== $project['security updates'][0]) ) { - $version_class .= ' version-recommended-strong'; + $version_class[] = 'version-recommended-strong'; } $row .= theme('update_version', $project['releases'][$project['recommended']], t('Recommended version:'), $version_class); } @@ -148,19 +148,19 @@ function theme_update_report($data) { } if ($project['recommended'] !== $project['latest_version']) { - $row .= theme('update_version', $project['releases'][$project['latest_version']], t('Latest version:'), 'version-latest'); + $row .= theme('update_version', $project['releases'][$project['latest_version']], t('Latest version:'), array('version-latest')); } if ($project['install_type'] == 'dev' && $project['status'] != UPDATE_CURRENT && isset($project['dev_version']) && $project['recommended'] !== $project['dev_version']) { - $row .= theme('update_version', $project['releases'][$project['dev_version']], t('Development version:'), 'version-latest'); + $row .= theme('update_version', $project['releases'][$project['dev_version']], t('Development version:'), array('version-latest')); } } if (isset($project['also'])) { foreach ($project['also'] as $also) { - $row .= theme('update_version', $project['releases'][$also], t('Also available:'), 'version-also-available'); + $row .= theme('update_version', $project['releases'][$also], t('Also available:'), array('version-also-available')); } } @@ -170,7 +170,7 @@ function theme_update_report($data) { if (!empty($project['extra'])) { $row .= '
' . "\n"; foreach ($project['extra'] as $key => $value) { - $row .= '
'; + $row .= '
'; $row .= check_plain($value['label']) . ': '; $row .= theme('placeholder', $value['data']); $row .= "
\n"; @@ -189,7 +189,7 @@ function theme_update_report($data) { $rows[$project['project_type']] = array(); } $rows[$project['project_type']][] = array( - 'class' => $class, + 'class' => array($class), 'data' => array($row), ); } @@ -204,7 +204,7 @@ function theme_update_report($data) { foreach ($project_types as $type_name => $type_label) { if (!empty($rows[$type_name])) { $output .= "\n

" . $type_label . "

\n"; - $output .= theme('table', $header, $rows[$type_name], array('class' => 'update')); + $output .= theme('table', $header, $rows[$type_name], array('class' => array('update'))); } } drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); diff --git a/modules/upload/upload.module b/modules/upload/upload.module index e1f86db7a5c..726e0865b5f 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -78,7 +78,7 @@ function upload_node_links($node, $build_mode) { $node->content['links']['upload_attachments'] = array( '#theme' => 'links', '#links' => $links, - '#attributes' => array('class' => 'links inline'), + '#attributes' => array('class' => array('links', 'inline')), ); } } @@ -445,7 +445,7 @@ function theme_upload_attachments($elements) { } } if (count($rows)) { - return theme('table', $header, $rows, array('class' => 'attachments')); + return theme('table', $header, $rows, array('class' => array('attachments'))); } } @@ -603,7 +603,7 @@ function theme_upload_form_current($form) { foreach (element_children($form) as $key) { // Add class to group weight fields for drag and drop. - $form[$key]['weight']['#attributes']['class'] = 'upload-weight'; + $form[$key]['weight']['#attributes']['class'] = array('upload-weight'); $row = array(''); $row[] = drupal_render($form[$key]['remove']); @@ -611,7 +611,7 @@ function theme_upload_form_current($form) { $row[] = drupal_render($form[$key]['description']); $row[] = drupal_render($form[$key]['weight']); $row[] = drupal_render($form[$key]['size']); - $rows[] = array('data' => $row, 'class' => 'draggable'); + $rows[] = array('data' => $row, 'class' => array('draggable')); } $output = theme('table', $header, $rows, array('id' => 'upload-attachments')); $output .= drupal_render_children($form); diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 46850da91ea..1ec1221b2ed 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -695,23 +695,23 @@ function theme_user_admin_permissions($form) { $row = array(); // Module name if (is_numeric($key)) { - $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => 'module', 'id' => 'module-' . $form['permission'][$key]['#id'], 'colspan' => count($form['role_names']['#value']) + 1); + $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => array('module'), 'id' => 'module-' . $form['permission'][$key]['#id'], 'colspan' => count($form['role_names']['#value']) + 1); } else { // Permission row. $row[] = array( 'data' => drupal_render($form['permission'][$key]), - 'class' => 'permission', + 'class' => array('permission'), ); foreach (element_children($form['checkboxes']) as $rid) { - $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] . ' : ' . t($key)); + $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => array('checkbox'), 'title' => $roles[$rid] . ' : ' . t($key)); } } $rows[] = $row; } $header[] = (t('Permission')); foreach (element_children($form['role_names']) as $rid) { - $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => 'checkbox'); + $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => array('checkbox')); } $output = theme('system_compact_link'); $output .= theme('table', $header, $rows, array('id' => 'permissions')); diff --git a/modules/user/user.api.php b/modules/user/user.api.php index 8c0da756807..e3c706555f6 100644 --- a/modules/user/user.api.php +++ b/modules/user/user.api.php @@ -417,7 +417,7 @@ function hook_user_view($account) { '#type' => 'user_profile_item', '#title' => t('Blog'), '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => $account->name))))), - '#attributes' => array('class' => 'blog'), + '#attributes' => array('class' => array('blog')), ); } } diff --git a/modules/user/user.module b/modules/user/user.module index 0f62c996ba6..7a4d01d8d35 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -920,7 +920,7 @@ function user_user_view($account) { } $account->content['summary'] += array( '#type' => 'user_profile_category', - '#attributes' => array('class' => 'user-member'), + '#attributes' => array('class' => array('user-member')), '#weight' => 5, '#title' => t('History'), ); @@ -1890,7 +1890,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) { '#maxlength' => USERNAME_MAX_LENGTH, '#description' => t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.'), '#required' => TRUE, - '#attributes' => array('class' => 'username'), + '#attributes' => array('class' => array('username')), ); } $form['account']['mail'] = array('#type' => 'textfield', diff --git a/themes/garland/template.php b/themes/garland/template.php index 7a58dfdb087..4928977567e 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -20,11 +20,11 @@ function garland_breadcrumb($breadcrumb) { function garland_preprocess_page(&$vars) { $vars['tabs2'] = menu_secondary_local_tasks(); $vars['primary_nav'] = isset($vars['main_menu']) ? theme('links', $vars['main_menu'], array( - 'text' => t('Main menu'), 'level' => 'h2', 'class' => 'element-invisible', - ), array('class' => 'links main-menu')) : FALSE; + 'text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'), + ), array('class' => array('links', 'main-menu'))) : FALSE; $vars['secondary_nav'] = isset($vars['secondary_menu']) ? theme('links', $vars['secondary_menu'], array( - 'text' => t('Secondary menu'), 'level' => 'h2', 'class' => 'element-invisible', - ), array('class' => 'links secondary-menu')) : FALSE; + 'text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'), + ), array('class' => array('links', 'secondary-menu'))) : FALSE; $vars['ie_styles'] = garland_get_ie_styles(); // Prepare header diff --git a/themes/seven/template.php b/themes/seven/template.php index 60a7e820255..416de552a57 100644 --- a/themes/seven/template.php +++ b/themes/seven/template.php @@ -75,12 +75,12 @@ function seven_fieldset($element) { drupal_add_js('misc/collapse.js'); if (!isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = ''; + $element['#attributes']['class'] = array(); } - $element['#attributes']['class'] .= ' collapsible'; + $element['#attributes']['class'][] = 'collapsible'; if (!empty($element['#collapsed'])) { - $element['#attributes']['class'] .= ' collapsed'; + $element['#attributes']['class'][] = 'collapsed'; } } $element['#attributes']['id'] = $element['#id'];