MediaWiki REL1_30
WebInstallerPage.php
Go to the documentation of this file.
1<?php
30abstract class WebInstallerPage {
31
37 public $parent;
38
42 abstract public function execute();
43
47 public function __construct( WebInstaller $parent ) {
48 $this->parent = $parent;
49 }
50
58 public function isSlow() {
59 return false;
60 }
61
65 public function addHTML( $html ) {
66 $this->parent->output->addHTML( $html );
67 }
68
69 public function startForm() {
70 $this->addHTML(
71 "<div class=\"config-section\">\n" .
72 Html::openElement(
73 'form',
74 [
75 'method' => 'post',
76 'action' => $this->parent->getUrl( [ 'page' => $this->getName() ] )
77 ]
78 ) . "\n"
79 );
80 }
81
86 public function endForm( $continue = 'continue', $back = 'back' ) {
87 $s = "<div class=\"config-submit\">\n";
88 $id = $this->getId();
89
90 if ( $id === false ) {
91 $s .= Html::hidden( 'lastPage', $this->parent->request->getVal( 'lastPage' ) );
92 }
93
94 if ( $continue ) {
95 // Fake submit button for enter keypress (T28267)
96 // Messages: config-continue, config-restart, config-regenerate
97 $s .= Xml::submitButton(
98 wfMessage( "config-$continue" )->text(),
99 [
100 'name' => "enter-$continue",
101 'style' => 'width:0;border:0;height:0;padding:0'
102 ]
103 ) . "\n";
104 }
105
106 if ( $back ) {
107 // Message: config-back
108 $s .= Xml::submitButton(
109 wfMessage( "config-$back" )->text(),
110 [
111 'name' => "submit-$back",
112 'tabindex' => $this->parent->nextTabIndex()
113 ]
114 ) . "\n";
115 }
116
117 if ( $continue ) {
118 // Messages: config-continue, config-restart, config-regenerate
119 $s .= Xml::submitButton(
120 wfMessage( "config-$continue" )->text(),
121 [
122 'name' => "submit-$continue",
123 'tabindex' => $this->parent->nextTabIndex(),
124 ]
125 ) . "\n";
126 }
127
128 $s .= "</div></form></div>\n";
129 $this->addHTML( $s );
130 }
131
135 public function getName() {
136 return str_replace( 'WebInstaller', '', static::class );
137 }
138
142 protected function getId() {
143 return array_search( $this->getName(), $this->parent->pageSequence );
144 }
145
152 public function getVar( $var, $default = null ) {
153 return $this->parent->getVar( $var, $default );
154 }
155
160 public function setVar( $name, $value ) {
161 $this->parent->setVar( $name, $value );
162 }
163
171 protected function getFieldsetStart( $legend ) {
172 return "\n<fieldset><legend>" . wfMessage( $legend )->escaped() . "</legend>\n";
173 }
174
180 protected function getFieldsetEnd() {
181 return "</fieldset>\n";
182 }
183
187 protected function startLiveBox() {
188 $this->addHTML(
189 '<div id="config-spinner" style="display:none;">' .
190 '<img src="images/ajax-loader.gif" /></div>' .
191 '<script>jQuery( "#config-spinner" ).show();</script>' .
192 '<div id="config-live-log">' .
193 '<textarea name="LiveLog" rows="10" cols="30" readonly="readonly">'
194 );
195 $this->parent->output->flush();
196 }
197
201 protected function endLiveBox() {
202 $this->addHTML( '</textarea></div>
203<script>jQuery( "#config-spinner" ).hide()</script>' );
204 $this->parent->output->flush();
205 }
206
207}
Abstract class to define pages for the web installer.
WebInstaller $parent
The WebInstaller object this WebInstallerPage belongs to.
getFieldsetEnd()
Get the end tag of a fieldset.
setVar( $name, $value)
endForm( $continue='continue', $back='back')
getVar( $var, $default=null)
startLiveBox()
Opens a textarea used to display the progress of a long operation.
__construct(WebInstaller $parent)
getFieldsetStart( $legend)
Get the starting tags of a fieldset.
endLiveBox()
Opposite to WebInstallerPage::startLiveBox.
isSlow()
Is this a slow-running page in the installer? If so, WebInstaller will set_time_limit(0) before calli...
Class for the core installer web interface.
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
Definition design.txt:18
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
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
Definition hooks.txt:1983