From 49c2a5d5959448bc0400cefa47292bacef5267a2 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 30 Apr 2015 11:34:47 -0700 Subject: [PATCH] Move CITE_DEFAULT_GROUP constant to Cite::DEFAULT_GROUP Change-Id: I13c77f78563beb6e4ebf2a6d19327273ee2dbc07 --- Cite.php | 1 - Cite_body.php | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Cite.php b/Cite.php index 04289c19b..bacedf891 100644 --- a/Cite.php +++ b/Cite.php @@ -39,7 +39,6 @@ $wgMessagesDirs['Cite'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['Cite'] = __DIR__ . "/Cite.i18n.php"; $wgAutoloadClasses['Cite'] = __DIR__ . "/Cite_body.php"; -define( 'CITE_DEFAULT_GROUP', '' ); /** * The emergency shut-off switch. Override in local settings to disable * groups; or remove all references from this file to enable unconditionally diff --git a/Cite_body.php b/Cite_body.php index dc174164c..8afd716da 100644 --- a/Cite_body.php +++ b/Cite_body.php @@ -18,6 +18,12 @@ */ class Cite { + + /** + * @todo document + */ + const DEFAULT_GROUP = ''; + /**#@+ * @access private */ @@ -185,7 +191,7 @@ class Cite { * @param $default_group string * @return string */ - function guardedRef( $str, $argv, $parser, $default_group = CITE_DEFAULT_GROUP ) { + function guardedRef( $str, $argv, $parser, $default_group = self::DEFAULT_GROUP ) { $this->mParser = $parser; # The key here is the "name" attribute. @@ -562,7 +568,7 @@ class Cite { * @param $group string * @return string */ - function guardedReferences( $str, $argv, $parser, $group = CITE_DEFAULT_GROUP ) { + function guardedReferences( $str, $argv, $parser, $group = self::DEFAULT_GROUP ) { global $wgAllowCiteGroups; $this->mParser = $parser; @@ -925,7 +931,7 @@ class Cite { $this->refKey( $key, $count ), $this->referencesKey( $key . $subkey ), $this->getLinkLabel( $label, $group, - ( ( $group == CITE_DEFAULT_GROUP ) ? '' : "$group " ) . $wgContLang->formatNum( $label ) ) + ( ( $group == self::DEFAULT_GROUP ) ? '' : "$group " ) . $wgContLang->formatNum( $label ) ) )->inContentLanguage()->plain() ); } @@ -1067,7 +1073,7 @@ class Cite { if ( count( $refs ) == 0 ) { continue; } - if ( $group == CITE_DEFAULT_GROUP ) { + if ( $group == self::DEFAULT_GROUP ) { $text .= $this->referencesFormat( $group, '', '' ); } else { $text .= "\n
" .