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
advanced_help
Commits
098f6e21
Commit
098f6e21
authored
May 08, 2008
by
merlinofchaos
Browse files
#248759
: Expanded options for theme_advanced_help_topic
parent
ec9df256
Changes
1
Hide whitespace changes
Inline
Side-by-side
advanced_help.module
View file @
098f6e21
...
...
@@ -386,20 +386,42 @@ function advanced_help_perm() {
/**
* Display a help icon with a link to view the topic in a popup.
*
* @param $module
* The module that owns this help topic.
* @param $topic
* The identifier for the topic
* @param $type
* - 'icon' to display the question mark icon
* - 'title' to display the topic's title
* - any other text to display the text. Be sure to t() it!
*/
function
theme_advanced_help_topic
(
$module
,
$topic
)
{
$image
=
'<span>'
.
t
(
'Help'
)
.
'</span>'
;
function
theme_advanced_help_topic
(
$module
,
$topic
,
$type
=
'icon'
)
{
$info
=
advanced_help_get_topic
(
$module
,
$topic
);
if
(
!
$info
)
{
return
;
}
switch
(
$type
)
{
case
'icon'
:
$text
=
'<span>'
.
t
(
'Help'
)
.
'</span>'
;
$class
=
'advanced-help-link'
;
break
;
case
'title'
:
$text
=
$info
[
'title'
];
$class
=
'advanced-help-title'
;
break
;
default
:
$class
=
'advanced-help-title'
;
$text
=
$type
;
break
;
}
if
(
user_access
(
'view advanced help popup'
))
{
drupal_add_css
(
drupal_get_path
(
'module'
,
'advanced_help'
)
.
'/help-icon.css'
);
return
l
(
$
image
,
"help/
$module
/
$topic
"
,
array
(
return
l
(
$
text
,
"help/
$module
/
$topic
"
,
array
(
'attributes'
=>
array
(
'class'
=>
'advanced-help-link'
,
'class'
=>
$class
,
'onclick'
=>
"window.open(this.href, 'advanced_help_window', 'width=500,height=500,scrollbars,resizable'); return false;"
,
'title'
=>
$info
[
'title'
]
),
...
...
@@ -408,9 +430,9 @@ function theme_advanced_help_topic($module, $topic) {
);
}
else
{
return
l
(
$
image
,
"help/
$module
/
$topic
"
,
array
(
return
l
(
$
text
,
"help/
$module
/
$topic
"
,
array
(
'attributes'
=>
array
(
'class'
=>
'advanced-help-link'
,
'class'
=>
$class
,
'title'
=>
$info
[
'title'
]
),
'html'
=>
TRUE
)
...
...
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