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' ) );
142 array(
'method' =>
'post',
'action' =>
$self->getLocalUrl() )
144 $form .=
"<fieldset><legend>" . $this->
msg(
'expandtemplates' )->escaped() .
"</legend>\n";
147 $this->
msg(
'expand_templates_title' )->plain(),
152 array(
'autofocus' =>
true )
155 $this->
msg(
'expand_templates_input' )->
text(),
163 array(
'id' =>
'input' )
167 $this->
msg(
'expand_templates_remove_comments' )->
text(),
170 $this->removeComments
173 $this->
msg(
'expand_templates_remove_nowiki' )->
text(),
179 $this->
msg(
'expand_templates_generate_xml' )->
text(),
185 $this->
msg(
'expand_templates_generate_rawhtml' )->
text(),
188 $this->generateRawHtml
191 $this->
msg(
'expand_templates_ok' )->
text(),
192 array(
'accesskey' =>
's' )
194 $form .=
"</fieldset>\n";
208 $out =
"<h2>" . $this->
msg( $heading )->escaped() .
"</h2>\n";
214 array(
'id' =>
'output',
'readonly' =>
'readonly' )
231 $popts->setTargetLanguage(
$title->getPageLanguage() );
234 return $pout->getText();
245 $lang =
$title->getPageViewLanguage();
246 $out->addHTML(
"<h2>" . $this->
msg(
'expand_templates_preview' )->escaped() .
"</h2>\n" );
248 'class' =>
'mw-content-' . $lang->getDir(),
249 'dir' => $lang->getDir(),
250 '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.
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.
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>", except if $wgWellFormedXml is off, in which case it returns the empty string w...
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!
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.
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.
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 *