- Patch #341885 by sun: remove absolute argument in theme_filter_tips().

merge-requests/26/head
Dries Buytaert 2008-12-03 19:43:21 +00:00
parent 939df0b3cd
commit 424aaef46c
3 changed files with 30 additions and 7 deletions

View File

@ -159,11 +159,13 @@ function filter_admin_format_form(&$form_state, $format) {
// Composition tips (guidelines)
$tips = _filter_tips($format->format, FALSE);
$extra = '<p>' . l(t('More information about formatting options'), 'filter/tips') . '</p>';
$tiplist = theme('filter_tips', $tips, FALSE, $extra);
$tiplist = theme('filter_tips', $tips, FALSE);
if (!$tiplist) {
$tiplist = '<p>' . t('No guidelines available.') . '</p>';
}
else {
$tiplist .= theme('filter_tips_more_info');
}
$group = '<p>' . t('These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.') . '</p>';
$group .= $tiplist;
$form['tips'] = array('#markup' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group);

View File

@ -54,7 +54,7 @@ function filter_theme() {
'file' => 'filter.admin.inc',
),
'filter_tips' => array(
'arguments' => array('tips' => NULL, 'long' => FALSE, 'extra' => ''),
'arguments' => array('tips' => NULL, 'long' => FALSE),
'file' => 'filter.pages.inc',
),
'filter_tips_more_info' => array(
@ -516,7 +516,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
$tips = _filter_tips(variable_get('filter_default_format', 1), FALSE);
$form['format']['guidelines'] = array(
'#title' => t('Formatting guidelines'),
'#markup' => theme('filter_tips', $tips, FALSE, $extra),
'#markup' => theme('filter_tips', $tips, FALSE),
);
}
$form[] = array('#markup' => $extra);

View File

@ -23,16 +23,37 @@ function filter_tips_long() {
/**
* Format a set of filter tips.
* Render HTML for a set of filter tips.
*
* @param $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 input
* filter in one or more input 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
* @param $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($tips, $long = FALSE, $extra = '') {
function theme_filter_tips($tips, $long = FALSE) {
$output = '';
$multiple = count($tips) > 1;
if ($multiple) {
$output = t('input formats') . ':';
$output = t('Input formats') . ':';
}
if (count($tips)) {