Inherited by Skin.
Public Member Functions | |
__construct () | |
getExternalLinkAttributes ($class= 'external') | |
Get the appropriate HTML attributes to add to the "a" element of an ex- ternal link, as created by [wikisyntax]. | |
getInterwikiLinkAttributes ($title, $unused=null, $class= 'external') | |
Get the appropriate HTML attributes to add to the "a" element of an in- terwiki link. | |
getInternalLinkAttributes ($title, $unused=null, $class='') | |
Get the appropriate HTML attributes to add to the "a" element of an in- ternal link. | |
getInternalLinkAttributesObj ($nt, $unused=null, $class= '', $title=false) | |
Get the appropriate HTML attributes to add to the "a" element of an in- ternal link, given the Title object for the page we want to link to. | |
getLinkColour ($t, $threshold) | |
Return the CSS colour of a known link. | |
link ($target, $text=null, $customAttribs=array(), $query=array(), $options=array()) | |
This function returns an HTML link to the given target. | |
linkKnown ($target, $text=null, $customAttribs=array(), $query=array(), $options=array('known','noclasses')) | |
Identical to link(), except $options defaults to 'known'. | |
makeSizeLinkObj ($size, $nt, $text= '', $query= '', $trail= '', $prefix= '') | |
Generate either a normal exists-style link or a stub link, depending on the given page size. | |
makeSelfLinkObj ($nt, $text= '', $query= '', $trail= '', $prefix= '') | |
Make appropriate markup for a link to the current article. | |
normaliseSpecialPage (Title $title) | |
fnamePart ($url) | |
Returns the filename part of an url. | |
makeExternalImage ($url, $alt= '') | |
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage(). | |
makeImageLink2 (Title $title, $file, $frameParams=array(), $handlerParams=array(), $time=false, $query="") | |
Given parameters derived from [[Image:Foo|options. | |
makeThumbLinkObj (Title $title, $file, $label= '', $alt, $align= 'right', $params=array(), $framed=false, $manualthumb="") | |
Make HTML for a thumbnail including image, border and caption. | |
makeThumbLink2 (Title $title, $file, $frameParams=array(), $handlerParams=array(), $time=false, $query="") | |
makeBrokenImageLinkObj ($title, $text= '', $query= '', $trail= '', $prefix= '', $time=false) | |
Make a "broken" link to an image. | |
makeMediaLinkObj ($title, $text= '', $time=false) | |
Create a direct link to a given uploaded file. | |
specialLink ($name, $key= '') | |
Make a link to a special page given its name and, optionally, a message key from the link text. | |
makeExternalLink ($url, $text, $escape=true, $linktype= '', $attribs=array()) | |
Make an external link. | |
userLink ($userId, $userText) | |
Make user link (or user contributions for unregistered users). | |
userToolLinks ($userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null) | |
Generate standard user tool links (talk, contributions, block link, etc. | |
userToolLinksRedContribs ($userId, $userText, $edits=null) | |
Alias for userToolLinks( $userId, $userText, true );. | |
userTalkLink ($userId, $userText) | |
blockLink ($userId, $userText) | |
revUserLink ($rev, $isPublic=false) | |
Generate a user link if the current user is allowed to view it. | |
revUserTools ($rev, $isPublic=false) | |
Generate a user tool link cluster if the current user is allowed to view it. | |
formatComment ($comment, $title=null, $local=false) | |
This function is called by all recent changes variants, by the page history, and by the user contributions list. | |
formatLinksInComment ($comment, $title=null, $local=false) | |
Formats wiki links and media links in text; all other wiki formatting is ignored. | |
commentBlock ($comment, $title=null, $local=false) | |
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty string. | |
revComment (Revision $rev, $local=false, $isPublic=false) | |
Wrap and format the given revision's comment block, if the current user is allowed to view it. | |
formatRevisionSize ($size) | |
tocIndent () | |
Add another level to the Table of Contents. | |
tocUnindent ($level) | |
Finish one or more sublevels on the Table of Contents. | |
tocLine ($anchor, $tocline, $tocnumber, $level, $sectionIndex=false) | |
parameter level defines if we are on an indentation level | |
tocLineEnd () | |
End a Table Of Contents line. | |
tocList ($toc) | |
Wraps the TOC in a table and provides the hide/collapse javascript. | |
generateTOC ($tree) | |
Generate a table of contents from a section tree Currently unused. | |
doEditSectionLink (Title $nt, $section, $tooltip=null) | |
Create a section edit link. | |
makeHeadline ($level, $attribs, $anchor, $text, $link, $legacyAnchor=false) | |
Create a headline for content. | |
generateRollback ($rev) | |
Generate a rollback link for a given revision. | |
buildRollbackLink ($rev) | |
Build a raw rollback link, useful for collections of "tool" links. | |
formatTemplates ($templates, $preview=false, $section=false) | |
Returns HTML for the "templates used on this page" list. | |
formatHiddenCategories ($hiddencats) | |
Returns HTML for the "hidden categories on this page" list. | |
formatSize ($size) | |
Format a size in bytes for output, using an appropriate unit (B, KB, MB or GB) according to the magnitude in question. | |
titleAttrib ($name, $options=null) | |
Given the id of an interface element, constructs the appropriate title attribute from the system messages. | |
accesskey ($name) | |
Given the id of an interface element, constructs the appropriate accesskey attribute from the system messages. | |
revDeleteLink ($query=array(), $restricted=false, $delete=true) | |
Creates a (show/hide) link for deleting revisions/log entries. | |
revDeleteLinkDisabled ($delete=true) | |
Creates a dead (show/hide) link for deleting revisions/log entries. | |
postParseLinkColour ($s=null) | |
makeLink ($title, $text= '', $query= '', $trail= '') | |
makeKnownLink ($title, $text= '', $query= '', $trail= '', $prefix= '', $aprops= '') | |
makeBrokenLink ($title, $text= '', $query= '', $trail= '') | |
makeStubLink ($title, $text= '', $query= '', $trail= '') | |
makeLinkObj ($nt, $text= '', $query= '', $trail= '', $prefix= '') | |
makeKnownLinkObj ($title, $text= '', $query= '', $trail= '', $prefix= '', $aprops= '', $style= '') | |
makeBrokenLinkObj ($title, $text= '', $query= '', $trail= '', $prefix= '') | |
makeStubLinkObj ($nt, $text= '', $query= '', $trail= '', $prefix= '') | |
makeColouredLinkObj ($nt, $colour, $text= '', $query= '', $trail= '', $prefix= '') | |
makeImage ($url, $alt= '') | |
Obsolete alias. | |
makeImageLinkObj ($title, $label, $alt, $align= '', $handlerParams=array(), $framed=false, $thumb=false, $manualthumb= '', $valign= '', $time=false) | |
Creates the HTML source for images. | |
makeMediaLink ($name, $unused= '', $text= '', $time=false) | |
editSectionLinkForOther ($title, $section) | |
Used to generate section edit links that point to "other" pages (sections that are really part of included pages). | |
editSectionLink (Title $nt, $section, $hint= '') | |
tooltipAndAccesskeyAttribs ($name) | |
Returns the attributes for the tooltip and access key. | |
tooltipAndAccesskey ($name) | |
tooltip ($name, $options=null) | |
Static Public Member Functions | |
static | normalizeSubpageLink ($contextTitle, $target, &$text) |
static | splitTrail ($trail) |
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array. | |
Public Attributes | |
const | TOOL_LINKS_NOBLOCK = 1 |
Flags for userToolLinks(). | |
Protected Member Functions | |
getUploadUrl ($destFile, $query= '') | |
Get the URL to upload a certain file. | |
formatLinksInCommentCallback ($match) | |
Private Member Functions | |
getLinkAttributesInternal ($title, $class) | |
Common code for getLinkAttributesX functions. | |
linkUrl ($target, $query, $options) | |
Returns the Url used to link to a Title. | |
linkAttribs ($target, $attribs, $options) | |
Returns the array of attributes used when linking to the Title $target. | |
linkText ($target) | |
Default text of the links to the Title $target. | |
formatAutocomments ($comment, $title=null, $local=false) | |
The pattern for autogen comments is / * foo * /, which makes for some nasty regex. | |
formatAutocommentsCallback ($match) |
These functions are used for primarily page content: links, embedded images, table of contents. Links are also used in the skin. For the moment, Skin is a descendent class of Linker. In the future, it should probably be further split so that every other bit of the wiki doesn't have to go loading up Skin to get at it.
Definition at line 11 of file Linker.php.
Linker::__construct | ( | ) |
Linker::accesskey | ( | $ | name | ) |
Given the id of an interface element, constructs the appropriate accesskey attribute from the system messages.
(Note, this is usually the id but isn't always, because sometimes the accesskey needs to go on a different element than the id, for reverse-compatibility, etc.)
string | $name Id of the element, minus prefixes. |
Definition at line 1647 of file Linker.php.
Referenced by tooltipAndAccesskeyAttribs().
Linker::blockLink | ( | $ | userId, | |
$ | userText | |||
) |
$userId | Integer: userid | |
$userText | String: user name in database. |
Definition at line 896 of file Linker.php.
References SpecialPage::getTitleFor(), link(), and wfMsgHtml().
Referenced by userToolLinks().
Linker::buildRollbackLink | ( | $ | rev | ) |
Build a raw rollback link, useful for collections of "tool" links.
Revision | $rev |
Definition at line 1476 of file Linker.php.
References $wgRequest, $wgUser, Title::getPrefixedText(), link(), wfMsg(), and wfMsgHtml().
Referenced by generateRollback().
Linker::commentBlock | ( | $ | comment, | |
$ | title = null , |
|||
$ | local = false | |||
) |
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty string.
string | $comment | |
mixed | $title Title object (to generate link to section in autocomment) or null | |
bool | $local Whether section links should refer to local page |
Definition at line 1216 of file Linker.php.
References formatComment().
Referenced by revComment().
Linker::doEditSectionLink | ( | Title $ | nt, | |
$ | section, | |||
$ | tooltip = null | |||
) |
Create a section edit link.
This supersedes editSectionLink() and editSectionLinkForOther().
$nt | Title The title being linked to (may not be the same as $wgTitle, if the section is included from a template) | |
$section | string The designation of the section being pointed to, to be included in the link, like "§ion=$section" | |
$tooltip | string The tooltip to use for the link: will be escaped and wrapped in the 'editsectionhint' message |
Definition at line 1363 of file Linker.php.
References $result, $section, link(), wfMsg(), wfMsgHtml(), and wfRunHooks().
Referenced by editSectionLink(), and editSectionLinkForOther().
Linker::editSectionLink | ( | Title $ | nt, | |
$ | section, | |||
$ | hint = '' | |||
) |
$nt | Title object. | |
$section | Integer: section number. | |
$hint | Link String: title, or default if omitted or empty |
Definition at line 2006 of file Linker.php.
References $section, doEditSectionLink(), and wfDeprecated().
Linker::editSectionLinkForOther | ( | $ | title, | |
$ | section | |||
) |
Used to generate section edit links that point to "other" pages (sections that are really part of included pages).
$title | Title string. | |
$section | Integer: section number. |
Definition at line 1994 of file Linker.php.
References $section, doEditSectionLink(), Title::newFromText(), and wfDeprecated().
Linker::fnamePart | ( | $ | url | ) |
Returns the filename part of an url.
Used as alternative text for external images.
Definition at line 376 of file Linker.php.
References $url.
Referenced by makeExternalImage().
Linker::formatAutocomments | ( | $ | comment, | |
$ | title = null , |
|||
$ | local = false | |||
) | [private] |
The pattern for autogen comments is / * foo * /, which makes for some nasty regex.
We look for all comments, match any text before and after the comment, add a separator where needed and format the comment itself with CSS Called by Linker::formatComment.
string | $comment Comment text | |
object | $title An optional title object used to links to sections |
Definition at line 991 of file Linker.php.
Referenced by formatComment().
Linker::formatAutocommentsCallback | ( | $ | match | ) | [private] |
Definition at line 1004 of file Linker.php.
References $section, Title::getDBkey(), Title::getNamespace(), link(), Title::makeTitleSafe(), Title::newFromText(), wfMsgExt(), and wfMsgForContent().
Linker::formatComment | ( | $ | comment, | |
$ | title = null , |
|||
$ | local = false | |||
) |
This function is called by all recent changes variants, by the page history, and by the user contributions list.
It is responsible for formatting edit comments. It escapes any HTML in the comment, but adds some CSS to format auto-generated comments (from section editing) and formats [[wikilinks]].
Note: there's not always a title to pass to this function. Since you can't set a default parameter for a reference, I've turned it temporarily to a value pass. Should be adjusted further. --brion
string | $comment | |
mixed | $title Title object (to generate link to the section in autocomment) or null | |
bool | $local Whether section links should refer to local page |
Definition at line 962 of file Linker.php.
References Sanitizer::escapeHtmlAllowEntities(), formatAutocomments(), formatLinksInComment(), wfProfileIn(), and wfProfileOut().
Referenced by commentBlock().
Linker::formatHiddenCategories | ( | $ | hiddencats | ) |
Returns HTML for the "hidden categories on this page" list.
array | $hiddencats Array of hidden categories from Article::getHiddenCategories or similar |
Definition at line 1566 of file Linker.php.
References $wgLang, link(), wfMsgExt(), and wfProfileIn().
Linker::formatLinksInComment | ( | $ | comment, | |
$ | title = null , |
|||
$ | local = false | |||
) |
Formats wiki links and media links in text; all other wiki formatting is ignored.
string | $comment Text to format links in |
Definition at line 1059 of file Linker.php.
Referenced by formatComment().
Linker::formatLinksInCommentCallback | ( | $ | match | ) | [protected] |
Definition at line 1071 of file Linker.php.
References $wgContLang, StringUtils::escapeRegexReplacement(), MWNamespace::getCanonicalName(), link(), makeMediaLinkObj(), Title::makeTitleSafe(), Title::newFromText(), normalizeSubpageLink(), and splitTrail().
Linker::formatRevisionSize | ( | $ | size | ) |
Linker::formatSize | ( | $ | size | ) |
Format a size in bytes for output, using an appropriate unit (B, KB, MB or GB) according to the magnitude in question.
$size | Size to format |
Definition at line 1593 of file Linker.php.
Linker::formatTemplates | ( | $ | templates, | |
$ | preview = false , |
|||
$ | section = false | |||
) |
Returns HTML for the "templates used on this page" list.
array | $templates Array of templates from Article::getUsedTemplate or similar | |
bool | $preview Whether this is for a preview | |
bool | $section Whether this is for a section edit |
Definition at line 1503 of file Linker.php.
References $section, link(), wfMsg(), wfMsgExt(), wfProfileIn(), and wfProfileOut().
Linker::generateRollback | ( | $ | rev | ) |
Generate a rollback link for a given revision.
Currently it's the caller's responsibility to ensure that the revision is the top one. If it's not, of course, the user will get an error message.
If the calling page is called with the parameter &bot=1, all rollback links also get that parameter. It causes the edit itself and the rollback to be marked as "bot" edits. Bot edits are hidden by default from recent changes, so this allows sysops to combat a busy vandal without bothering other users.
Revision | $rev |
Definition at line 1464 of file Linker.php.
References buildRollbackLink().
Linker::generateTOC | ( | $ | tree | ) |
Generate a table of contents from a section tree Currently unused.
$tree | Return value of ParserOutput::getSections() |
Definition at line 1330 of file Linker.php.
References $section, tocIndent(), tocLine(), tocLineEnd(), tocList(), and tocUnindent().
Linker::getExternalLinkAttributes | ( | $ | class = 'external' |
) |
Get the appropriate HTML attributes to add to the "a" element of an ex- ternal link, as created by [wikisyntax].
string | $class The contents of the class attribute; if an empty string is passed, which is the default value, defaults to 'external'. |
Definition at line 27 of file Linker.php.
References getLinkAttributesInternal().
Referenced by makeExternalLink().
Linker::getInternalLinkAttributes | ( | $ | title, | |
$ | unused = null , |
|||
$ | class = '' | |||
) |
Get the appropriate HTML attributes to add to the "a" element of an in- ternal link.
string | $title The title text for the link, URL-encoded (???) but not HTML-escaped | |
string | $unused Unused | |
string | $class The contents of the class attribute, default none |
Definition at line 62 of file Linker.php.
References $title, and getLinkAttributesInternal().
Linker::getInternalLinkAttributesObj | ( | $ | nt, | |
$ | unused = null , |
|||
$ | class = '' , |
|||
$ | title = false | |||
) |
Get the appropriate HTML attributes to add to the "a" element of an in- ternal link, given the Title object for the page we want to link to.
Title | $nt The Title object | |
string | $unused Unused | |
string | $class The contents of the class attribute, default none | |
mixed | $title Optional (unescaped) string to use in the title attribute; if false, default to the name of the page we're linking to |
Definition at line 78 of file Linker.php.
References $title, and getLinkAttributesInternal().
Referenced by makeColouredLinkObj().
Linker::getInterwikiLinkAttributes | ( | $ | title, | |
$ | unused = null , |
|||
$ | class = 'external' | |||
) |
Get the appropriate HTML attributes to add to the "a" element of an in- terwiki link.
string | $title The title text for the link, URL-encoded (???) but not HTML-escaped | |
string | $unused Unused | |
string | $class The contents of the class attribute; if an empty string is passed, which is the default value, defaults to 'external'. |
Definition at line 41 of file Linker.php.
References $title, $wgContLang, and getLinkAttributesInternal().
Linker::getLinkAttributesInternal | ( | $ | title, | |
$ | class | |||
) | [private] |
Common code for getLinkAttributesX functions.
Definition at line 88 of file Linker.php.
References $title.
Referenced by getExternalLinkAttributes(), getInternalLinkAttributes(), getInternalLinkAttributesObj(), and getInterwikiLinkAttributes().
Linker::getLinkColour | ( | $ | t, | |
$ | threshold | |||
) |
Return the CSS colour of a known link.
Title | $t | |
integer | $threshold user defined threshold |
Definition at line 108 of file Linker.php.
References $t, and MWNamespace::isContent().
Linker::getUploadUrl | ( | $ | destFile, | |
$ | query = '' | |||
) | [protected] |
Get the URL to upload a certain file.
$destFile | Title Title of the file to upload | |
$query | string Urlencoded query string to prepend |
Definition at line 710 of file Linker.php.
References $wgUploadNavigationUrl, SpecialPage::getTitleFor(), and wfAppendQuery().
Referenced by makeBrokenImageLinkObj(), and makeMediaLinkObj().
Linker::link | ( | $ | target, | |
$ | text = null , |
|||
$ | customAttribs = array() , |
|||
$ | query = array() , |
|||
$ | options = array() | |||
) |
This function returns an HTML link to the given target.
It serves a few purposes: 1) If $target is a Title, the correct URL to link to will be figured out automatically. 2) It automatically adds the usual classes for various types of link targets: "new" for red links, "stub" for short articles, etc. 3) It escapes all attribute values safely so there's no risk of XSS. 4) It provides a default tooltip if the target is a Title (the page name of the target). link() replaces the old functions in the makeLink() family.
$target | Title Can currently only be a Title, but this may change to support Images, literal URLs, etc. | |
$text | string The HTML contents of the element, i.e., the link text. This is raw HTML and will not be escaped. If null, defaults to the prefixed text of the Title; or if the Title is just a fragment, the contents of the fragment. | |
$customAttribs | array A key => value array of extra HTML attri- butes, such as title and class. (href is ignored.) Classes will be merged with the default classes, while other attributes will replace default attributes. All passed attribute values will be HTML-escaped. A false attribute value means to suppress that attribute. | |
$query | array The query string to append to the URL you're linking to, in key => value array form. Query keys and values will be URL-encoded. | |
$options | mixed String or array of strings: 'known': Page is known to exist, so don't check if it does. 'broken': Page is known not to exist, so don't check if it does. 'noclasses': Don't add any classes automatically (includes "new", "stub", "mw-redirect", "extiw"). Only use the class attribute provided, if any, so you get a simple blue link with no funny i- cons. 'forcearticlepath': Use the article path always, even with a querystring. Has compatibility issues on some setups, so avoid wherever possible. |
Definition at line 159 of file Linker.php.
References $options, linkAttribs(), linkText(), linkUrl(), normaliseSpecialPage(), Html::rawElement(), wfAppendQuery(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by blockLink(), buildRollbackLink(), SkinCologneBlue::doAfterContent(), doEditSectionLink(), formatAutocommentsCallback(), formatHiddenCategories(), formatLinksInCommentCallback(), formatTemplates(), linkKnown(), makeBrokenLinkObj(), makeImageLink2(), makeKnownLinkObj(), makeLinkObj(), SkinTemplate::outputPage(), SkinStandard::quickBar(), SkinCologneBlue::quickBar(), SkinNostalgia::topLinks(), userLink(), userTalkLink(), and userToolLinks().
Linker::linkAttribs | ( | $ | target, | |
$ | attribs, | |||
$ | options | |||
) | [private] |
Returns the array of attributes used when linking to the Title $target.
Definition at line 251 of file Linker.php.
References $classes, $defaults, $options, $wgUser, Sanitizer::mergeAttributes(), wfMsg(), wfProfileIn(), and wfProfileOut().
Referenced by link().
Linker::linkKnown | ( | $ | target, | |
$ | text = null , |
|||
$ | customAttribs = array() , |
|||
$ | query = array() , |
|||
$ | options = array('known','noclasses') | |||
) |
Identical to link(), except $options defaults to 'known'.
Definition at line 219 of file Linker.php.
References $options, and link().
Referenced by SkinStandard::quickBar(), SkinCologneBlue::quickBar(), and SkinCologneBlue::sysLinks().
Linker::linkText | ( | $ | target | ) | [private] |
Default text of the links to the Title $target.
Definition at line 313 of file Linker.php.
Referenced by link(), makeBrokenLinkObj(), makeKnownLinkObj(), and makeLinkObj().
Linker::linkUrl | ( | $ | target, | |
$ | query, | |||
$ | options | |||
) | [private] |
Returns the Url used to link to a Title.
Definition at line 226 of file Linker.php.
References $options, wfProfileIn(), and wfProfileOut().
Referenced by link().
Linker::makeBrokenImageLinkObj | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' , |
|||
$ | time = false | |||
) |
Make a "broken" link to an image.
Title | $title Image title | |
string | $text Link label | |
string | $query Query string | |
string | $trail Link trail | |
string | $prefix Link prefix | |
bool | $time, a file of a certain timestamp was requested |
Definition at line 668 of file Linker.php.
References $wgEnableUploads, $wgUploadNavigationUrl, Html::element(), Title::getPrefixedText(), getUploadUrl(), makeKnownLinkObj(), RepoGroup::singleton(), splitTrail(), wfFindFile(), wfProfileIn(), and wfProfileOut().
Referenced by makeImageLink2(), and makeThumbLink2().
Linker::makeBrokenLink | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' | |||
) |
This function is a shortcut to makeBrokenLinkObj(Title::newFromText($title),...). Do not call it if you already have a title object handy. See makeBrokenLinkObj for further documentation.
string | $title The text of the title | |
string | $text Link text | |
string | $query Optional query part | |
string | $trail Optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1769 of file Linker.php.
References makeBrokenLinkObj(), Title::newFromText(), and wfDebug().
Linker::makeBrokenLinkObj | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' | |||
) |
Make a red link to the edit page of a given title.
$nt | Title object of the target page | |
$text | String: Link text | |
$query | String: Optional query part | |
$trail | String: Optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1882 of file Linker.php.
References link(), linkText(), normaliseSpecialPage(), splitTrail(), wfCgiToArray(), wfProfileIn(), and wfProfileOut().
Referenced by makeBrokenLink().
Linker::makeColouredLinkObj | ( | $ | nt, | |
$ | colour, | |||
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' | |||
) |
Make a coloured link.
$nt | Title object of the target page | |
$colour | Integer: colour of the link | |
$text | String: link text | |
$query | String: optional query part | |
$trail | String: optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1928 of file Linker.php.
References getInternalLinkAttributesObj(), and makeKnownLinkObj().
Referenced by makeSizeLinkObj(), and makeStubLinkObj().
Linker::makeExternalImage | ( | $ | url, | |
$ | alt = '' | |||
) |
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage().
Definition at line 390 of file Linker.php.
References $success, $url, Html::element(), fnamePart(), wfDebug(), and wfRunHooks().
Referenced by makeImage().
Linker::makeExternalLink | ( | $ | url, | |
$ | text, | |||
$ | escape = true , |
|||
$ | linktype = '' , |
|||
$ | attribs = array() | |||
) |
Make an external link.
String | $url URL to link to | |
String | $text text of link | |
boolean | $escape Do we escape the link text? | |
String | $linktype Type of external link. Gets added to the classes | |
array | $attribs Array of extra attributes to |
Definition at line 787 of file Linker.php.
References $success, $url, Html::expandAttributes(), getExternalLinkAttributes(), wfDebug(), and wfRunHooks().
Linker::makeHeadline | ( | $ | level, | |
$ | attribs, | |||
$ | anchor, | |||
$ | text, | |||
$ | link, | |||
$ | legacyAnchor = false | |||
) |
Create a headline for content.
int | $level The level of the headline (1-6) | |
string | $attribs Any attributes for the headline, starting with a space and ending with '>' This *must* be at least '>' for no attribs | |
string | $anchor The anchor to give the headline (the bit after the #) | |
string | $text The text of the header | |
string | $link HTML to add for the section edit link | |
mixed | $legacyAnchor A second, optional anchor to give for backward compatibility (false to omit) |
Definition at line 1417 of file Linker.php.
Linker::makeImage | ( | $ | url, | |
$ | alt = '' | |||
) |
Obsolete alias.
Definition at line 1936 of file Linker.php.
References $url, makeExternalImage(), and wfDeprecated().
Linker::makeImageLink2 | ( | Title $ | title, | |
$ | file, | |||
$ | frameParams = array() , |
|||
$ | handlerParams = array() , |
|||
$ | time = false , |
|||
$ | query = "" | |||
) |
Given parameters derived from [[Image:Foo|options.
..]], generate the HTML that that syntax inserts in the page.
Title | $title Title object | |
File | $file File object, or false if it doesn't exist | |
array | $frameParams Associative array of parameters external to the media handler. Boolean parameters are indicated by presence or absence, the value is arbitrary and will often be false. thumbnail If present, downscale and frame manualthumb Image name to use as a thumbnail, instead of automatic scaling framed Shows image in original size in a frame frameless Downscale but don't frame upright If present, tweak default sizes for portrait orientation upright_factor Fudge factor for "upright" tweak (default 0.75) border If present, show a border around the image align Horizontal alignment (left, right, center, none) valign Vertical alignment (baseline, sub, super, top, text-top, middle, bottom, text-bottom) alt Alternate text for image (i.e. alt attribute). Plain text. caption HTML for image caption. link-url URL to link to link-title Title object to link to no-link Boolean, suppress description link | |
array | $handlerParams Associative array of media handler parameters, to be passed to transform(). Typical keys are "width" and "page". | |
string | $time, timestamp of the file, set as false for current | |
string | $query, query params for desc url |
Definition at line 438 of file Linker.php.
References $page, $res, $s, $wgContLang, $wgThumbLimits, $wgThumbUpright, $wgUser, User::getDefaultOption(), Title::getPrefixedDBkey(), link(), makeBrokenImageLinkObj(), wfDebug(), and wfRunHooks().
Referenced by makeImageLinkObj().
Linker::makeImageLinkObj | ( | $ | title, | |
$ | label, | |||
$ | alt, | |||
$ | align = '' , |
|||
$ | handlerParams = array() , |
|||
$ | framed = false , |
|||
$ | thumb = false , |
|||
$ | manualthumb = '' , |
|||
$ | valign = '' , |
|||
$ | time = false | |||
) |
Creates the HTML source for images.
object | $title | |
string | $label label text | |
string | $alt alt text | |
string | $align horizontal alignment: none, left, center, right) | |
array | $handlerParams Parameters to be passed to the media handler | |
boolean | $framed shows image in original size in a frame | |
boolean | $thumb shows image as thumbnail in a frame | |
string | $manualthumb image name for the manual thumbnail | |
string | $valign vertical alignment: baseline, sub, super, top, text-top, middle, bottom, text-bottom | |
string | $time, timestamp of the file, set as false for current |
Definition at line 1957 of file Linker.php.
References makeImageLink2(), and wfFindFile().
Linker::makeKnownLink | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' , |
|||
$ | aprops = '' | |||
) |
This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call it if you already have a title object handy. See makeKnownLinkObj for further documentation.
$title | String: the text of the title | |
$text | String: link text | |
$query | String: optional query part | |
$trail | String: optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1746 of file Linker.php.
References makeKnownLinkObj(), Title::newFromText(), and wfDebug().
Referenced by specialLink().
Linker::makeKnownLinkObj | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' , |
|||
$ | aprops = '' , |
|||
$ | style = '' | |||
) |
Make a link for a title which definitely exists. This is faster than makeLinkObj because it doesn't have to do a database query. It's also valid for interwiki titles and special pages.
$nt | Title object of target page | |
$text | String: text to replace the title | |
$query | String: link target | |
$trail | String: text after link | |
$prefix | String: text before link text | |
$aprops | String: extra attributes to the a-element | |
$style | String: style to apply - if empty, use getInternalLinkAttributesObj instead |
Definition at line 1850 of file Linker.php.
References Sanitizer::decodeTagAttributes(), link(), linkText(), Sanitizer::mergeAttributes(), splitTrail(), wfCgiToArray(), wfProfileIn(), and wfProfileOut().
Referenced by makeBrokenImageLinkObj(), makeColouredLinkObj(), and makeKnownLink().
Linker::makeLink | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' | |||
) |
This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call it if you already have a title object handy. See makeLinkObj for further documentation.
$title | String: the text of the title | |
$text | String: link text | |
$query | String: optional query part | |
$trail | String: optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1719 of file Linker.php.
Linker::makeLinkObj | ( | $ | nt, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' | |||
) |
Make a link for a title which may or may not be in the database. If you need to call this lots of times, pre-fill the link cache with a LinkBatch, otherwise each call to this will result in a DB query.
$nt | Title: the title object to make the link from, e.g. from Title::newFromText. | |
$text | String: link text | |
$query | String: optional query part | |
$trail | String: optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. | |
$prefix | String: optional prefix. As trail, only before instead of after. |
Definition at line 1819 of file Linker.php.
References link(), linkText(), splitTrail(), wfCgiToArray(), wfProfileIn(), and wfProfileOut().
Linker::makeMediaLink | ( | $ | name, | |
$ | unused = '' , |
|||
$ | text = '' , |
|||
$ | time = false | |||
) |
Definition at line 1981 of file Linker.php.
References $name, makeMediaLinkObj(), and Title::makeTitleSafe().
Linker::makeMediaLinkObj | ( | $ | title, | |
$ | text = '' , |
|||
$ | time = false | |||
) |
Create a direct link to a given uploaded file.
$title | Title object. | |
$text | String: pre-sanitized HTML | |
$time | string: time image was created |
Definition at line 735 of file Linker.php.
References $url, Title::getText(), getUploadUrl(), and wfFindFile().
Referenced by formatLinksInCommentCallback(), and makeMediaLink().
Linker::makeSelfLinkObj | ( | $ | nt, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' | |||
) |
Make appropriate markup for a link to the current article.
This is currently rendered as the bold link text. The calling sequence is the same as the other make*LinkObj functions, despite $query not being used.
Definition at line 352 of file Linker.php.
References splitTrail().
Linker::makeSizeLinkObj | ( | $ | size, | |
$ | nt, | |||
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' | |||
) |
Generate either a normal exists-style link or a stub link, depending on the given page size.
$size | Integer | |
$nt | Title object. | |
$text | String | |
$query | String | |
$trail | String | |
$prefix | String |
Definition at line 339 of file Linker.php.
References $size, $wgUser, and makeColouredLinkObj().
Linker::makeStubLink | ( | $ | title, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' | |||
) |
This function is a shortcut to makeStubLinkObj(Title::newFromText($title),...). Do not call it if you already have a title object handy. See makeStubLinkObj for further documentation.
$title | String: the text of the title | |
$text | String: link text | |
$query | String: optional query part | |
$trail | String: optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1792 of file Linker.php.
References makeStubLinkObj(), Title::newFromText(), wfDebug(), and wfDeprecated().
Linker::makeStubLinkObj | ( | $ | nt, | |
$ | text = '' , |
|||
$ | query = '' , |
|||
$ | trail = '' , |
|||
$ | prefix = '' | |||
) |
Make a brown link to a short article.
$nt | Title object of the target page | |
$text | String: link text | |
$query | String: optional query part | |
$trail | String: optional trail. Alphabetic characters at the start of this string will be included in the link text. Other characters will be appended after the end of the link. |
Definition at line 1910 of file Linker.php.
References makeColouredLinkObj(), and wfDeprecated().
Referenced by makeStubLink().
Linker::makeThumbLink2 | ( | Title $ | title, | |
$ | file, | |||
$ | frameParams = array() , |
|||
$ | handlerParams = array() , |
|||
$ | time = false , |
|||
$ | query = "" | |||
) |
Definition at line 566 of file Linker.php.
References $page, $s, $url, $wgContLang, $wgStylePath, Title::getLocalURL(), makeBrokenImageLinkObj(), Title::makeTitleSafe(), wfAppendQuery(), wfFindFile(), and wfMsg().
Referenced by makeThumbLinkObj().
Linker::makeThumbLinkObj | ( | Title $ | title, | |
$ | file, | |||
$ | label = '' , |
|||
$ | alt, | |||
$ | align = 'right' , |
|||
$ | params = array() , |
|||
$ | framed = false , |
|||
$ | manualthumb = "" | |||
) |
Make HTML for a thumbnail including image, border and caption.
Definition at line 555 of file Linker.php.
References makeThumbLink2().
Linker::normaliseSpecialPage | ( | Title $ | title | ) |
Definition at line 360 of file Linker.php.
References $name, Title::getDBkey(), Title::getFragment(), Title::getNamespace(), SpecialPage::getTitleFor(), and SpecialPage::resolveAliasWithSubpage().
Referenced by link(), and makeBrokenLinkObj().
static Linker::normalizeSubpageLink | ( | $ | contextTitle, | |
$ | target, | |||
&$ | text | |||
) | [static] |
Definition at line 1134 of file Linker.php.
References MWNamespace::hasSubpages(), wfProfileIn(), and wfProfileOut().
Referenced by formatLinksInCommentCallback(), and Parser::maybeDoSubpageLink().
Linker::postParseLinkColour | ( | $ | s = null |
) |
Linker::revComment | ( | Revision $ | rev, | |
$ | local = false , |
|||
$ | isPublic = false | |||
) |
Wrap and format the given revision's comment block, if the current user is allowed to view it.
Revision | $rev | |
bool | $local Whether section links should refer to local page | |
$isPublic,show | only if all users can see it |
Definition at line 1237 of file Linker.php.
References commentBlock(), Revision::DELETED_COMMENT, Revision::FOR_THIS_USER, Revision::getComment(), Revision::getRawComment(), Revision::getTitle(), Revision::isDeleted(), Revision::userCan(), and wfMsgHtml().
Linker::revDeleteLink | ( | $ | query = array() , |
|
$ | restricted = false , |
|||
$ | delete = true | |||
) |
Creates a (show/hide) link for deleting revisions/log entries.
array | $query Query parameters to be passed to link() | |
bool | $restricted Set to true to use a instead of a | |
bool | $delete Set to true to use (show/hide) rather than (show) |
Definition at line 1674 of file Linker.php.
Linker::revDeleteLinkDisabled | ( | $ | delete = true |
) |
Creates a dead (show/hide) link for deleting revisions/log entries.
bool | $delete Set to true to use (show/hide) rather than (show) |
Definition at line 1690 of file Linker.php.
Linker::revUserLink | ( | $ | rev, | |
$ | isPublic = false | |||
) |
Generate a user link if the current user is allowed to view it.
$rev | Revision object. | |
$isPublic,bool,show | only if all users can see it |
Definition at line 908 of file Linker.php.
References Revision::DELETED_USER, Revision::FOR_THIS_USER, userLink(), and wfMsgHtml().
Linker::revUserTools | ( | $ | rev, | |
$ | isPublic = false | |||
) |
Generate a user tool link cluster if the current user is allowed to view it.
$rev | Revision object. | |
$isPublic,bool,show | only if all users can see it |
Definition at line 929 of file Linker.php.
References Revision::DELETED_USER, Revision::FOR_THIS_USER, userLink(), userToolLinks(), and wfMsgHtml().
Linker::specialLink | ( | $ | name, | |
$ | key = '' | |||
) |
Make a link to a special page given its name and, optionally, a message key from the link text.
Usage example: $skin->specialLink( 'recentchanges' )
Definition at line 762 of file Linker.php.
References $name, $wgContLang, makeKnownLink(), and wfMsg().
Referenced by SkinStandard::doAfterContent(), SkinStandard::quickBar(), SkinCologneBlue::quickBar(), SkinCologneBlue::sysLinks(), and SkinNostalgia::topLinks().
static Linker::splitTrail | ( | $ | trail | ) | [static] |
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array.
Definition at line 1434 of file Linker.php.
References $wgContLang.
Referenced by formatLinksInCommentCallback(), makeBrokenImageLinkObj(), makeBrokenLinkObj(), LinkHolderArray::makeHolder(), Parser::makeKnownLinkHolder(), makeKnownLinkObj(), makeLinkObj(), makeSelfLinkObj(), and Parser::replaceExternalLinks().
Linker::titleAttrib | ( | $ | name, | |
$ | options = null | |||
) |
Given the id of an interface element, constructs the appropriate title attribute from the system messages.
(Note, this is usually the id but isn't always, because sometimes the accesskey needs to go on a different element than the id, for reverse-compatibility, etc.)
string | $name Id of the element, minus prefixes. | |
mixed | $options null or the string 'withaccess' to add an access- key hint |
Definition at line 1610 of file Linker.php.
Referenced by tooltip(), and tooltipAndAccesskeyAttribs().
Linker::tocIndent | ( | ) |
Add another level to the Table of Contents.
Definition at line 1268 of file Linker.php.
Referenced by generateTOC().
Linker::tocLine | ( | $ | anchor, | |
$ | tocline, | |||
$ | tocnumber, | |||
$ | level, | |||
$ | sectionIndex = false | |||
) |
parameter level defines if we are on an indentation level
Definition at line 1282 of file Linker.php.
References $classes.
Referenced by generateTOC().
Linker::tocLineEnd | ( | ) |
End a Table Of Contents line.
tocUnindent() will be used instead if we're ending a line below the new level.
Definition at line 1297 of file Linker.php.
Referenced by generateTOC().
Linker::tocList | ( | $ | toc | ) |
Wraps the TOC in a table and provides the hide/collapse javascript.
string | $toc html of the Table Of Contents |
Definition at line 1306 of file Linker.php.
References Xml::escapeJsString(), Html::inlineScript(), wfMsg(), and wfMsgHtml().
Referenced by generateTOC().
Linker::tocUnindent | ( | $ | level | ) |
Finish one or more sublevels on the Table of Contents.
Definition at line 1275 of file Linker.php.
Referenced by generateTOC().
Linker::tooltip | ( | $ | name, | |
$ | options = null | |||
) |
Definition at line 2047 of file Linker.php.
References $name, $options, $wgEnableTooltipsAndAccesskeys, Xml::expandAttributes(), and titleAttrib().
Linker::tooltipAndAccesskey | ( | $ | name | ) |
Definition at line 2041 of file Linker.php.
References $name, Xml::expandAttributes(), and tooltipAndAccesskeyAttribs().
Linker::tooltipAndAccesskeyAttribs | ( | $ | name | ) |
Returns the attributes for the tooltip and access key.
Definition at line 2019 of file Linker.php.
References $name, $wgEnableTooltipsAndAccesskeys, accesskey(), and titleAttrib().
Referenced by tooltipAndAccesskey().
Linker::userLink | ( | $ | userId, | |
$ | userText | |||
) |
Make user link (or user contributions for unregistered users).
$userId | Integer: user id in database. | |
$userText | String: user name in database |
Definition at line 815 of file Linker.php.
References $page, SpecialPage::getTitleFor(), link(), and Title::makeTitle().
Referenced by revUserLink(), and revUserTools().
Linker::userTalkLink | ( | $ | userId, | |
$ | userText | |||
) |
$userId | Integer: user id in database. | |
$userText | String: user name in database. |
Definition at line 884 of file Linker.php.
References link(), Title::makeTitle(), and wfMsgHtml().
Referenced by userToolLinks().
Linker::userToolLinks | ( | $ | userId, | |
$ | userText, | |||
$ | redContribsWhenNoEdits = false , |
|||
$ | flags = 0 , |
|||
$ | edits = null | |||
) |
Generate standard user tool links (talk, contributions, block link, etc.
)
int | $userId User identifier | |
string | $userText User name or IP address | |
bool | $redContribsWhenNoEdits Should the contributions link be red if the user has no edits? | |
int | $flags Customisation flags (e.g. self::TOOL_LINKS_NOBLOCK) | |
int | $edits, user edit count (optional, for performance) |
Definition at line 834 of file Linker.php.
References $wgDisableAnonTalk, $wgLang, $wgSysopUserBans, $wgUser, blockLink(), User::edits(), SpecialPage::getTitleFor(), link(), userTalkLink(), and wfMsgHtml().
Referenced by revUserTools(), and userToolLinksRedContribs().
Linker::userToolLinksRedContribs | ( | $ | userId, | |
$ | userText, | |||
$ | edits = null | |||
) |
Alias for userToolLinks( $userId, $userText, true );.
int | $userId User identifier | |
string | $userText User name or IP address | |
int | $edits, user edit count (optional, for performance) |
Definition at line 873 of file Linker.php.
References userToolLinks().
const Linker::TOOL_LINKS_NOBLOCK = 1 |
Flags for userToolLinks().
Definition at line 16 of file Linker.php.
Referenced by IPUnblockForm::formatRow(), and LogPage::getTitleLink().