diff options
Diffstat (limited to 'includes/theme.inc')
-rw-r--r-- | includes/theme.inc | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 50c78987b..d0adb23ed 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'] == '<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"; } |