diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-28 09:50:25 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-28 09:50:25 -0500 |
commit | 5744df39e15f85c6cc8a9faf8924d77e76d2b216 (patch) | |
tree | a8c8dd40a94d1fa0d5377566aa5548ae55a163da /includes/specials/SpecialRecentchanges.php | |
parent | 4bb2aeca1d198391ca856aa16c40b8559c68daec (diff) | |
parent | 224b22a051051f6c2e494c3a2fb4adb42898e2d1 (diff) |
Merge branch 'archwiki'
Conflicts:
extensions/FluxBBAuthPlugin.php
extensions/SyntaxHighlight_GeSHi/README
extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php
extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
extensions/SyntaxHighlight_GeSHi/geshi/docs/CHANGES
extensions/SyntaxHighlight_GeSHi/geshi/docs/THANKS
extensions/SyntaxHighlight_GeSHi/geshi/docs/TODO
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/AbstractClass.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/AbstractClass_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/AbstractMethod.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/AbstractPrivateClass.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/AbstractPrivateClass_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/AbstractPrivateMethod.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Class.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Class_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Constant.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Constructor.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Destructor.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Function.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Global.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/I.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Index.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Interface.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Interface_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/L.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Lminus.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Lplus.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Method.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Page.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Page_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/PrivateClass.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/PrivateClass_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/PrivateMethod.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/PrivateVariable.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/StaticMethod.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/StaticVariable.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/T.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Tminus.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Tplus.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/Variable.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/blank.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/class_folder.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/file.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/folder.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/function_folder.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/next_button.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/next_button_disabled.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/package.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/package_folder.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/previous_button.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/previous_button_disabled.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/private_class_logo.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/tutorial.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/tutorial_folder.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/api/media/images/up_button.png
extensions/SyntaxHighlight_GeSHi/geshi/docs/geshi-doc.html
extensions/SyntaxHighlight_GeSHi/geshi/docs/geshi-doc.txt
extensions/SyntaxHighlight_GeSHi/geshi/geshi.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/4cs.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/6502acme.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/6502kickass.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/6502tasm.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/68000devpac.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/abap.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/actionscript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/actionscript3.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/ada.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/algol68.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/apache.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/applescript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/apt_sources.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/asm.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/asp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/autoconf.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/autohotkey.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/autoit.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/avisynth.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/awk.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/bascomavr.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/bash.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/basic4gl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/bf.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/bibtex.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/blitzbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/bnf.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/boo.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/c.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/c_loadrunner.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/c_mac.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/caddcl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cadlisp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cfdg.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cfm.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/chaiscript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cil.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/clojure.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cmake.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cobol.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/coffeescript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cpp-qt.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cpp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/csharp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/css.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/cuesheet.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/d.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/dcs.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/delphi.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/diff.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/div.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/dos.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/dot.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/e.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/ecmascript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/eiffel.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/email.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/epc.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/erlang.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/euphoria.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/f1.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/falcon.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/fo.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/fortran.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/freebasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/fsharp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/gambas.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/gdb.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/genero.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/genie.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/gettext.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/glsl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/gml.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/gnuplot.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/go.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/groovy.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/gwbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/hicest.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/hq9plus.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/html4strict.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/html5.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/icon.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/idl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/ini.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/inno.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/intercal.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/io.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/j.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/java.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/java5.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/javascript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/jquery.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/kixtart.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/klonec.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/klonecpp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/latex.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lb.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lisp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/llvm.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/locobasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/logtalk.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lolcode.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lotusformulas.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lotusscript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lscript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lsl2.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/lua.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/m68k.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/magiksf.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/make.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/mapbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/matlab.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/mirc.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/mmix.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/modula2.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/modula3.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/mpasm.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/mxml.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/mysql.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/newlisp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/nsis.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/oberon2.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/objc.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/objeck.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/ocaml-brief.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/ocaml.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/oobas.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/oracle11.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/oracle8.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/oxygene.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/oz.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pascal.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pcre.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/per.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/perl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/perl6.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pf.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/php-brief.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/php.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pic16.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pike.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pixelbender.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pli.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/plsql.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/postgresql.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/povray.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/powerbuilder.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/powershell.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/proftpd.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/progress.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/prolog.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/properties.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/providex.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/purebasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/pycon.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/python.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/q.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/qbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/rails.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/rebol.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/reg.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/robots.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/rpmspec.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/rsplus.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/ruby.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/sas.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/scala.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/scheme.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/scilab.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/sdlbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/smalltalk.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/smarty.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/sql.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/systemverilog.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/tcl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/teraterm.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/text.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/thinbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/tsql.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/typoscript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/unicon.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/uscript.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/vala.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/vb.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/vbnet.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/verilog.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/vhdl.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/vim.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/visualfoxpro.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/visualprolog.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/whitespace.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/whois.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/winbatch.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/xbasic.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/xml.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/xorg_conf.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/xpp.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/yaml.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/z80.php
extensions/SyntaxHighlight_GeSHi/geshi/geshi/zxbasic.php
Diffstat (limited to 'includes/specials/SpecialRecentchanges.php')
-rw-r--r-- | includes/specials/SpecialRecentchanges.php | 470 |
1 files changed, 254 insertions, 216 deletions
diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 2bd8b0a9..a42a2171 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -41,17 +41,18 @@ class SpecialRecentChanges extends IncludableSpecialPage { */ public function getDefaultOptions() { $opts = new FormOptions(); + $user = $this->getUser(); - $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) ); - $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) ); + $opts->add( 'days', $user->getIntOption( 'rcdays' ) ); + $opts->add( 'limit', $user->getIntOption( 'rclimit' ) ); $opts->add( 'from', '' ); - $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) ); - $opts->add( 'hidebots', true ); - $opts->add( 'hideanons', false ); - $opts->add( 'hideliu', false ); - $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'hidepatrolled' ) ); - $opts->add( 'hidemyself', false ); + $opts->add( 'hideminor', $user->getBoolOption( 'hideminor' ) ); + $opts->add( 'hidebots', true ); + $opts->add( 'hideanons', false ); + $opts->add( 'hideliu', false ); + $opts->add( 'hidepatrolled', $user->getBoolOption( 'hidepatrolled' ) ); + $opts->add( 'hidemyself', false ); $opts->add( 'namespace', '', FormOptions::INTNULL ); $opts->add( 'invert', false ); @@ -60,44 +61,47 @@ class SpecialRecentChanges extends IncludableSpecialPage { $opts->add( 'categories', '' ); $opts->add( 'categories_any', false ); $opts->add( 'tagfilter', '' ); + return $opts; } /** * Create a FormOptions object with options as specified by the user * - * @param $parameters array + * @param array $parameters * * @return FormOptions */ public function setup( $parameters ) { $opts = $this->getDefaultOptions(); - foreach( $this->getCustomFilters() as $key => $params ) { + foreach ( $this->getCustomFilters() as $key => $params ) { $opts->add( $key, $params['default'] ); } $opts->fetchValuesFromRequest( $this->getRequest() ); // Give precedence to subpage syntax - if( $parameters !== null ) { + if ( $parameters !== null ) { $this->parseParameters( $parameters, $opts ); } $opts->validateIntBounds( 'limit', 0, 5000 ); + return $opts; } /** * Get custom show/hide filters * - * @return Array Map of filter URL param names to properties (msg/default) + * @return array Map of filter URL param names to properties (msg/default) */ protected function getCustomFilters() { if ( $this->customFilters === null ) { $this->customFilters = array(); wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ) ); } + return $this->customFilters; } @@ -109,9 +113,9 @@ class SpecialRecentChanges extends IncludableSpecialPage { public function feedSetup() { global $wgFeedLimit; $opts = $this->getDefaultOptions(); - # Feed is cached on limit,hideminor,namespace; other params would randomly not work - $opts->fetchValuesFromRequest( $this->getRequest(), array( 'limit', 'hideminor', 'namespace' ) ); + $opts->fetchValuesFromRequest( $this->getRequest() ); $opts->validateIntBounds( 'limit', 0, $wgFeedLimit ); + return $opts; } @@ -127,14 +131,14 @@ class SpecialRecentChanges extends IncludableSpecialPage { } $this->rcOptions = $isFeed ? $this->feedSetup() : $this->setup( $this->rcSubpage ); } + return $this->rcOptions; } - /** * Main execution point * - * @param $subpage String + * @param string $subpage */ public function execute( $subpage ) { $this->rcSubpage = $subpage; @@ -144,36 +148,38 @@ class SpecialRecentChanges extends IncludableSpecialPage { $this->getOutput()->setSquidMaxage( 10 ); # Check if the client has a cached version $lastmod = $this->checkLastModified( $feedFormat ); - if( $lastmod === false ) { + if ( $lastmod === false ) { return; } $opts = $this->getOptions(); $this->setHeaders(); $this->outputHeader(); - $this->addRecentChangesJS(); + $this->addModules(); // Fetch results, prepare a batch link existence check query $conds = $this->buildMainQueryConds( $opts ); $rows = $this->doMainQuery( $conds, $opts ); - if( $rows === false ){ - if( !$this->including() ) { + if ( $rows === false ) { + if ( !$this->including() ) { $this->doHeader( $opts ); } + return; } - if( !$feedFormat ) { + if ( !$feedFormat ) { $batch = new LinkBatch; - foreach( $rows as $row ) { + foreach ( $rows as $row ) { $batch->add( NS_USER, $row->rc_user_text ); $batch->add( NS_USER_TALK, $row->rc_user_text ); $batch->add( $row->rc_namespace, $row->rc_title ); } $batch->execute(); } - if( $feedFormat ) { + if ( $feedFormat ) { list( $changesFeed, $formatter ) = $this->getFeedObject( $feedFormat ); + /** @var ChangesFeed $changesFeed */ $changesFeed->execute( $formatter, $rows, $lastmod, $opts ); } else { $this->webOutput( $rows, $opts ); @@ -185,15 +191,17 @@ class SpecialRecentChanges extends IncludableSpecialPage { /** * Return an array with a ChangesFeed object and ChannelFeed object * - * @return Array + * @param string $feedFormat Feed's format (either 'rss' or 'atom') + * @return array */ - public function getFeedObject( $feedFormat ){ + public function getFeedObject( $feedFormat ) { $changesFeed = new ChangesFeed( $feedFormat, 'rcfeed' ); $formatter = $changesFeed->getFeedObject( $this->msg( 'recentchanges' )->inContentLanguage()->text(), $this->msg( 'recentchanges-feed-description' )->inContentLanguage()->text(), $this->getTitle()->getFullURL() ); + return array( $changesFeed, $formatter ); } @@ -201,49 +209,49 @@ class SpecialRecentChanges extends IncludableSpecialPage { * Process $par and put options found if $opts * Mainly used when including the page * - * @param $par String - * @param $opts FormOptions + * @param string $par + * @param FormOptions $opts */ public function parseParameters( $par, FormOptions $opts ) { $bits = preg_split( '/\s*,\s*/', trim( $par ) ); - foreach( $bits as $bit ) { - if( 'hidebots' === $bit ) { + foreach ( $bits as $bit ) { + if ( 'hidebots' === $bit ) { $opts['hidebots'] = true; } - if( 'bots' === $bit ) { + if ( 'bots' === $bit ) { $opts['hidebots'] = false; } - if( 'hideminor' === $bit ) { + if ( 'hideminor' === $bit ) { $opts['hideminor'] = true; } - if( 'minor' === $bit ) { + if ( 'minor' === $bit ) { $opts['hideminor'] = false; } - if( 'hideliu' === $bit ) { + if ( 'hideliu' === $bit ) { $opts['hideliu'] = true; } - if( 'hidepatrolled' === $bit ) { + if ( 'hidepatrolled' === $bit ) { $opts['hidepatrolled'] = true; } - if( 'hideanons' === $bit ) { + if ( 'hideanons' === $bit ) { $opts['hideanons'] = true; } - if( 'hidemyself' === $bit ) { + if ( 'hidemyself' === $bit ) { $opts['hidemyself'] = true; } - if( is_numeric( $bit ) ) { - $opts['limit'] = $bit; + if ( is_numeric( $bit ) ) { + $opts['limit'] = $bit; } $m = array(); - if( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) { + if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) { $opts['limit'] = $m[1]; } - if( preg_match( '/^days=(\d+)$/', $bit, $m ) ) { + if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) { $opts['days'] = $m[1]; } - if( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) { + if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) { $opts['namespace'] = $m[1]; } } @@ -254,25 +262,26 @@ class SpecialRecentChanges extends IncludableSpecialPage { * Don't use this if we are using the patrol feature, patrol changes don't * update the timestamp * - * @param $feedFormat String - * @return String or false + * @param string $feedFormat + * @return string|bool */ public function checkLastModified( $feedFormat ) { $dbr = wfGetDB( DB_SLAVE ); $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ ); - if( $feedFormat || !$this->getUser()->useRCPatrol() ) { - if( $lastmod && $this->getOutput()->checkLastModified( $lastmod ) ) { + if ( $feedFormat || !$this->getUser()->useRCPatrol() ) { + if ( $lastmod && $this->getOutput()->checkLastModified( $lastmod ) ) { # Client cache fresh and headers sent, nothing more to do. return false; } } + return $lastmod; } /** * Return an array of conditions depending of options set in $opts * - * @param $opts FormOptions + * @param FormOptions $opts * @return array */ public function buildMainQueryConds( FormOptions $opts ) { @@ -282,9 +291,9 @@ class SpecialRecentChanges extends IncludableSpecialPage { # It makes no sense to hide both anons and logged-in users # Where this occurs, force anons to be shown $forcebot = false; - if( $opts['hideanons'] && $opts['hideliu'] ){ + if ( $opts['hideanons'] && $opts['hideliu'] ) { # Check if the user wants to show bots only - if( $opts['hidebots'] ){ + if ( $opts['hidebots'] ) { $opts['hideanons'] = false; } else { $forcebot = true; @@ -294,12 +303,12 @@ class SpecialRecentChanges extends IncludableSpecialPage { // Calculate cutoff $cutoff_unixtime = time() - ( $opts['days'] * 86400 ); - $cutoff_unixtime = $cutoff_unixtime - ($cutoff_unixtime % 86400); + $cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime % 86400 ); $cutoff = $dbr->timestamp( $cutoff_unixtime ); - $fromValid = preg_match('/^[0-9]{14}$/', $opts['from']); - if( $fromValid && $opts['from'] > wfTimestamp(TS_MW,$cutoff) ) { - $cutoff = $dbr->timestamp($opts['from']); + $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] ); + if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) { + $cutoff = $dbr->timestamp( $opts['from'] ); } else { $opts->reset( 'from' ); } @@ -310,27 +319,27 @@ class SpecialRecentChanges extends IncludableSpecialPage { $hideLoggedInUsers = $opts['hideliu'] && !$forcebot; $hideAnonymousUsers = $opts['hideanons'] && !$forcebot; - if( $opts['hideminor'] ) { + if ( $opts['hideminor'] ) { $conds['rc_minor'] = 0; } - if( $opts['hidebots'] ) { + if ( $opts['hidebots'] ) { $conds['rc_bot'] = 0; } - if( $hidePatrol ) { + if ( $hidePatrol ) { $conds['rc_patrolled'] = 0; } - if( $forcebot ) { + if ( $forcebot ) { $conds['rc_bot'] = 1; } - if( $hideLoggedInUsers ) { + if ( $hideLoggedInUsers ) { $conds[] = 'rc_user = 0'; } - if( $hideAnonymousUsers ) { + if ( $hideAnonymousUsers ) { $conds[] = 'rc_user != 0'; } - if( $opts['hidemyself'] ) { - if( $this->getUser()->getId() ) { + if ( $opts['hidemyself'] ) { + if ( $this->getUser()->getId() ) { $conds[] = 'rc_user != ' . $dbr->addQuotes( $this->getUser()->getId() ); } else { $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $this->getUser()->getName() ); @@ -338,13 +347,13 @@ class SpecialRecentChanges extends IncludableSpecialPage { } # Namespace filtering - if( $opts['namespace'] !== '' ) { + if ( $opts['namespace'] !== '' ) { $selectedNS = $dbr->addQuotes( $opts['namespace'] ); - $operator = $opts['invert'] ? '!=' : '='; - $boolean = $opts['invert'] ? 'AND' : 'OR'; + $operator = $opts['invert'] ? '!=' : '='; + $boolean = $opts['invert'] ? 'AND' : 'OR'; # namespace association (bug 2429) - if( !$opts['associated'] ) { + if ( !$opts['associated'] ) { $condition = "rc_namespace $operator $selectedNS"; } else { # Also add the associated namespace @@ -352,21 +361,22 @@ class SpecialRecentChanges extends IncludableSpecialPage { MWNamespace::getAssociated( $opts['namespace'] ) ); $condition = "(rc_namespace $operator $selectedNS " - . $boolean - . " rc_namespace $operator $associatedNS)"; + . $boolean + . " rc_namespace $operator $associatedNS)"; } $conds[] = $condition; } + return $conds; } /** * Process the query * - * @param $conds Array - * @param $opts FormOptions - * @return bool|ResultWrapper result or false (for Recentchangeslinked only) + * @param array $conds + * @param FormOptions $opts + * @return bool|ResultWrapper Result or false (for Recentchangeslinked only) */ public function doMainQuery( $conds, $opts ) { $tables = array( 'recentchanges' ); @@ -382,19 +392,22 @@ class SpecialRecentChanges extends IncludableSpecialPage { $invert = $opts['invert']; $associated = $opts['associated']; - $fields = array( $dbr->tableName( 'recentchanges' ) . '.*' ); // all rc columns + $fields = RecentChange::selectFields(); // JOIN on watchlist for users - if ( $uid ) { + if ( $uid && $this->getUser()->isAllowed( 'viewmywatchlist' ) ) { $tables[] = 'watchlist'; $fields[] = 'wl_user'; $fields[] = 'wl_notificationtimestamp'; - $join_conds['watchlist'] = array('LEFT JOIN', - "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace"); + $join_conds['watchlist'] = array( 'LEFT JOIN', array( + 'wl_user' => $uid, + 'wl_title=rc_title', + 'wl_namespace=rc_namespace' + ) ); } if ( $this->getUser()->isAllowed( 'rollback' ) ) { $tables[] = 'page'; $fields[] = 'page_latest'; - $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); + $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' ); } // Tag stuff. ChangeTags::modifyDisplayQuery( @@ -407,86 +420,40 @@ class SpecialRecentChanges extends IncludableSpecialPage { ); if ( !wfRunHooks( 'SpecialRecentChangesQuery', - array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) ) ) - { + array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) ) + ) { return false; } - // Don't use the new_namespace_time timestamp index if: - // (a) "All namespaces" selected - // (b) We want pages in more than one namespace (inverted/associated) - // (c) There is a tag to filter on (use tag index instead) - // (d) UNION + sort/limit is not an option for the DBMS - if( $namespace === '' - || ( $invert || $associated ) - || $opts['tagfilter'] != '' - || !$dbr->unionSupportsOrderAndLimit() ) - { - $res = $dbr->select( $tables, $fields, $conds, __METHOD__, - array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) + - $query_options, - $join_conds ); - // We have a new_namespace_time index! UNION over new=(0,1) and sort result set! - } else { - // New pages - $sqlNew = $dbr->selectSQLText( - $tables, - $fields, - array( 'rc_new' => 1 ) + $conds, - __METHOD__, - array( - 'ORDER BY' => 'rc_timestamp DESC', - 'LIMIT' => $limit, - 'USE INDEX' => array( 'recentchanges' => 'new_name_timestamp' ) - ), - $join_conds - ); - // Old pages - $sqlOld = $dbr->selectSQLText( - $tables, - $fields, - array( 'rc_new' => 0 ) + $conds, - __METHOD__, - array( - 'ORDER BY' => 'rc_timestamp DESC', - 'LIMIT' => $limit, - 'USE INDEX' => array( 'recentchanges' => 'new_name_timestamp' ) - ), - $join_conds - ); - # Join the two fast queries, and sort the result set - $sql = $dbr->unionQueries( array( $sqlNew, $sqlOld ), false ) . - ' ORDER BY rc_timestamp DESC'; - $sql = $dbr->limitResult( $sql, $limit, false ); - $res = $dbr->query( $sql, __METHOD__ ); - } - - return $res; + // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough + // knowledge to use an index merge if it wants (it may use some other index though). + return $dbr->select( + $tables, + $fields, + $conds + array( 'rc_new' => array( 0, 1 ) ), + __METHOD__, + array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) + $query_options, + $join_conds + ); } /** * Send output to the OutputPage object, only called if not used feeds * - * @param $rows Array of database rows - * @param $opts FormOptions + * @param array $rows Database rows + * @param FormOptions $opts */ public function webOutput( $rows, $opts ) { global $wgRCShowWatchingUsers, $wgShowUpdatedMarker, $wgAllowCategorizedRecentChanges; - $limit = $opts['limit']; - - if( !$this->including() ) { - // Output options box - $this->doHeader( $opts ); - } - - // And now for the content - $this->getOutput()->setFeedAppendQuery( $this->getFeedQuery() ); + // Build the final data - if( $wgAllowCategorizedRecentChanges ) { + if ( $wgAllowCategorizedRecentChanges ) { $this->filterByCategories( $rows, $opts ); } + $limit = $opts['limit']; + $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' ); $watcherCache = array(); @@ -495,23 +462,23 @@ class SpecialRecentChanges extends IncludableSpecialPage { $counter = 1; $list = ChangesList::newFromContext( $this->getContext() ); - $s = $list->beginRecentChangesList(); - foreach( $rows as $obj ) { - if( $limit == 0 ) { + $rclistOutput = $list->beginRecentChangesList(); + foreach ( $rows as $obj ) { + if ( $limit == 0 ) { break; } $rc = RecentChange::newFromRow( $obj ); $rc->counter = $counter++; # Check if the page has been updated since the last visit - if( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) { + if ( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) { $rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp ); } else { $rc->notificationtimestamp = false; // Default } # Check the number of users watching the page $rc->numberofWatchingusers = 0; // Default - if( $showWatcherCount && $obj->rc_namespace >= 0 ) { - if( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) { + if ( $showWatcherCount && $obj->rc_namespace >= 0 ) { + if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) { $watcherCache[$obj->rc_namespace][$obj->rc_title] = $dbr->selectField( 'watchlist', @@ -525,27 +492,66 @@ class SpecialRecentChanges extends IncludableSpecialPage { } $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title]; } - $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter ); - --$limit; + + $changeLine = $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter ); + if ( $changeLine !== false ) { + $rclistOutput .= $changeLine; + --$limit; + } + } + $rclistOutput .= $list->endRecentChangesList(); + + // Print things out + + if ( !$this->including() ) { + // Output options box + $this->doHeader( $opts ); + } + + // And now for the content + $feedQuery = $this->getFeedQuery(); + if ( $feedQuery !== '' ) { + $this->getOutput()->setFeedAppendQuery( $feedQuery ); + } else { + $this->getOutput()->setFeedAppendQuery( false ); + } + + if ( $rows->numRows() === 0 ) { + $this->getOutput()->wrapWikiMsg( + "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult' + ); + } else { + $this->getOutput()->addHTML( $rclistOutput ); } - $s .= $list->endRecentChangesList(); - $this->getOutput()->addHTML( $s ); } /** * Get the query string to append to feed link URLs. - * This is overridden by RCL to add the target parameter - * @return bool + * + * @return string */ public function getFeedQuery() { - return false; + global $wgFeedLimit; + + $this->getOptions()->validateIntBounds( 'limit', 0, $wgFeedLimit ); + $options = $this->getOptions()->getChangedValues(); + + // wfArrayToCgi() omits options set to null or false + foreach ( $options as &$value ) { + if ( $value === false ) { + $value = '0'; + } + } + unset( $value ); + + return wfArrayToCgi( $options ); } /** * Return the text to be displayed above the changes * - * @param $opts FormOptions - * @return String: XHTML + * @param FormOptions $opts + * @return string XHTML */ public function doHeader( $opts ) { global $wgScript; @@ -554,10 +560,6 @@ class SpecialRecentChanges extends IncludableSpecialPage { $defaults = $opts->getAllValues(); $nondefaults = $opts->getChangedValues(); - $opts->consumeValues( array( - 'namespace', 'invert', 'associated', 'tagfilter', - 'categories', 'categories_any' - ) ); $panel = array(); $panel[] = $this->optionsPanel( $defaults, $nondefaults ); @@ -569,24 +571,36 @@ class SpecialRecentChanges extends IncludableSpecialPage { $submit = ' ' . Xml::submitbutton( $this->msg( 'allpagessubmit' )->text() ); $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) ); - foreach( $extraOpts as $name => $optionRow ) { + foreach ( $extraOpts as $name => $optionRow ) { # Add submit button to the last row only ++$count; $addSubmit = ( $count === $extraOptsCount ) ? $submit : ''; $out .= Xml::openElement( 'tr' ); - if( is_array( $optionRow ) ) { - $out .= Xml::tags( 'td', array( 'class' => 'mw-label mw-' . $name . '-label' ), $optionRow[0] ); - $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit ); + if ( is_array( $optionRow ) ) { + $out .= Xml::tags( + 'td', + array( 'class' => 'mw-label mw-' . $name . '-label' ), + $optionRow[0] + ); + $out .= Xml::tags( + 'td', + array( 'class' => 'mw-input' ), + $optionRow[1] . $addSubmit + ); } else { - $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit ); + $out .= Xml::tags( + 'td', + array( 'class' => 'mw-input', 'colspan' => 2 ), + $optionRow . $addSubmit + ); } $out .= Xml::closeElement( 'tr' ); } $out .= Xml::closeElement( 'table' ); $unconsumed = $opts->getUnconsumedValues(); - foreach( $unconsumed as $key => $value ) { + foreach ( $unconsumed as $key => $value ) { $out .= Html::hidden( $key, $value ); } @@ -597,7 +611,11 @@ class SpecialRecentChanges extends IncludableSpecialPage { $panelString = implode( "\n", $panel ); $this->getOutput()->addHTML( - Xml::fieldset( $this->msg( 'recentchanges-legend' )->text(), $panelString, array( 'class' => 'rcoptions' ) ) + Xml::fieldset( + $this->msg( 'recentchanges-legend' )->text(), + $panelString, + array( 'class' => 'rcoptions' ) + ) ); $this->setBottomText( $opts ); @@ -606,15 +624,19 @@ class SpecialRecentChanges extends IncludableSpecialPage { /** * Get options to be displayed in a form * - * @param $opts FormOptions - * @return Array + * @param FormOptions $opts + * @return array */ function getExtraOptions( $opts ) { + $opts->consumeValues( array( + 'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any' + ) ); + $extraOpts = array(); $extraOpts['namespace'] = $this->namespaceFilterForm( $opts ); global $wgAllowCategorizedRecentChanges; - if( $wgAllowCategorizedRecentChanges ) { + if ( $wgAllowCategorizedRecentChanges ) { $extraOpts['category'] = $this->categoryFilterForm( $opts ); } @@ -623,14 +645,18 @@ class SpecialRecentChanges extends IncludableSpecialPage { $extraOpts['tagfilter'] = $tagFilter; } - wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) ); + // Don't fire the hook for subclasses. (Or should we?) + if ( $this->getName() === 'Recentchanges' ) { + wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) ); + } + return $extraOpts; } /** * Send the text to be displayed above the options * - * @param $opts FormOptions + * @param FormOptions $opts Unused */ function setTopText( FormOptions $opts ) { global $wgContLang; @@ -649,19 +675,19 @@ class SpecialRecentChanges extends IncludableSpecialPage { } /** - * Send the text to be displayed after the options, for use in - * Recentchangeslinked + * Send the text to be displayed after the options, for use in subclasses. * - * @param $opts FormOptions + * @param FormOptions $opts */ - function setBottomText( FormOptions $opts ) {} + function setBottomText( FormOptions $opts ) { + } /** * Creates the choose namespace selection * * @todo Uses radio buttons (HASHAR) - * @param $opts FormOptions - * @return String + * @param FormOptions $opts + * @return string */ protected function namespaceFilterForm( FormOptions $opts ) { $nsSelect = Html::namespaceSelector( @@ -679,14 +705,15 @@ class SpecialRecentChanges extends IncludableSpecialPage { $opts['associated'], array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() ) ); + return array( $nsLabel, "$nsSelect $invert $associated" ); } /** * Create a input to filter changes by categories * - * @param $opts FormOptions - * @return Array + * @param FormOptions $opts + * @return array */ protected function categoryFilterForm( FormOptions $opts ) { list( $label, $input ) = Xml::inputLabelSep( $this->msg( 'rc_categories' )->text(), @@ -701,21 +728,21 @@ class SpecialRecentChanges extends IncludableSpecialPage { /** * Filter $rows by categories set in $opts * - * @param $rows Array of database rows - * @param $opts FormOptions + * @param array $rows Database rows + * @param FormOptions $opts */ function filterByCategories( &$rows, FormOptions $opts ) { - $categories = array_map( 'trim', explode( '|' , $opts['categories'] ) ); + $categories = array_map( 'trim', explode( '|', $opts['categories'] ) ); - if( !count( $categories ) ) { + if ( !count( $categories ) ) { return; } # Filter categories $cats = array(); - foreach( $categories as $cat ) { + foreach ( $categories as $cat ) { $cat = trim( $cat ); - if( $cat == '' ) { + if ( $cat == '' ) { continue; } $cats[] = $cat; @@ -725,16 +752,16 @@ class SpecialRecentChanges extends IncludableSpecialPage { $articles = array(); $a2r = array(); $rowsarr = array(); - foreach( $rows as $k => $r ) { + foreach ( $rows as $k => $r ) { $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title ); $id = $nt->getArticleID(); - if( $id == 0 ) { + if ( $id == 0 ) { continue; # Page might have been deleted... } - if( !in_array( $id, $articles ) ) { + if ( !in_array( $id, $articles ) ) { $articles[] = $id; } - if( !isset( $a2r[$id] ) ) { + if ( !isset( $a2r[$id] ) ) { $a2r[$id] = array(); } $a2r[$id][] = $k; @@ -742,7 +769,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { } # Shortcut? - if( !count( $articles ) || !count( $cats ) ) { + if ( !count( $articles ) || !count( $cats ) ) { return; } @@ -753,8 +780,8 @@ class SpecialRecentChanges extends IncludableSpecialPage { # Filter $newrows = array(); - foreach( $match as $id ) { - foreach( $a2r[$id] as $rev ) { + foreach ( $match as $id ) { + foreach ( $a2r[$id] as $rev ) { $k = $rev; $newrows[$k] = $rowsarr[$k]; } @@ -765,10 +792,10 @@ class SpecialRecentChanges extends IncludableSpecialPage { /** * Makes change an option link which carries all the other options * - * @param $title Title - * @param $override Array: options to override - * @param $options Array: current options - * @param $active Boolean: whether to show the link in bold + * @param string $title Title + * @param array $override Options to override + * @param array $options Current options + * @param bool $active Whether to show the link in bold * @return string */ function makeOptionsLink( $title, $override, $options, $active = false ) { @@ -787,14 +814,15 @@ class SpecialRecentChanges extends IncludableSpecialPage { if ( $active ) { $text = '<strong>' . $text . '</strong>'; } + return Linker::linkKnown( $this->getTitle(), $text, array(), $params ); } /** * Creates the options panel. * - * @param $defaults Array - * @param $nondefaults Array + * @param array $defaults + * @param array $nondefaults * @return string */ function optionsPanel( $defaults, $nondefaults ) { @@ -804,13 +832,13 @@ class SpecialRecentChanges extends IncludableSpecialPage { $note = ''; $msg = $this->msg( 'rclegend' ); - if( !$msg->isDisabled() ) { + if ( !$msg->isDisabled() ) { $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n"; } $lang = $this->getLanguage(); $user = $this->getUser(); - if( $options['from'] ) { + if ( $options['from'] ) { $note .= $this->msg( 'rcnotefrom' )->numParams( $options['limit'] )->params( $lang->userTimeAndDate( $options['from'], $user ), $lang->userDate( $options['from'], $user ), @@ -818,37 +846,41 @@ class SpecialRecentChanges extends IncludableSpecialPage { } # Sort data for display and make sure it's unique after we've added user data. - $wgRCLinkLimits[] = $options['limit']; - $wgRCLinkDays[] = $options['days']; - sort( $wgRCLinkLimits ); - sort( $wgRCLinkDays ); - $wgRCLinkLimits = array_unique( $wgRCLinkLimits ); - $wgRCLinkDays = array_unique( $wgRCLinkDays ); + $linkLimits = $wgRCLinkLimits; + $linkLimits[] = $options['limit']; + sort( $linkLimits ); + $linkLimits = array_unique( $linkLimits ); + + $linkDays = $wgRCLinkDays; + $linkDays[] = $options['days']; + sort( $linkDays ); + $linkDays = array_unique( $linkDays ); // limit links - foreach( $wgRCLinkLimits as $value ) { + $cl = array(); + foreach ( $linkLimits as $value ) { $cl[] = $this->makeOptionsLink( $lang->formatNum( $value ), array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ); } $cl = $lang->pipeList( $cl ); // day links, reset 'from' to none - foreach( $wgRCLinkDays as $value ) { + $dl = array(); + foreach ( $linkDays as $value ) { $dl[] = $this->makeOptionsLink( $lang->formatNum( $value ), array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ); } $dl = $lang->pipeList( $dl ); - // show/hide links $showhide = array( $this->msg( 'show' )->text(), $this->msg( 'hide' )->text() ); $filters = array( - 'hideminor' => 'rcshowhideminor', - 'hidebots' => 'rcshowhidebots', - 'hideanons' => 'rcshowhideanons', - 'hideliu' => 'rcshowhideliu', + 'hideminor' => 'rcshowhideminor', + 'hidebots' => 'rcshowhidebots', + 'hideanons' => 'rcshowhideanons', + 'hideliu' => 'rcshowhideliu', 'hidepatrolled' => 'rcshowhidepatr', - 'hidemyself' => 'rcshowhidemine' + 'hidemyself' => 'rcshowhidemine' ); foreach ( $this->getCustomFilters() as $key => $params ) { $filters[$key] = $params['msg']; @@ -861,7 +893,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { $links = array(); foreach ( $filters as $key => $msg ) { $link = $this->makeOptionsLink( $showhide[1 - $options[$key]], - array( $key => 1-$options[$key] ), $nondefaults ); + array( $key => 1 - $options[$key] ), $nondefaults ); $links[] = $this->msg( $msg )->rawParams( $link )->escaped(); } @@ -872,17 +904,23 @@ class SpecialRecentChanges extends IncludableSpecialPage { $now, array( 'from' => $timestamp ), $nondefaults ); - $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) )->parse(); + $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) ) + ->parse(); $rclistfrom = $this->msg( 'rclistfrom' )->rawParams( $tl )->parse(); + return "{$note}$rclinks<br />$rclistfrom"; } /** - * add javascript specific to the [[Special:RecentChanges]] page + * Add page-specific modules. */ - function addRecentChangesJS() { + protected function addModules() { $this->getOutput()->addModules( array( 'mediawiki.special.recentchanges', ) ); } + + protected function getGroupName() { + return 'changes'; + } } |