Go to the documentation of this file.
48 parent::__construct(
'ExpandTemplates' );
60 $titleStr =
$request->getText(
'wpContextTitle' );
66 $input =
$request->getText(
'wpInput' );
67 $this->generateXML =
$request->getBool(
'wpGenerateXml' );
68 $this->generateRawHtml =
$request->getBool(
'wpGenerateRawHtml' );
70 if ( strlen( $input ) ) {
71 $this->removeComments =
$request->getBool(
'wpRemoveComments',
false );
72 $this->removeNowiki =
$request->getBool(
'wpRemoveNowiki',
false );
74 $options->setRemoveComments( $this->removeComments );
76 $options->setMaxIncludeSize( self::MAX_INCLUDE_SIZE );
78 if ( $this->generateXML ) {
80 $dom =
$wgParser->preprocessToDom( $input );
82 if ( method_exists( $dom,
'saveXML' ) ) {
83 $xml = $dom->saveXML();
85 $xml = $dom->__toString();
91 $this->removeComments =
$request->getBool(
'wpRemoveComments',
true );
92 $this->removeNowiki =
$request->getBool(
'wpRemoveNowiki',
false );
97 $out->addWikiMsg(
'expand_templates_intro' );
101 if ( $this->generateXML && strlen(
$output ) > 0 ) {
102 $out->addHTML( $this->
makeOutput( $xml,
'expand_templates_xml_output' ) );
107 if ( $this->removeNowiki ) {
109 array(
'_<nowiki>_',
'_</nowiki>_',
'_<nowiki */>_' ),
115 if ( ( $wgUseTidy &&
$options->getTidy() ) || $wgAlwaysUseTidy ) {
119 $out->addHTML( $tmp );
123 if ( $this->generateRawHtml && strlen( $rawhtml ) > 0 ) {
124 $out->addHTML( $this->
makeOutput( $rawhtml,
'expand_templates_html_output' ) );
145 array(
'method' =>
'post',
'action' =>
$self->getLocalUrl() )
147 $form .=
"<fieldset><legend>" . $this->
msg(
'expandtemplates' )->escaped() .
"</legend>\n";
150 $this->
msg(
'expand_templates_title' )->plain(),
155 array(
'autofocus' =>
true )
158 $this->
msg(
'expand_templates_input' )->
text(),
166 array(
'id' =>
'input' )
170 $this->
msg(
'expand_templates_remove_comments' )->
text(),
173 $this->removeComments
176 $this->
msg(
'expand_templates_remove_nowiki' )->
text(),
182 $this->
msg(
'expand_templates_generate_xml' )->
text(),
188 $this->
msg(
'expand_templates_generate_rawhtml' )->
text(),
191 $this->generateRawHtml
194 $this->
msg(
'expand_templates_ok' )->
text(),
195 array(
'accesskey' =>
's' )
197 $form .=
"</fieldset>\n";
212 $out =
"<h2>" . $this->
msg( $heading )->escaped() .
"</h2>\n";
218 array(
'id' =>
'output',
'readonly' =>
'readonly' )
235 $popts->setTargetLanguage(
$title->getPageLanguage() );
238 return $pout->getText();
249 $lang =
$title->getPageViewLanguage();
250 $out->addHTML(
"<h2>" . $this->
msg(
'expand_templates_preview' )->escaped() .
"</h2>\n" );
261 if (
$user->isAnon() && !
$user->isAllowed(
'edit' ) ) {
262 $error =
array(
'expand_templates_preview_fail_html_anon' );
264 $error =
array(
'expand_templates_preview_fail_html' );
270 $out->wrapWikiMsg(
"<div class='previewnote'>\n$1\n</div>",
$error );
276 'class' =>
'mw-content-' . $lang->getDir(),
277 'dir' => $lang->getDir(),
278 'lang' => $lang->getHtmlCode(),
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
getPageTitle( $subpage=false)
Get a self-referential title object.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled also a ContextSource error or success you ll probably need to make sure the header is varied on WebRequest $request
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
getOutput()
Get the OutputPage being used for this instance.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead $form
execute( $subpage)
Show the special page.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
boolean $generateRawHtml
whether or not to show the raw HTML code *
static openElement( $element, $attribs=null)
This opens an XML element.
makeOutput( $output, $heading='expand_templates_output')
Generate a nice little box with a heading for output.
static closeElement( $element)
Returns "</$element>".
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
showHtmlPreview(Title $title, $html, OutputPage $out)
Wraps the provided html code in a div and outputs it to the page.
boolean $removeNowiki
whether or not to remove <nowiki> tags in the expanded wikitext *
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
static inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=array())
Convenience function to build an HTML text input field with a label.
when a variable name is used in a it is silently declared as a new masking the global
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
This class should be covered by a general architecture document which does not exist as of January 20...
getContext()
Gets the context this SpecialPage is executed in.
A special page that expands submitted templates, parser functions, and variables, allowing easier deb...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
presenting them properly to the user as errors is done by the caller $title
msg()
Wrapper around wfMessage that sets the current context.
static newFromContext(IContextSource $context)
Get a ParserOptions object from a IContextSource object.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
makeForm( $title, $input)
Generate a form allowing users to enter information.
static textarea( $name, $content, $cols=40, $rows=5, $attribs=array())
Shortcut for creating textareas.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
generateHtml(Title $title, $text)
Renders the supplied wikitext as html.
Represents a title within MediaWiki.
static closeElement( $element)
Shortcut to close an XML element.
boolean $generateXML
whether or not to show the XML parse tree *
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string as detected by MediaWiki Handlers will typically only apply for specific mime types object & $error
static label( $label, $id, $attribs=array())
Convenience function to build an HTML form label.
static tidy( $text)
Interface with html tidy, used if $wgUseTidy = true.
boolean $removeComments
whether or not to remove comments in the expanded wikitext *