function example_filter_tips in Coder 7.2
Same name and namespace in other branches
- 7 coder_upgrade/tests/old/samples/example.module \example_filter_tips()
Implement hook_filter_tips().
File
- coder_upgrade/
tests/ old/ samples/ example.module, line 1036
Code
function example_filter_tips($delta, $format, $long = FALSE) {
switch ($delta) {
case 0:
if ($allowed_html = variable_get("allowed_html_{$format}", '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>')) {
switch ($long) {
case 0:
return t('Allowed HTML tags: @tags', array(
'@tags' => $allowed_html,
));
case 1:
$output = '<p>' . t('Allowed HTML tags: @tags', array(
'@tags' => $allowed_html,
)) . '</p>';
if (!variable_get("filter_html_help_{$format}", 1)) {
return $output;
}
}
}
break;
case 1:
switch ($long) {
case 0:
return t('Lines and paragraphs break automatically.');
case 1:
return t('Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
}
break;
case 2:
return t('Web page addresses and e-mail addresses turn into links automatically.');
break;
case 4:
return t('No HTML tags allowed.');
break;
}
}