Add 'logid' parameter to Special:Log
[lhc/web/wiklou.git] / includes / specials / SpecialLog.php
index 6a11bf4..bad1746 100644 (file)
@@ -51,6 +51,7 @@ class SpecialLog extends SpecialPage {
                $opts->add( 'dir', '' );
                $opts->add( 'offender', '' );
                $opts->add( 'subtype', '' );
+               $opts->add( 'logid', '' );
 
                // Set values
                $opts->fetchValuesFromRequest( $this->getRequest() );
@@ -169,6 +170,16 @@ class SpecialLog extends SpecialPage {
                return $subpages;
        }
 
+       /**
+        * Set options based on the subpage title parts:
+        * - One part that is a valid log type: Special:Log/logtype
+        * - Two parts: Special:Log/logtype/username
+        * - Otherwise, assume the whole subpage is a username.
+        *
+        * @param FormOptions $opts
+        * @param $par
+        * @throws ConfigException
+        */
        private function parseParams( FormOptions $opts, $par ) {
                # Get parameters
                $par = $par !== null ? $par : '';
@@ -204,7 +215,8 @@ class SpecialLog extends SpecialPage {
                        $opts->getValue( 'year' ),
                        $opts->getValue( 'month' ),
                        $opts->getValue( 'tagfilter' ),
-                       $opts->getValue( 'subtype' )
+                       $opts->getValue( 'subtype' ),
+                       $opts->getValue( 'logid' )
                );
 
                $this->addHeader( $opts->getValue( 'type' ) );