Merge branch 'Wikidata' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata
[lhc/web/wiklou.git] / includes / api / ApiQueryProtectedTitles.php
index 6c54dd6..44cc1d3 100644 (file)
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       // Eclipse helper - will be ignored in production
-       require_once( 'ApiQueryBase.php' );
-}
-
 /**
  * Query module to enumerate all create-protected pages.
  *
@@ -64,7 +59,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                $this->addFieldsIf( 'pt_expiry', isset( $prop['expiry'] ) );
                $this->addFieldsIf( 'pt_create_perm', isset( $prop['level'] ) );
 
-               $this->addWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
+               $this->addTimestampWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
                $this->addWhereFld( 'pt_namespace', $params['namespace'] );
                $this->addWhereFld( 'pt_create_perm', $params['level'] );
 
@@ -112,8 +107,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                                }
 
                                if ( isset( $prop['parsedcomment'] ) ) {
-                                       global $wgUser;
-                                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->pt_reason, $title );
+                                       $vals['parsedcomment'] = Linker::formatComment( $row->pt_reason, $title );
                                }
 
                                if ( isset( $prop['expiry'] ) ) {
@@ -224,12 +218,16 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                return 'List all titles protected from creation';
        }
 
-       protected function getExamples() {
+       public function getExamples() {
                return array(
                        'api.php?action=query&list=protectedtitles',
                );
        }
 
+       public function getHelpUrls() {
+               return 'https://www.mediawiki.org/wiki/API:Protectedtitles';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }