summaryrefslogtreecommitdiff
path: root/includes/parser/CoreLinkFunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/parser/CoreLinkFunctions.php')
-rw-r--r--includes/parser/CoreLinkFunctions.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/includes/parser/CoreLinkFunctions.php b/includes/parser/CoreLinkFunctions.php
index 913ec22b..8de13278 100644
--- a/includes/parser/CoreLinkFunctions.php
+++ b/includes/parser/CoreLinkFunctions.php
@@ -10,11 +10,25 @@
* @ingroup Parser
*/
class CoreLinkFunctions {
+ /**
+ * @param $parser Parser_LinkHooks
+ * @return bool
+ */
static function register( $parser ) {
$parser->setLinkHook( NS_CATEGORY, array( __CLASS__, 'categoryLinkHook' ) );
return true;
}
+ /**
+ * @param $parser Parser
+ * @param $holders LinkHolderArray
+ * @param $markers LinkMarkerReplacer
+ * @param Title $title
+ * @param $titleText
+ * @param null $displayText
+ * @param bool $leadingColon
+ * @return bool
+ */
static function defaultLinkHook( $parser, $holders, $markers,
Title $title, $titleText, &$displayText = null, &$leadingColon = false ) {
if( isset($displayText) && $markers->findMarker( $displayText ) ) {
@@ -25,9 +39,19 @@ class CoreLinkFunctions {
# Return false so that this link is reverted back to WikiText
return false;
}
- return $holders->makeHolder( $title, isset($displayText) ? $displayText : $titleText, '', '', '' );
+ return $holders->makeHolder( $title, isset($displayText) ? $displayText : $titleText, array(), '', '' );
}
-
+
+ /**
+ * @param $parser Parser
+ * @param $holders LinkHolderArray
+ * @param $markers LinkMarkerReplacer
+ * @param Title $title
+ * @param $titleText
+ * @param null $sortText
+ * @param bool $leadingColon
+ * @return bool|string
+ */
static function categoryLinkHook( $parser, $holders, $markers,
Title $title, $titleText, &$sortText = null, &$leadingColon = false ) {
global $wgContLang;
@@ -48,5 +72,5 @@ class CoreLinkFunctions {
$parser->mOutput->addCategory( $title->getDBkey(), $sortText );
return '';
}
-
+
}