RCFilters: Don't grey out results area when initializing, unless there's a default...
[lhc/web/wiklou.git] / includes / page / Article.php
index 33f7d47..b91bd9a 100644 (file)
@@ -466,7 +466,7 @@ class Article implements Page {
                # Allow frames by default
                $outputPage->allowClickjacking();
 
-               $parserCache = ParserCache::singleton();
+               $parserCache = MediaWikiServices::getInstance()->getParserCache();
 
                $parserOptions = $this->getParserOptions();
                # Render printable version, use printable version cache
@@ -1695,24 +1695,11 @@ class Article implements Page {
 
                $outputPage->enableOOUI();
 
-               $options = [];
-               $options[] = [
-                       'data' => 'other',
-                       'label' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text(),
-               ];
-               $list = $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text();
-               foreach ( explode( "\n", $list ) as $option ) {
-                       $value = trim( $option );
-                       if ( $value == '' ) {
-                               continue;
-                       } elseif ( substr( $value, 0, 1 ) == '*' && substr( $value, 1, 1 ) != '*' ) {
-                               $options[] = [ 'optgroup' => trim( substr( $value, 1 ) ) ];
-                       } elseif ( substr( $value, 0, 2 ) == '**' ) {
-                               $options[] = [ 'data' => trim( substr( $value, 2 ) ) ];
-                       } else {
-                               $options[] = [ 'data' => trim( $value ) ];
-                       }
-               }
+               $options = Xml::listDropDownOptions(
+                       $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text(),
+                       [ 'other' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text() ]
+               );
+               $options = Xml::listDropDownOptionsOoui( $options );
 
                $fields[] = new OOUI\FieldLayout(
                        new OOUI\DropdownInputWidget( [
@@ -1920,7 +1907,7 @@ class Article implements Page {
 
        /**
         * Check if the page can be cached
-        * @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
+        * @param int $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
         * @return bool
         */
        public function isFileCacheable( $mode = HTMLFileCache::MODE_NORMAL ) {
@@ -2580,7 +2567,7 @@ class Article implements Page {
        /**
         * @param array $limit
         * @param array $expiry
-        * @param bool $cascade
+        * @param bool &$cascade
         * @param string $reason
         * @param User $user
         * @return Status
@@ -2594,7 +2581,7 @@ class Article implements Page {
        /**
         * @param array $limit
         * @param string $reason
-        * @param int $cascade
+        * @param int &$cascade
         * @param array $expiry
         * @return bool
         */
@@ -2615,7 +2602,7 @@ class Article implements Page {
         * @param bool $suppress
         * @param int $u1 Unused
         * @param bool $u2 Unused
-        * @param string $error
+        * @param string &$error
         * @return bool
         */
        public function doDeleteArticle(
@@ -2629,7 +2616,7 @@ class Article implements Page {
         * @param string $summary
         * @param string $token
         * @param bool $bot
-        * @param array $resultDetails
+        * @param array &$resultDetails
         * @param User|null $user
         * @return array
         */
@@ -2642,7 +2629,7 @@ class Article implements Page {
         * @param string $fromP
         * @param string $summary
         * @param bool $bot
-        * @param array $resultDetails
+        * @param array &$resultDetails
         * @param User|null $guser
         * @return array
         */
@@ -2652,7 +2639,7 @@ class Article implements Page {
        }
 
        /**
-        * @param bool $hasHistory
+        * @param bool &$hasHistory
         * @return mixed
         */
        public function generateReason( &$hasHistory ) {