diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 3ff344c..2cc870a 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -78,10 +78,6 @@ function filter_theme() { 'render element' => 'element', 'file' => 'filter.admin.inc', ), - 'filter_tips' => array( - 'variables' => array('tips' => NULL, 'long' => FALSE), - 'file' => 'filter.pages.inc', - ), 'text_format_wrapper' => array( 'render element' => 'element', ), @@ -1195,7 +1191,23 @@ function theme_filter_guidelines($variables) { $attributes['class'][] = 'filter-guidelines-' . $format->format; $output = ''; $output .= '

' . check_plain($format->name) . '

'; - $output .= theme('filter_tips', array('tips' => _filter_tips($format->format, FALSE))); + $filter_tips = _filter_tips($format->format, FALSE); + $tips = $filter_tips[$format->name]; + if (count($tips) > 0) { + $items = array(); + foreach ($tips as $tip) { + $items[] = array( + '#markup' => $tip['tip'], + '#wrapper_attributes' => array( + 'class' => array(drupal_html_class('filter-' . $tip['id'])), + ), + ); + } + $output .= theme('item_list__filter_tips_guidelines', array( + 'items' => $items, + 'attributes' => array('class' => array('tips')) + )); + } $output .= ''; return $output; } diff --git a/core/modules/filter/filter.pages.inc b/core/modules/filter/filter.pages.inc index 5b20d4f..0c51efa 100644 --- a/core/modules/filter/filter.pages.inc +++ b/core/modules/filter/filter.pages.inc @@ -15,49 +15,10 @@ * An HTML-formatted string. * * @see filter_menu() - * @see theme_filter_tips() */ function filter_tips_long($format = NULL) { - if (!empty($format)) { - $output = theme('filter_tips', array('tips' => _filter_tips($format->format, TRUE), 'long' => TRUE)); - } - else { - $output = theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE)); - } - return $output; -} - -/** - * Returns HTML for a set of filter tips. - * - * @param array $variables - * An associative array containing: - * - tips: An array containing descriptions and a CSS ID in the form of - * 'module-name/filter-id' (only used when $long is TRUE) for each - * filter in one or more text formats. Example: - * @code - * array( - * 'Full HTML' => array( - * 0 => array( - * 'tip' => 'Web page addresses and e-mail addresses turn into links automatically.', - * 'id' => 'filter/2', - * ), - * ), - * ); - * @endcode - * - long: (optional) Whether the passed-in filter tips contain extended - * explanations, i.e. intended to be output on the path 'filter/tips' - * (TRUE), or are in a short format, i.e. suitable to be displayed below a - * form element. Defaults to FALSE. - * - * @see _filter_tips() - * @ingroup themeable - */ -function theme_filter_tips($variables) { - $tips = $variables['tips']; - $long = $variables['long']; + $tips = (!empty($format)) ? _filter_tips($format->format, TRUE) : _filter_tips(-1, TRUE); $output = ''; - $multiple = count($tips) > 1; if ($multiple) { $output = '

' . t('Text Formats') . '

'; @@ -74,11 +35,19 @@ function theme_filter_tips($variables) { } if (count($tiplist) > 0) { - $output .= ''; + $output .= theme('item_list__filter_tips_long', array( + 'items' => $items, + 'attributes' => array('class' => array('tips')) + )); } if ($multiple) {