ApiParse: Add disableeditsection parameter
authorKunal Mehta <legoktm@gmail.com>
Sat, 21 Jun 2014 06:09:18 +0000 (23:09 -0700)
committerKunal Mehta <legoktm@gmail.com>
Sat, 21 Jun 2014 06:09:18 +0000 (23:09 -0700)
To disable edit section links in the parser output

Bug: 62723
Change-Id: I499c4bb0cd85964e78db3362e13a8033a2e9aed0

includes/api/ApiParse.php

index a276117..86ce1f1 100644 (file)
@@ -436,6 +436,7 @@ class ApiParse extends ApiBase {
                $popts->enableLimitReport( !$params['disablepp'] );
                $popts->setIsPreview( $params['preview'] || $params['sectionpreview'] );
                $popts->setIsSectionPreview( $params['sectionpreview'] );
+               $popts->setEditSection( !$params['disableeditsection'] );
 
                wfProfileOut( __METHOD__ );
 
@@ -748,6 +749,7 @@ class ApiParse extends ApiBase {
                        'uselang' => null,
                        'section' => null,
                        'disablepp' => false,
+                       'disableeditsection' => false,
                        'generatexml' => false,
                        'preview' => false,
                        'sectionpreview' => false,
@@ -816,6 +818,7 @@ class ApiParse extends ApiBase {
                        'uselang' => 'Which language to parse the request in',
                        'section' => 'Only retrieve the content of this section number',
                        'disablepp' => 'Disable the PP Report from the parser output',
+                       'disableeditsection' => 'Disable edit section links from the parser output',
                        'generatexml' => "Generate XML parse tree (requires contentmodel=$wikitext)",
                        'preview' => 'Parse in preview mode',
                        'sectionpreview' => 'Parse in section preview mode (enables preview mode too)',