Difference between revisions of "JHTML/tooltip"
From Joomla! Documentation
< API15:JHTML
m (→Syntax: Minor misspelling - depreciated != deprecated) |
m (preparing for archive only) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 83: | Line 83: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
− | + | === Code Examples === | |
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=tooltip | category=tooltip | ||
category=JHTML | category=JHTML | ||
− | + | namespace=CodeExample | |
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Latest revision as of 19:39, 24 March 2017
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Creates a tooltip with an image as button
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
tooltip($tooltip, $title='', $image='tooltip.png', $text='', $href='', $link=1)
Parameter Name | Default Value | Description |
---|---|---|
$tooltip | $tooltip The tip string | |
$title | $title The title of the tooltip | |
$image | 'tooltip.png' | $image The image for the tip, if no text is provided |
$text | $text The text for the tip | |
$href | $href An URL that will be used to create the link | |
$link | 1 | deprecated |
Returns[edit]
string
Defined in[edit]
libraries/joomla/html/html.php
Importing[edit]
jimport( 'joomla.html.html' );
Source Body[edit]
function tooltip($tooltip, $title='', $image='tooltip.png', $text='', $href='', $link=1)
{
$tooltip = addslashes(htmlspecialchars($tooltip, ENT_QUOTES, 'UTF-8'));
$title = addslashes(htmlspecialchars($title, ENT_QUOTES, 'UTF-8'));
if ( !$text ) {
$image = JURI::root(true).'/includes/js/ThemeOffice/'. $image;
$text = '<img src="'. $image .'" border="0" alt="'. JText::_( 'Tooltip' ) .'"/>';
} else {
$text = JText::_( $text, true );
}
if($title) {
$title = $title.'::';
}
$style = 'style="text-decoration: none; color: #333;"';
if ( $href ) {
$href = JRoute::_( $href );
$style = '';
$tip = '<span class="editlinktip hasTip" title="'.$title.$tooltip.'" '. $style .'><a href="'. $href .'">'. $text .'</a></span>';
} else {
$tip = '<span class="editlinktip hasTip" title="'.$title.$tooltip.'" '. $style .'>'. $text .'</span>';
}
return $tip;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]