Article: Drop partial purge code and constants, deprecated in 1.29
[lhc/web/wiklou.git] / includes / page / Article.php
index 7311f71..da8fe88 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 ) {
@@ -2129,16 +2116,6 @@ class Article implements Page {
                return $this->mPage->doPurge();
        }
 
-       /**
-        * Call to WikiPage function for backwards compatibility.
-        * @see WikiPage::getLastPurgeTimestamp
-        * @deprecated since 1.29
-        */
-       public function getLastPurgeTimestamp() {
-               wfDeprecated( __METHOD__, '1.29' );
-               return $this->mPage->getLastPurgeTimestamp();
-       }
-
        /**
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::doViewUpdates