Commit 7c4e513d authored by dragonwize's avatar dragonwize
Browse files

Fixed bug of long tips link showing up double sometimes

Long tips link is now also hidden if the guidelines array is empty
parent 85961a0f
......@@ -494,18 +494,26 @@ function better_formats_filter_form($value = FILTER_FORMAT_DEFAULT, $node_type =
'#id' => form_clean_id('edit-'. implode('-', $parents_for_id)),
);
if ($show_tips) {
$extra = theme('filter_tips_more_info');
$form[$format->format]['#description'] = theme('filter_tips', _filter_tips($format->format, FALSE));
$form[] = array('#value' => $extra);
}
else {
// this is to get around an issue with Wysiwyg API popping the last element
// should not be needed in D7
// see http://drupal.org/node/344169
$form[$format->format]['#description'] = '';
$form[] = array('#value' => '');
}
}
if ($show_tips) {
$extra = theme('filter_tips_more_info');
$form[] = array('#value' => $extra);
}
else {
// this is to get around an issue with Wysiwyg API popping the last element
// should not be needed in D7
// see http://drupal.org/node/344169
$form[] = array('#value' => '');
}
}
else {
// Only one format available or hiding the form: use a hidden form item.
......@@ -522,7 +530,10 @@ function better_formats_filter_form($value = FILTER_FORMAT_DEFAULT, $node_type =
'#title' => t('Formatting guidelines'),
'#value' => theme('filter_tips', $tips, FALSE, $extra),
);
$form[] = array('#value' => $extra);
// only show long tips link if there are guidelines to the format
if ($form['format']['guidelines']['#value'] != '') {
$form[] = array('#value' => $extra);
}
}
else {
// this is to get around an issue with Wysiwyg API looking for guidelines
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment