Merge "Change mw-ui anchors to require mw-ui-anchor base class, and introduce mw...
[lhc/web/wiklou.git] / includes / specialpage / RedirectSpecialPage.php
index eb8557a..4226ee0 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 abstract class RedirectSpecialPage extends UnlistedSpecialPage {
-
        // Query parameters that can be passed through redirects
        protected $mAllowedRedirectParams = array();
 
@@ -41,11 +40,13 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
                if ( $redirect instanceof Title ) {
                        $url = $redirect->getFullURL( $query );
                        $this->getOutput()->redirect( $url );
+
                        return $redirect;
                } elseif ( $redirect === true ) {
                        // Redirect to index.php with query parameters
                        $url = wfAppendQuery( wfScript( 'index' ), $query );
                        $this->getOutput()->redirect( $url );
+
                        return $redirect;
                } else {
                        $class = get_class( $this );
@@ -66,14 +67,17 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
         * Return part of the request string for a special redirect page
         * This allows passing, e.g. action=history to Special:Mypage, etc.
         *
-        * @return String
+        * @return string
         */
        public function getRedirectQuery() {
                $params = array();
+               $request = $this->getRequest();
 
                foreach ( $this->mAllowedRedirectParams as $arg ) {
-                       if ( $this->getRequest()->getVal( $arg, null ) !== null ) {
-                               $params[$arg] = $this->getRequest()->getVal( $arg );
+                       if ( $request->getVal( $arg, null ) !== null ) {
+                               $params[$arg] = $request->getVal( $arg );
+                       } elseif ( $request->getArray( $arg, null ) !== null ) {
+                               $params[$arg] = $request->getArray( $arg );
                        }
                }
 
@@ -91,8 +95,11 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
  * @ingroup SpecialPage
  */
 abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
-       // @todo FIXME: Visibility must be declared
-       var $redirName, $redirSubpage;
+       /** @var string Name of redirect target */
+       protected $redirName;
+
+       /** @var string Name of subpage of redirect target */
+       protected $redirSubpage;
 
        function __construct(
                $name, $redirName, $redirSubpage = false,
@@ -149,10 +156,6 @@ abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
  * preference, useful for preloaded edits where you know preview wouldn't be
  * useful.
  *
- * - internaledit, externaledit, mode: Allows forcing the use of the
- * internal/external editor, e.g. to force the internal editor for
- * short/simple preloaded edits.
- *
  * - redlink: Affects the message the user sees if their talk page/user talk
  * page does not currently exist. Avoids confusion for newbies with no user
  * pages over why they got a "permission error" following this link:
@@ -171,12 +174,12 @@ abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
  *
  * @par Hook extension example:
  * @code
- *     $wgHooks['RedirectSpecialArticleRedirectParams'][] =
- *             'MyExtensionHooks::onRedirectSpecialArticleRedirectParams';
- *     public static function onRedirectSpecialArticleRedirectParams( &$redirectParams ) {
- *             $redirectParams[] = 'stable';
- *             return true;
- *     }
+ *    $wgHooks['RedirectSpecialArticleRedirectParams'][] =
+ *        'MyExtensionHooks::onRedirectSpecialArticleRedirectParams';
+ *    public static function onRedirectSpecialArticleRedirectParams( &$redirectParams ) {
+ *        $redirectParams[] = 'stable';
+ *        return true;
+ *    }
  * @endcode
  *
  * @ingroup SpecialPage
@@ -188,9 +191,9 @@ abstract class RedirectSpecialArticle extends RedirectSpecialPage {
                        'action',
                        'redirect', 'rdfrom',
                        # Options for preloaded edits
-                       'preload', 'editintro', 'preloadtitle', 'summary', 'nosummary',
+                       'preload', 'preloadparams', 'editintro', 'preloadtitle', 'summary', 'nosummary',
                        # Options for overriding user settings
-                       'preview', 'internaledit', 'externaledit', 'mode', 'minor', 'watchthis',
+                       'preview', 'minor', 'watchthis',
                        # Options for history/diffs
                        'section', 'oldid', 'diff', 'dir',
                        'limit', 'offset', 'feed',