MediaWiki master
|
Some internal bits split of from Skin.php. More...
Static Public Member Functions | |
static | accesskey ( $name, $localizer=null) |
Given the id of an interface element, constructs the appropriate accesskey attribute from the system messages. | |
static | blockLink ( $userId, $userText) |
static | buildRollbackLink (RevisionRecord $revRecord, ?IContextSource $context=null, $editCount=false) |
Build a raw rollback link, useful for collections of "tool" links. | |
static | emailLink ( $userId, $userText) |
static | expandLocalLinks (string $html) |
Helper function to expand local links. | |
static | formatHiddenCategories ( $hiddencats) |
Returns HTML for the "hidden categories on this page" list. | |
static | formatRevisionSize ( $size) |
static | generateRollback (RevisionRecord $revRecord, ?IContextSource $context=null, $options=[]) |
Generate a rollback link for a given revision. | |
static | getImageLinkMTOParams ( $frameParams, $query='', $parser=null) |
Get the link parameters for MediaTransformOutput::toHtml() from given frame parameters supplied by the Parser. | |
static | getInvalidTitleDescription (IContextSource $context, $namespace, $title) |
Get a message saying that an invalid title was encountered. | |
static | getRevDeleteLink (Authority $performer, RevisionRecord $revRecord, LinkTarget $title) |
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the settings on the revision. | |
static | getRevisionDeletedClass (RevisionRecord $revisionRecord) |
Returns css class of a deleted revision. | |
static | getRollbackEditCount (RevisionRecord $revRecord, $verify=true) |
This function will return the number of revisions which a rollback would revert and will verify that a revision can be reverted (that the user isn't the only contributor and the revision we might rollback to isn't deleted). | |
static | getUploadUrl ( $destFile, $query='') |
Get the URL to upload a certain file. | |
static | link ( $target, $html=null, $customAttribs=[], $query=[], $options=[]) |
This function returns an HTML link to the given target. | |
static | linkKnown ( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known']) |
Identical to link(), except $options defaults to 'known'. | |
static | makeBrokenImageLinkObj ( $title, $label='', $query='', $unused1='', $unused2='', $time=false, array $handlerParams=[], bool $currentExists=false) |
Make a "broken" link to an image. | |
static | makeExternalImage ( $url, $alt='') |
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage(). | |
static | makeExternalLink ( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null) |
Make an external link. | |
static | makeImageLink (Parser $parser, LinkTarget $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query='', $widthOption=null) |
Given parameters derived from [[Image:Foo|options...]], generate the HTML that that syntax inserts in the page. | |
static | makeMediaLinkFile (LinkTarget $title, $file, $html='') |
Create a direct link to a given uploaded file. | |
static | makeMediaLinkObj ( $title, $html='', $time=false) |
Create a direct link to a given uploaded file. | |
static | makeSelfLinkObj ( $nt, $html='', $query='', $trail='', $prefix='', $hash='') |
Make appropriate markup for a link to the current article. | |
static | makeThumbLink2 (LinkTarget $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query='', array $classes=[], ?Parser $parser=null) |
static | makeThumbLinkObj (LinkTarget $title, $file, $label='', $alt='', $align=null, $params=[], $framed=false, $manualthumb='') |
Make HTML for a thumbnail including image, border and caption. | |
static | normalizeSubpageLink ( $contextTitle, $target, &$text) |
static | processResponsiveImages ( $file, $thumb, $hp) |
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable. | |
static | renderUserToolLinksArray (array $items, bool $useParentheses) |
Generate standard tool links HTML from a link array returned by userToolLinkArray(). | |
static | revDeleteLink ( $query=[], $restricted=false, $delete=true) |
Creates a (show/hide) link for deleting revisions/log entries. | |
static | revDeleteLinkDisabled ( $delete=true) |
Creates a dead (show/hide) link for deleting revisions/log entries. | |
static | revUserLink (RevisionRecord $revRecord, $isPublic=false) |
Generate a user link if the current user is allowed to view it. | |
static | revUserTools (RevisionRecord $revRecord, $isPublic=false, $useParentheses=true) |
Generate a user tool link cluster if the current user is allowed to view it. | |
static | specialLink ( $name, $key='') |
Make a link to a special page given its name and, optionally, a message key from the link text. | |
static | splitTrail ( $trail) |
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array. | |
static | titleAttrib ( $name, $options=null, array $msgParams=[], $localizer=null) |
Given the id of an interface element, constructs the appropriate title attribute from the system messages. | |
static | tooltip ( $name, $options=null) |
Returns raw bits of HTML, use titleAttrib() | |
static | tooltipAndAccesskeyAttribs ( $name, array $msgParams=[], $options=null, $localizer=null) |
Returns the attributes for the tooltip and access key. | |
static | userLink ( $userId, $userName, $altUserName=false, $attributes=[]) |
Make user link (or user contributions for unregistered users) | |
static | userTalkLink ( $userId, $userText) |
static | userToolLinkArray ( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null) |
Generate standard user tool links (talk, contributions, block link, etc.) | |
static | userToolLinks ( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null, $useParentheses=true) |
Generate standard user tool links (talk, contributions, block link, etc.) | |
static | userToolLinksRedContribs ( $userId, $userText, $edits=null, $useParentheses=true) |
Alias for userToolLinks( $userId, $userText, true );. | |
Public Attributes | |
const | TOOL_LINKS_EMAIL = 2 |
const | TOOL_LINKS_NOBLOCK = 1 |
Flags for userToolLinks() | |
Static Public Attributes | |
static string false[] | $accesskeycache |
Some internal bits split of from Skin.php.
These functions are used for primarily page content: links, embedded images, table of contents. Links are also used in the skin.
Definition at line 63 of file Linker.php.
|
static |
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. |
MessageLocalizer | null | $localizer |
Definition at line 1985 of file Linker.php.
|
static |
int | $userId | |
string | $userText | User name in database. |
Definition at line 1390 of file Linker.php.
References wfDebug(), and wfMessage().
|
static |
Build a raw rollback link, useful for collections of "tool" links.
RevisionRecord | $revRecord | (Switched from the old Revision class to RevisionRecord since 1.35) |
IContextSource | null | $context | Context to use or null for the main context. |
int | false | null | $editCount | Number of edits that would be reverted |
Definition at line 1814 of file Linker.php.
References MediaWiki\Revision\RevisionRecord\getPageAsLinkTarget(), and MediaWiki\Revision\RevisionRecord\getUser().
|
static |
int | $userId | |
string | $userText | User name in database. |
Definition at line 1411 of file Linker.php.
References wfLogWarning(), and wfMessage().
|
static |
Helper function to expand local links.
Mostly used in action=render
string | $html |
Definition at line 1533 of file Linker.php.
References PROTO_RELATIVE.
|
static |
Returns HTML for the "hidden categories on this page" list.
array | $hiddencats | Array of hidden categories from WikiPage::getHiddenCategories or similar |
Definition at line 1885 of file Linker.php.
References wfMessage().
|
static |
int | $size |
Definition at line 1637 of file Linker.php.
References wfMessage().
|
static |
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.
This function will return the link only in case the revision can be reverted (not all revisions are by the same user, and the last revision by a different user is visible). Please note that due to performance limitations it might be assumed that a user isn't the only contributor of a page while (s)he is, which will lead to useless rollback links. Furthermore this won't work if $wgShowRollbackEditCount is disabled, so this can only function as an additional check.
If the option noBrackets is set the rollback link wont be enclosed in "[]".
RevisionRecord | $revRecord | (Switched from the old Revision class to RevisionRecord since 1.35) |
IContextSource | null | $context | Context to use or null for the main context. |
array | $options |
Definition at line 1691 of file Linker.php.
|
static |
Get the link parameters for MediaTransformOutput::toHtml() from given frame parameters supplied by the Parser.
array | $frameParams | The frame parameters |
string | $query | An optional query string to add to description page links |
Parser | null | $parser |
Definition at line 580 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Linker\Linker\makeImageLink(), and MediaWiki\Linker\Linker\makeThumbLink2().
|
static |
Get a message saying that an invalid title was encountered.
This should be called after a method like Title::makeTitleSafe() returned a value indicating that the title object is invalid.
IContextSource | $context | Context to use to get the messages |
int | $namespace | Namespace number |
string | $title | Text of the title, without the namespace part |
Definition at line 226 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), MessageLocalizer\msg(), and NS_MAIN.
|
static |
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the settings on the revision.
Will use forward-compatible revision ID in the Special:RevDelete link if possible, otherwise the timestamp-based ID which may break after undeletion.
Authority | $performer | |
RevisionRecord | $revRecord | (Switched from the old Revision class to RevisionRecord since 1.35) |
LinkTarget | $title |
Definition at line 2015 of file Linker.php.
References MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getTimestamp(), MediaWiki\Revision\RevisionRecord\getVisibility(), MediaWiki\Permissions\Authority\isAllowed(), MediaWiki\Revision\RevisionRecord\isDeleted(), and MediaWiki\Revision\RevisionRecord\userCan().
|
static |
Returns css class of a deleted revision.
RevisionRecord | $revisionRecord |
Definition at line 1465 of file Linker.php.
|
static |
This function will return the number of revisions which a rollback would revert and will verify that a revision can be reverted (that the user isn't the only contributor and the revision we might rollback to isn't deleted).
These checks can only function as an additional check as this function only checks against the last $wgShowRollbackEditCount edits.
Returns null if $wgShowRollbackEditCount is disabled or false if the user is the only contributor of the page.
RevisionRecord | $revRecord | (Switched from the old Revision class to RevisionRecord since 1.35) |
bool | $verify | Deprecated since 1.40, has no effect. |
Definition at line 1748 of file Linker.php.
References MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionRecord\getUser(), and wfDeprecated().
|
static |
Get the URL to upload a certain file.
LinkTarget | $destFile | LinkTarget object of the file to upload |
string | $query | Urlencoded query string to prepend |
Definition at line 1003 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\SpecialPage\SpecialPage\getTitleFor(), MediaWiki\MainConfigNames\UploadMissingFileUrl, MediaWiki\MainConfigNames\UploadNavigationUrl, and wfAppendQuery().
Referenced by MediaWiki\Linker\Linker\makeMediaLinkFile().
|
static |
This function returns an HTML link to the given target.
It serves a few purposes: 1) If $target is a LinkTarget, 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 LinkTarget (the page name of the target). link() replaces the old functions in the makeLink() family.
LinkTarget | $target | Can currently only be a LinkTarget, but this may change to support Images, literal URLs, etc. |
string | null | $html | 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 LinkTarget; or if the LinkTarget is just a fragment, the contents of the fragment. |
array | $customAttribs | A key => value array of extra HTML attributes, 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. |
array | $query | 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. |
string | array | $options | 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 icons. 'forcearticlepath': Use the article path always, even with a querystring. Has compatibility issues on some setups, so avoid wherever possible. 'http': Force a full URL with http:// as the scheme. 'https': Force a full URL with https:// as the scheme. |
Definition at line 111 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), and wfWarn().
Referenced by MediaWiki\Linker\Linker\linkKnown(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), MediaWiki\Linker\Linker\makeImageLink(), and MediaWiki\Linker\Linker\userLink().
|
static |
Identical to link(), except $options defaults to 'known'.
LinkTarget | $target | |
string | null | $html | |
array | $customAttribs | |
array | $query | |
string | array | $options |
Definition at line 169 of file Linker.php.
References MediaWiki\Linker\Linker\link().
Referenced by MediaWiki\Linker\Linker\specialLink().
|
static |
Make a "broken" link to an image.
LinkTarget | $title | |
string | $label | Link label (plain text) |
string | $query | Query string |
string | $unused1 | Unused parameter kept for b/c |
string | $unused2 | Unused parameter kept for b/c |
bool | $time | A file of a certain timestamp was requested |
array | $handlerParams |
bool | $currentExists |
Definition at line 930 of file Linker.php.
References MediaWiki\Html\element(), MediaWiki\MainConfigNames\EnableUploads, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Linker\Linker\link(), NS_FILE, MediaWiki\MainConfigNames\ParserEnableLegacyMediaDOM, MediaWiki\MainConfigNames\UploadMissingFileUrl, MediaWiki\MainConfigNames\UploadNavigationUrl, wfCgiToArray(), and wfWarn().
Referenced by MediaWiki\Linker\Linker\makeImageLink(), and MediaWiki\Linker\Linker\makeThumbLink2().
|
static |
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage().
string | $url | |
string | $alt |
Definition at line 269 of file Linker.php.
References $success, $url, MediaWiki\Html\element(), MediaWiki\MediaWikiServices\getInstance(), and wfDebug().
|
static |
Make an external link.
string | $url | URL to link to |
string | $text | Text of link |
bool | $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 |
LinkTarget | null | $title | LinkTarget object used for title specific link attributes |
Definition at line 1144 of file Linker.php.
References $url, $wgTitle, MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\SpecialPage\SpecialPage\getTitleFor().
|
static |
Given parameters derived from [[Image:Foo|options...]], generate the HTML that that syntax inserts in the page.
Parser | $parser | |
LinkTarget | $title | LinkTarget object of the file (not the currently viewed page) |
File | false | $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. title Used for tooltips if caption isn't visible. class HTML for image classes. Plain text. caption HTML for image caption. link-url URL to link to link-title LinkTarget object to link to link-target Value for the target attribute, only with link-url 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". targetlang (optional) Target language code, see Parser::getTargetLanguage() |
string | false | $time | Timestamp of the file, set as false for current |
string | $query | Query params for desc url |
int | null | $widthOption | Used by the parser to remember the user preference thumbnailsize |
Definition at line 327 of file Linker.php.
References $params, MediaWiki\Parser\Parser\getBadFileLookup(), MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\User\Options\UserOptionsLookup\getDefaultOption(), MediaWiki\Linker\Linker\getImageLinkMTOParams(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Parser\Parser\getTargetLanguage(), MediaWiki\Parser\Parser\getTitle(), MediaWiki\Linker\Linker\link(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), MediaWiki\Linker\Linker\makeThumbLink2(), MediaWiki\MainConfigNames\ParserEnableLegacyMediaDOM, MediaWiki\Linker\Linker\processResponsiveImages(), MediaWiki\MainConfigNames\SVGMaxSize, MediaWiki\MainConfigNames\ThumbLimits, MediaWiki\MainConfigNames\ThumbUpright, wfDebug(), and wfMessage().
|
static |
Create a direct link to a given uploaded file.
This will make a broken link if $file is false.
Definition at line 1053 of file Linker.php.
References $url, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Linker\LinkTarget\getText(), MediaWiki\Linker\Linker\getUploadUrl(), and wfDebug().
Referenced by MediaWiki\Linker\Linker\makeMediaLinkObj().
|
static |
Create a direct link to a given uploaded file.
LinkTarget | $title | |
string | $html | Pre-sanitized HTML |
string | false | $time | MW timestamp of file creation time |
Definition at line 1034 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Linker\Linker\makeMediaLinkFile().
|
static |
Make appropriate markup for a link to the current article.
This is since MediaWiki 1.29.0 rendered as an tag without an href and with a class showing the link text. The calling sequence is the same as for the other make*LinkObj static functions, but $query is not used.
LinkTarget | $nt | |
string | $html | |
string | $query | |
string | $trail | |
string | $prefix | |
string | $hash | hash fragment since 1.40. Should be properly escaped using Sanitizer::escapeIdForLink before being passed to this function. |
Definition at line 193 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Linker\Linker\splitTrail().
|
static |
LinkTarget | $title | |
File | false | $file | |
array | $frameParams | |
array | $handlerParams | |
bool | $time | If a file of a certain timestamp was requested |
string | $query | |
string[] | $classes |
Parser | null | $parser |
Definition at line 656 of file Linker.php.
References $params, $url, MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\Linker\Linker\getImageLinkMTOParams(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), NS_FILE, MediaWiki\MainConfigNames\ParserEnableLegacyMediaDOM, MediaWiki\Linker\Linker\processResponsiveImages(), wfAppendQuery(), and wfMessage().
Referenced by MediaWiki\Linker\Linker\makeImageLink(), and MediaWiki\Linker\Linker\makeThumbLinkObj().
|
static |
Make HTML for a thumbnail including image, border and caption.
LinkTarget | $title | |
File | false | $file | File object or false if it doesn't exist |
string | $label | |
string | $alt | |
string | null | $align | |
array | $params | |
bool | $framed | |
string | $manualthumb |
Definition at line 623 of file Linker.php.
References $params, and MediaWiki\Linker\Linker\makeThumbLink2().
|
static |
LinkTarget | null | $contextTitle | |
string | $target | |
string | &$text |
Definition at line 1554 of file Linker.php.
|
static |
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable.
File | $file | |
MediaTransformOutput | null | $thumb | |
array | $hp | Image parameters |
Definition at line 893 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\ResponsiveImages.
Referenced by MediaWiki\Linker\Linker\makeImageLink(), and MediaWiki\Linker\Linker\makeThumbLink2().
|
static |
Generate standard tool links HTML from a link array returned by userToolLinkArray().
array | $items | |
bool | $useParentheses | (optional, default true) Wrap comments in parentheses where needed |
Definition at line 1297 of file Linker.php.
|
static |
Creates a (show/hide) link for deleting revisions/log entries.
This method produces HTML that requires CSS styles in mediawiki.interface.helpers.styles.
array | $query | Query parameters to be passed to link() |
bool | $restricted | Set to true to use a "<strong>" instead of a "<span>" |
bool | $delete | Set to true to use (show/hide) rather than (show) |
Definition at line 2067 of file Linker.php.
References wfMessage().
|
static |
Creates a dead (show/hide) link for deleting revisions/log entries.
This method produces HTML that requires CSS styles in mediawiki.interface.helpers.styles.
bool | $delete | Set to true to use (show/hide) rather than (show) |
Definition at line 2091 of file Linker.php.
References wfMessage().
|
static |
Generate a user link if the current user is allowed to view it.
This method produces HTML that requires CSS styles in mediawiki.interface.helpers.styles.
RevisionRecord | $revRecord | (Switched from the old Revision class to RevisionRecord since 1.35) |
bool | $isPublic | Show only if all users can see it |
Definition at line 1437 of file Linker.php.
References MediaWiki\Revision\RevisionRecord\getUser(), MediaWiki\Revision\RevisionRecord\isDeleted(), and wfMessage().
|
static |
Generate a user tool link cluster if the current user is allowed to view it.
This method produces HTML that requires CSS styles in mediawiki.interface.helpers.styles.
RevisionRecord | $revRecord | (Switched from the old Revision class to RevisionRecord since 1.35) |
bool | $isPublic | Show only if all users can see it |
bool | $useParentheses | (optional) Wrap comments in parentheses where needed |
Definition at line 1485 of file Linker.php.
References MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getUser(), MediaWiki\Revision\RevisionRecord\isDeleted(), and wfMessage().
|
static |
Make a link to a special page given its name and, optionally, a message key from the link text.
Usage example: Linker::specialLink( 'Recentchanges' )
string | $name | Special page name, can optionally include …/subpages and …?parameters |
string | $key | Optional message key if different from $name |
Definition at line 1095 of file Linker.php.
References MediaWiki\SpecialPage\SpecialPage\getTitleFor(), MediaWiki\Linker\Linker\linkKnown(), wfCgiToArray(), and wfMessage().
|
static |
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array.
string | $trail |
Definition at line 1652 of file Linker.php.
Referenced by MediaWiki\Linker\Linker\makeSelfLinkObj().
|
static |
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. |
string | array | null | $options | Null, string or array with some of the following options:
|
array | $msgParams | Parameters to pass to the message |
MessageLocalizer | null | $localizer |
Definition at line 1930 of file Linker.php.
|
static |
Returns raw bits of HTML, use titleAttrib()
string | $name | |
array | null | $options |
Definition at line 2145 of file Linker.php.
|
static |
Returns the attributes for the tooltip and access key.
string | $name | |
array | $msgParams | Params for constructing the message |
string | array | null | $options | Options to be passed to titleAttrib. |
MessageLocalizer | null | $localizer |
Definition at line 2111 of file Linker.php.
|
static |
Make user link (or user contributions for unregistered users)
This method produces HTML that requires CSS styles in mediawiki.interface.helpers.styles.
int | $userId | User id in database. |
string | $userName | User name in database. |
string | false | $altUserName | Text to display instead of the user name (optional) |
string[] | $attributes | Extra HTML attributes. See Linker::link. |
Definition at line 1171 of file Linker.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\SpecialPage\SpecialPage\getTitleValueFor(), MediaWiki\Linker\Linker\link(), NS_USER, wfDebug(), and wfMessage().
|
static |
int | $userId | User id in database. |
string | $userText | User name in database. |
Definition at line 1368 of file Linker.php.
References NS_USER_TALK, wfDebug(), and wfMessage().
|
static |
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. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL). |
int | null | $edits | User edit count. If you enable $redContribsWhenNoEdits, you may pass a pre-computed edit count here, or 0 if the caller knows that the account has 0 edits. Otherwise, the value is unused and null may be passed. If $redContribsWhenNoEdits is enabled and null is passed, the edit count will be lazily fetched from UserEditTracker. |
Definition at line 1233 of file Linker.php.
|
static |
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. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL). |
int | null | $edits | User edit count (optional, for performance) |
bool | $useParentheses | (optional, default true) Wrap comments in parentheses where needed |
Definition at line 1333 of file Linker.php.
References wfDebug(), and wfMessage().
|
static |
Alias for userToolLinks( $userId, $userText, true );.
int | $userId | User identifier |
string | $userText | User name or IP address |
int | null | $edits | User edit count (optional, for performance) |
bool | $useParentheses | (optional) Wrap comments in parentheses where needed |
Definition at line 1356 of file Linker.php.
|
static |
Definition at line 1971 of file Linker.php.
const MediaWiki\Linker\Linker::TOOL_LINKS_EMAIL = 2 |
Definition at line 68 of file Linker.php.
const MediaWiki\Linker\Linker::TOOL_LINKS_NOBLOCK = 1 |
Flags for userToolLinks()
Definition at line 67 of file Linker.php.