Commit 36ec1896 authored by webchick's avatar webchick

#326539 by JohnAlbin, sun, cha0s, ultimateboy, Rob Loach, Damien Tournoud:...

#326539 by JohnAlbin, sun, cha0s, ultimateboy, Rob Loach, Damien Tournoud: Convert 'class' attribute to use an array, not a string.
parent 73a72337
......@@ -2286,12 +2286,7 @@ function l($text, $path, array $options = array()) {
// Append active class.
if (($path == $_GET['q'] || ($path == '<front>' && 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),
......
......@@ -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'] = '<div class="' . $class . '">' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
......@@ -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'] = '<div class="' . $class . '">' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
......@@ -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 '<input type="submit" ' . (empty($element['#name']) ? '' : 'name="' . $element['#name'] . '" ') . 'id="' . $element['#id'] . '" value="' . check_plain($element['#value']) . '" ' . drupal_attributes($element['#attributes']) . " />\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 '<input type="image" name="' . $element['#name'] . '" ' .
(!empty($element['#value']) ? ('value="' . check_plain($element['#value']) . '" ') : '') .
......@@ -2594,16 +2582,18 @@ function theme_form_element($element) {
* Array of new class names to be added.
*/
function _form_set_class(&$element, $class = array()) {
if (!empty($class)) {
if (!isset($element['#attributes']['class'])) {
$element['#attributes']['class'] = array();
}
$element['#attributes']['class'] = array_merge($element['#attributes']['class'], $class);
}
if ($element['#required']) {
$class[] = 'required';
$element['#attributes']['class'][] = 'required';
}
if (form_get_error($element)) {
$class[] = 'error';
}
if (isset($element['#attributes']['class'])) {
$class[] = $element['#attributes']['class'];
$element['#attributes']['class'][] = 'error';
}
$element['#attributes']['class'] = implode(' ', $class);
}
/**
......
......@@ -46,7 +46,7 @@ function locale_languages_overview_form() {
$form['weight'][$langcode] = array(
'#type' => '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)) . '<br /><small>' . $string['location'] . '</small>'),
$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')),
);
}
......
......@@ -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')));
}
}
......
......@@ -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;
......
......@@ -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'] == '<front>' && drupal_is_front_page()))
&& (empty($link['language']) || $link['language']->language == $language->language)) {
$class .= ' active';
$class[] = 'active';
}
$output .= '<li' . drupal_attributes(array('class' => $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 = '<table' . drupal_attributes($attributes) . ">\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 .= ' <tr' . drupal_attributes($attributes) . '>';
......@@ -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 .= '<li' . drupal_attributes($attributes) . '>' . $data . "</li>\n";
}
......
......@@ -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(
......
......@@ -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. <a href="@link">Add feed</a>.', array('@link' => url('admin/settings/aggregator/add/feed'))), 'colspan' => '5', 'class' => 'message'));
$rows[] = array(array('data' => t('No feeds available. <a href="@link">Add feed</a>.', 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. <a href="@link">Add category</a>.', array('@link' => url('admin/settings/aggregator/add/category'))), 'colspan' => '5', 'class' => 'message'));
$rows[] = array(array('data' => t('No categories available. <a href="@link">Add category</a>.', array('@link' => url('admin/content/aggregator/add/category'))), 'colspan' => '5', 'class' => array('message')));
}
$output .= theme('table', $header, $rows);
......
......@@ -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')),
);
}
}
......
......@@ -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']);
......
......@@ -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')),
);
}
}
......
......@@ -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;
}
......
......@@ -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',
......
......@@ -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.
......
......@@ -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);
}
}
}
......
......@@ -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')),
);
}
......
......@@ -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;
}
......
......@@ -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' => '<label>' . t('!title: !required', array('!title' => $element['#title'], '!required' => $required)) . "</label>",
'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(