Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
424aaef4
Commit
424aaef4
authored
Dec 03, 2008
by
Dries
Browse files
- Patch
#341885
by sun: remove absolute argument in theme_filter_tips().
parent
939df0b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
modules/filter/filter.admin.inc
View file @
424aaef4
...
...
@@ -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
);
...
...
modules/filter/filter.module
View file @
424aaef4
...
...
@@ -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
);
...
...
modules/filter/filter.pages.inc
View file @
424aaef4
...
...
@@ -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
(
'
i
nput formats'
)
.
':'
;
$output
=
t
(
'
I
nput formats'
)
.
':'
;
}
if
(
count
(
$tips
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment