Merge "Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks"
[lhc/web/wiklou.git] / includes / api / ApiQueryProtectedTitles.php
index 4c88be7..033310d 100644 (file)
@@ -123,7 +123,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                                }
 
                                if ( isset( $prop['userid'] ) || /*B/C*/isset( $prop['user'] ) ) {
-                                       $vals['userid'] = $row->pt_user;
+                                       $vals['userid'] = (int)$row->pt_user;
                                }
 
                                if ( isset( $prop['comment'] ) ) {
@@ -156,7 +156,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                }
 
                if ( is_null( $resultPageSet ) ) {
-                       $result->setIndexedTagName_internal(
+                       $result->addIndexedTagName(
                                array( 'query', $this->getModuleName() ),
                                $this->getModulePrefix()
                        );
@@ -196,7 +196,8 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                                ApiBase::PARAM_TYPE => array(
                                        'newer',
                                        'older'
-                               )
+                               ),
+                               ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
                        ),
                        'start' => array(
                                ApiBase::PARAM_TYPE => 'timestamp'
@@ -217,39 +218,18 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                                        'level'
                                )
                        ),
-                       'continue' => null,
-               );
-       }
-
-       public function getParamDescription() {
-               return array(
-                       'namespace' => 'Only list titles in these namespaces',
-                       'start' => 'Start listing at this protection timestamp',
-                       'end' => 'Stop listing at this protection timestamp',
-                       'dir' => $this->getDirectionDescription( $this->getModulePrefix() ),
-                       'limit' => 'How many total pages to return',
-                       'prop' => array(
-                               'Which properties to get',
-                               ' timestamp      - Adds the timestamp of when protection was added',
-                               ' user           - Adds the user that added the protection',
-                               ' userid         - Adds the user id that added the protection',
-                               ' comment        - Adds the comment for the protection',
-                               ' parsedcomment  - Adds the parsed comment for the protection',
-                               ' expiry         - Adds the timestamp of when the protection will be lifted',
-                               ' level          - Adds the protection level',
+                       'continue' => array(
+                               ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
                        ),
-                       'level' => 'Only list titles with these protection levels',
-                       'continue' => 'When more results are available, use this to continue',
                );
        }
 
-       public function getDescription() {
-               return 'List all titles protected from creation.';
-       }
-
-       public function getExamples() {
+       protected function getExamplesMessages() {
                return array(
-                       'api.php?action=query&list=protectedtitles',
+                       'action=query&list=protectedtitles'
+                               => 'apihelp-query+protectedtitles-example-simple',
+                       'action=query&generator=protectedtitles&gptnamespace=0&prop=linkshere'
+                               => 'apihelp-query+protectedtitles-example-generator',
                );
        }