Merge "Added common metadata caching to the djvu handler"
[lhc/web/wiklou.git] / includes / changes / ChangesList.php
index 536c6ab..932006d 100644 (file)
@@ -67,7 +67,7 @@ class ChangesList extends ContextSource {
                $user = $context->getUser();
                $sk = $context->getSkin();
                $list = null;
-               if ( wfRunHooks( 'FetchChangesList', array( $user, &$sk, &$list ) ) ) {
+               if ( Hooks::run( 'FetchChangesList', array( $user, &$sk, &$list ) ) ) {
                        $new = $context->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
 
                        return $new ? new EnhancedChangesList( $context ) : new OldChangesList( $context );
@@ -114,9 +114,8 @@ class ChangesList extends ContextSource {
         * @return string
         */
        public function recentChangesFlags( $flags, $nothing = ' ' ) {
-               global $wgRecentChangesFlags;
                $f = '';
-               foreach ( array_keys( $wgRecentChangesFlags ) as $flag ) {
+               foreach ( array_keys( $this->getConfig()->get( 'RecentChangesFlags' ) ) as $flag ) {
                        $f .= isset( $flags[$flag] ) && $flags[$flag]
                                ? self::flag( $flag )
                                : $nothing;
@@ -181,7 +180,7 @@ class ChangesList extends ContextSource {
         * @param ResultWrapper|array $rows
         */
        public function initChangesListRows( $rows ) {
-               wfRunHooks( 'ChangesListInitRows', array( $this, $rows ) );
+               Hooks::run( 'ChangesListInitRows', array( $this, $rows ) );
        }
 
        /**
@@ -192,8 +191,6 @@ class ChangesList extends ContextSource {
         * @return string
         */
        public static function showCharacterDifference( $old, $new, IContextSource $context = null ) {
-               global $wgRCChangedSizeThreshold, $wgMiserMode;
-
                if ( !$context ) {
                        $context = RequestContext::getMain();
                }
@@ -203,10 +200,11 @@ class ChangesList extends ContextSource {
                $szdiff = $new - $old;
 
                $lang = $context->getLanguage();
+               $config = $context->getConfig();
                $code = $lang->getCode();
                static $fastCharDiff = array();
                if ( !isset( $fastCharDiff[$code] ) ) {
-                       $fastCharDiff[$code] = $wgMiserMode || $context->msg( 'rc-change-size' )->plain() === '$1';
+                       $fastCharDiff[$code] = $config->get( 'MiserMode' ) || $context->msg( 'rc-change-size' )->plain() === '$1';
                }
 
                $formattedSize = $lang->formatNum( $szdiff );
@@ -215,7 +213,7 @@ class ChangesList extends ContextSource {
                        $formattedSize = $context->msg( 'rc-change-size', $formattedSize )->text();
                }
 
-               if ( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
+               if ( abs( $szdiff ) > abs( $config->get( 'RCChangedSizeThreshold' ) ) ) {
                        $tag = 'strong';
                } else {
                        $tag = 'span';
@@ -366,7 +364,7 @@ class ChangesList extends ContextSource {
                # RTL/LTR marker
                $articlelink .= $this->getLanguage()->getDirMark();
 
-               wfRunHooks( 'ChangesListInsertArticleLink',
+               Hooks::run( 'ChangesListInsertArticleLink',
                        array( &$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched ) );
 
                $s .= " $articlelink";