return htmlspecialchars( $target->getPrefixedText() );
}
- /**
- * Generate either a normal exists-style link or a stub link, depending
- * on the given page size.
- *
- * @param $size Integer
- * @param $nt Title object.
- * @param $text String
- * @param $query String
- * @param $trail String
- * @param $prefix String
- * @return string HTML of link
- * @deprecated since 1.17
- */
- static function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
- global $wgUser;
- wfDeprecated( __METHOD__, '1.17' );
-
- $threshold = $wgUser->getStubThreshold();
- $colour = ( $size < $threshold ) ? 'stub' : '';
- // @todo FIXME: Replace deprecated makeColouredLinkObj by link()
- return self::makeColouredLinkObj( $nt, $colour, $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 static functions,
/* Deprecated methods */
- /**
- * @deprecated since 1.16 Use link()
- *
- * 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.
- *
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param 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.
- * @return string
- */
- static function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
- wfDeprecated( __METHOD__, '1.16' );
-
- $nt = Title::newFromText( $title );
- if ( $nt instanceof Title ) {
- return self::makeBrokenLinkObj( $nt, $text, $query, $trail );
- } else {
- wfDebug( 'Invalid title passed to self::makeBrokenLink(): "' . $title . "\"\n" );
- return $text == '' ? $title : $text;
- }
- }
-
/**
* @deprecated since 1.16 Use link(); warnings since 1.21
*
return $ret;
}
- /**
- * @deprecated since 1.16 Use link()
- *
- * Make a red link to the edit page of a given title.
- *
- * @param $title Title object of the target page
- * @param $text String: Link text
- * @param string $query Optional query part
- * @param 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.
- * @param string $prefix Optional prefix
- * @return string
- */
- static function makeBrokenLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' ) {
- wfDeprecated( __METHOD__, '1.16' );
-
- wfProfileIn( __METHOD__ );
-
- list( $inside, $trail ) = self::splitTrail( $trail );
- if ( $text === '' ) {
- $text = self::linkText( $title );
- }
-
- $ret = self::link( $title, "$prefix$text$inside", array(),
- wfCgiToArray( $query ), 'broken' ) . $trail;
-
- wfProfileOut( __METHOD__ );
- return $ret;
- }
-
- /**
- * @deprecated since 1.16 Use link()
- *
- * Make a coloured link.
- *
- * @param $nt Title object of the target page
- * @param $colour Integer: colour of the link
- * @param $text String: link text
- * @param $query String: optional query part
- * @param $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.
- * @param string $prefix Optional prefix
- * @return string
- */
- static function makeColouredLinkObj( $nt, $colour, $text = '', $query = '', $trail = '', $prefix = '' ) {
- wfDeprecated( __METHOD__, '1.16' );
-
- if ( $colour != '' ) {
- $style = self::getInternalLinkAttributesObj( $nt, $text, $colour );
- } else {
- $style = '';
- }
- return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix, '', $style );
- }
-
/**
* Returns the attributes for the tooltip and access key.
* @return array