BlueSpice MediaWiki REL1_27
|
Static Public Member Functions | |
static | getInterwikiLinkAttributes ($title, $unused=null, $class= 'external') |
static | getInternalLinkAttributes ($title, $unused=null, $class= '') |
static | getInternalLinkAttributesObj ($nt, $unused=null, $class= '', $title=false) |
static | getLinkColour ($t, $threshold) |
static | link ($target, $html=null, $customAttribs=[], $query=[], $options=[]) |
static | linkKnown ($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known', 'noclasses']) |
static | makeSelfLinkObj ($nt, $html= '', $query= '', $trail= '', $prefix= '') |
static | getInvalidTitleDescription (IContextSource $context, $namespace, $title) |
static | normaliseSpecialPage (LinkTarget $target) |
static | makeExternalImage ($url, $alt= '') |
static | makeImageLink (Parser $parser, Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="", $widthOption=null) |
static | makeThumbLinkObj (Title $title, $file, $label= '', $alt, $align= 'right', $params=[], $framed=false, $manualthumb="") |
static | makeThumbLink2 (Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="") |
static | processResponsiveImages ($file, $thumb, $hp) |
static | makeBrokenImageLinkObj ($title, $label= '', $query= '', $unused1= '', $unused2= '', $time=false) |
static | makeMediaLinkObj ($title, $html= '', $time=false) |
static | makeMediaLinkFile (Title $title, $file, $html= '') |
static | specialLink ($name, $key= '') |
static | makeExternalLink ($url, $text, $escape=true, $linktype= '', $attribs=[], $title=null) |
static | userLink ($userId, $userName, $altUserName=false) |
static | userToolLinks ($userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null) |
static | userToolLinksRedContribs ($userId, $userText, $edits=null) |
static | userTalkLink ($userId, $userText) |
static | blockLink ($userId, $userText) |
static | emailLink ($userId, $userText) |
static | revUserLink ($rev, $isPublic=false) |
static | revUserTools ($rev, $isPublic=false) |
static | formatComment ($comment, $title=null, $local=false, $wikiId=null) |
static | formatLinksInComment ($comment, $title=null, $local=false, $wikiId=null) |
static | makeCommentLink (Title $title, $text, $wikiId=null, $options=[]) |
static | normalizeSubpageLink ($contextTitle, $target, &$text) |
static | commentBlock ($comment, $title=null, $local=false, $wikiId=null) |
static | revComment (Revision $rev, $local=false, $isPublic=false) |
static | formatRevisionSize ($size) |
static | tocIndent () |
static | tocUnindent ($level) |
static | tocLine ($anchor, $tocline, $tocnumber, $level, $sectionIndex=false) |
static | tocLineEnd () |
static | tocList ($toc, $lang=false) |
static | generateTOC ($tree, $lang=false) |
static | makeHeadline ($level, $attribs, $anchor, $html, $link, $fallbackAnchor=false) |
static | splitTrail ($trail) |
static | generateRollback ($rev, IContextSource $context=null, $options=[ 'verify']) |
static | getRollbackEditCount ($rev, $verify) |
static | buildRollbackLink ($rev, IContextSource $context=null, $editCount=false) |
static | formatTemplates ($templates, $preview=false, $section=false, $more=null) |
static | formatHiddenCategories ($hiddencats) |
static | formatSize ($size) |
static | titleAttrib ($name, $options=null, array $msgParams=[]) |
static | accesskey ($name) |
static | getRevDeleteLink (User $user, Revision $rev, Title $title) |
static | revDeleteLink ($query=[], $restricted=false, $delete=true) |
static | revDeleteLinkDisabled ($delete=true) |
static | tooltipAndAccesskeyAttribs ($name, array $msgParams=[]) |
static | tooltip ($name, $options=null) |
Public Attributes | |
const | TOOL_LINKS_NOBLOCK = 1 |
const | TOOL_LINKS_EMAIL = 2 |
Static Public Attributes | |
static | $accesskeycache |
Static Protected Member Functions | |
static | getUploadUrl ($destFile, $query= '') |
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.
|
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. |
|
static |
int | $userId | Userid |
string | $userText | User name in database. |
|
static |
Build a raw rollback link, useful for collections of "tool" links
Revision | $rev | |
IContextSource | null | $context | Context to use or null for the main context. |
int | $editCount | Number of edits that would be reverted |
|
static |
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty string.
string | $comment | |
Title | null | $title | Title object (to generate link to section in autocomment) or null |
bool | $local | Whether section links should refer to local page |
string | null | $wikiId | Id (as used by WikiMap) of the wiki to generate links to. For use with external changes. |
|
static |
int | $userId | Userid |
string | $userText | User name in database. |
|
static |
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 summaries. It escapes any HTML in the summary, 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 | |
Title | null | $title | Title object (to generate link to the section in autocomment) or null |
bool | $local | Whether section links should refer to local page |
string | null | $wikiId | Id (as used by WikiMap) of the wiki to generate links to. For use with external changes. |
|
static |
Returns HTML for the "hidden categories on this page" list.
array | $hiddencats | Array of hidden categories from Article::getHiddenCategories or similar |
|
static |
Formats wiki links and media links in text; all other wiki formatting is ignored
string | $comment | Text to format links in. WARNING! Since the output of this function is html, $comment must be sanitized for use as html. You probably want to pass $comment through Sanitizer::escapeHtmlAllowEntities() before calling this function. |
Title | null | $title | An optional title object used to links to sections |
bool | $local | Whether section links should refer to local page |
string | null | $wikiId | Id of the wiki to link to (if not the local wiki), as used by WikiMap. |
|
static |
int | $size |
|
static |
Format a size in bytes for output, using an appropriate unit (B, KB, MB or GB) according to the magnitude in question
int | $size | Size to format |
|
static |
Returns HTML for the "templates used on this page" list.
Make an HTML list of templates, and then add a "More..." link at the bottom. If $more is null, do not add a "More..." link. If $more is a Title, make a link to that title and use it. If $more is a string, directly paste it in as the link (escaping needs to be done manually). Finally, if $more is a Message, call toString().
Title[] | $templates Array of templates | |
bool | $preview | Whether this is for a preview |
bool | $section | Whether this is for a section edit |
Title | Message | string | null | $more | An escaped link for "More..." of the templates |
|
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.
If the option verify is set this function will return the link only in case the revision can be reverted. 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 wont 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 []
Revision | $rev | |
IContextSource | $context | Context to use or null for the main context. |
array | $options |
|
static |
|
static |
Get the appropriate HTML attributes to add to the "a" element of an internal 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 |
|
static |
Get the appropriate HTML attributes to add to the "a" element of an internal link, given the Title object for the page we want to link to.
Title | $nt | |
string | $unused | Unused |
string | $class | The contents of the class attribute, default none |
string | bool | $title | Optional (unescaped) string to use in the title attribute; if false, default to the name of the page we're linking to |
|
static |
Get the appropriate HTML attributes to add to the "a" element of an interwiki 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'. |
|
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 |
|
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.
|
static |
This function will return the number of revisions which a rollback would revert and, if $verify is set it 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 $verify is set and the user is the only contributor of the page.
Revision | $rev | |
bool | $verify | Try to verify that this revision can really be rolled back |
|
staticprotected |
|
static |
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.
Title | $target | Can currently only be a Title, but this may change to support Images, literal URLs, etc. |
string | $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 Title; or if the Title 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 funny i- cons. '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. 'stubThreshold' => (int): Stub threshold to use when determining link classes. |
|
static |
|
static |
|
static |
Generates a link to the given Title
Title | $title | |
string | $text | |
string | null | $wikiId | Id of the wiki to link to (if not the local wiki), as used by WikiMap. |
string|string[] | $options See the $options parameter in Linker::link. |
|
static |
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage().
string | $url | |
string | $alt |
|
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 |
Title | null | $title | Title object used for title specific link attributes |
|
static |
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 | $html | HTML for the text of the header |
string | $link | HTML to add for the section edit link |
string | bool | $fallbackAnchor | A second, optional anchor to give for backward compatibility (false to omit) |
|
static |
Given parameters derived from [[Image:Foo|options...]], generate the HTML that that syntax inserts in the page.
Parser | $parser | |
Title | $title | Title object of the file (not the currently viewed page) |
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. class HTML for image classes. Plain text. caption HTML for image caption. link-url URL to link to link-title Title 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". |
string | bool | $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 |
|
static |
|
static |
Create a direct link to a given uploaded file.
Title | $title | |
string | $html | Pre-sanitized HTML |
string | $time | MW timestamp of file creation time |
|
static |
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 static functions, despite $query not being used.
Title | $nt | |
string | $html | [optional] |
string | $query | [optional] |
string | $trail | [optional] |
string | $prefix | [optional] |
|
static |
|
static |
|
static |
LinkTarget | $target |
|
static |
Title | $contextTitle | |
string | $target | |
string | $text |
|
static |
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable.
File | $file | |
MediaTransformOutput | $thumb | |
array | $hp | Image parameters |
|
static |
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 |
bool | $isPublic | Show only if all users can see it |
|
static |
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 "<strong>" instead of a "<span>" |
bool | $delete | Set to true to use (show/hide) rather than (show) |
|
static |
Creates a dead (show/hide) link for deleting revisions/log entries
bool | $delete | Set to true to use (show/hide) rather than (show) |
|
static |
Generate a user link if the current user is allowed to view it
Revision | $rev | |
bool | $isPublic | Show only if all users can see it |
|
static |
Generate a user tool link cluster if the current user is allowed to view it
Revision | $rev | |
bool | $isPublic | Show only if all users can see it |
|
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 | |
string | $key |
|
static |
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array
string | $trail |
|
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 | null | $options | Null or the string 'withaccess' to add an access- key hint |
array | $msgParams | Parameters to pass to the message |
|
static |
Add another level to the Table of Contents
|
static |
parameter level defines if we are on an indentation level
string | $anchor | |
string | $tocline | |
string | $tocnumber | |
string | $level | |
string | bool | $sectionIndex |
|
static |
End a Table Of Contents line. tocUnindent() will be used instead if we're ending a line below the new level.
|
static |
|
static |
Finish one or more sublevels on the Table of Contents
int | $level |
|
static |
Returns raw bits of HTML, use titleAttrib()
string | $name | |
array | null | $options |
|
static |
Returns the attributes for the tooltip and access key.
string | $name | |
array | $msgParams | Params for constructing the message |
|
static |
Make user link (or user contributions for unregistered users)
int | $userId | User id in database. |
string | $userName | User name in database. |
string | $altUserName | Text to display instead of the user name (optional) |
|
static |
|
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 | $edits | User edit count (optional, for performance) |
|
static |
const Linker::TOOL_LINKS_NOBLOCK = 1 |
Flags for userToolLinks()