/**
* The main sequence of page names. These will be displayed in turn.
- * To add one:
- * * Add it here
- * * Add a config-page-<name> message
- * * Add a WebInstaller_<name> class
+ *
+ * To add a new installer page:
+ * * Add it to this WebInstaller::$pageSequence property
+ * * Add a "config-page-<name>" message
+ * * Add a "WebInstaller_<name>" class
* @var array
*/
public $pageSequence = array(
$url = $m[1];
}
return md5( serialize( array(
- 'local path' => dirname( dirname( __FILE__ ) ),
+ 'local path' => dirname( __DIR__ ),
'url' => $url,
'version' => $GLOBALS['wgVersion']
) ) );
}
/**
- * Show an error message in a box. Parameters are like wfMsg().
+ * Show an error message in a box. Parameters are like wfMessage().
* @param $msg
*/
public function showError( $msg /*...*/ ) {
$args = func_get_args();
array_shift( $args );
$args = array_map( 'htmlspecialchars', $args );
- $msg = wfMsgReal( $msg, $args, false, false, false );
+ $msg = wfMessage( $msg, $args )->useDatabase( false )->plain();
$this->output->addHTML( $this->getErrorBox( $msg ) );
}
$s .= $this->getPageListItem( 'Restart', true, $currentPageName );
$s .= "</ul></div>\n"; // end list pane
$s .= Html::element( 'h2', array(),
- wfMsg( 'config-page-' . strtolower( $currentPageName ) ) );
+ wfMessage( 'config-page-' . strtolower( $currentPageName ) )->text() );
$this->output->addHTMLNoFlush( $s );
}
*/
private function getPageListItem( $pageName, $enabled, $currentPageName ) {
$s = "<li class=\"config-page-list-item\">";
- $name = wfMsg( 'config-page-' . strtolower( $pageName ) );
+ $name = wfMessage( 'config-page-' . strtolower( $pageName ) )->text();
if ( $enabled ) {
$query = array( 'page' => $pageName );
/**
* Get HTML for an error box with an icon.
*
- * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $text String: wikitext, get this with wfMessage()->plain()
*
* @return string
*/
/**
* Get HTML for a warning box with an icon.
*
- * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $text String: wikitext, get this with wfMessage()->plain()
*
* @return string
*/
/**
* Get HTML for an info box with an icon.
*
- * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $text String: wikitext, get this with wfMessage()->plain()
* @param $icon String: icon name, file in skins/common/images
* @param $class String: additional class name to add to the wrapper div
*
public function getInfoBox( $text, $icon = false, $class = false ) {
$text = $this->parse( $text, true );
$icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
- $alt = wfMsg( 'config-information' );
+ $alt = wfMessage( 'config-information' )->text();
return Html::infoBox( $text, $icon, $alt, $class, false );
}
/**
* Get small text indented help for a preceding form field.
- * Parameters like wfMsg().
+ * Parameters like wfMessage().
*
* @param $msg
* @return string
$args = func_get_args();
array_shift( $args );
$args = array_map( 'htmlspecialchars', $args );
- $text = wfMsgReal( $msg, $args, false, false, false );
+ $text = wfMessage( $msg, $args )->useDatabase( false )->plain();
$html = $this->parse( $text, true );
return "<div class=\"mw-help-field-container\">\n" .
- "<span class=\"mw-help-field-hint\">" . wfMsgHtml( 'config-help' ) . "</span>\n" .
+ "<span class=\"mw-help-field-hint\">" . wfMessage( 'config-help' )->escaped() .
+ "</span>\n" .
"<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
"</div>\n";
}
/**
* Output a help box.
- * @param $msg String key for wfMsg()
+ * @param $msg String key for wfMessage()
*/
public function showHelpBox( $msg /*, ... */ ) {
$args = func_get_args();
$args = func_get_args();
array_shift( $args );
$html = '<div class="config-message">' .
- $this->parse( wfMsgReal( $msg, $args, false, false, false ) ) .
+ $this->parse( wfMessage( $msg, $args )->useDatabase( false )->plain() ) .
"</div>\n";
$this->output->addHTML( $html );
}
if ( strval( $msg ) == '' ) {
$labelText = ' ';
} else {
- $labelText = wfMsgHtml( $msg );
+ $labelText = wfMessage( $msg )->escaped();
}
$attributes = array( 'class' => 'config-label' );
if( isset( $params['rawtext'] ) ) {
$labelText = $params['rawtext'];
} else {
- $labelText = $this->parse( wfMsg( $params['label'] ) );
+ $labelText = $this->parse( wfMessage( $params['label'] )->text() );
}
return
Xml::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
' ' .
Xml::tags( 'label', array( 'for' => $id ), $this->parse(
- wfMsgNoTrans( $params['itemLabelPrefix'] . strtolower( $value ) )
+ wfMessage( $params['itemLabelPrefix'] . strtolower( $value ) )->plain()
) ) .
"</li>\n";
}
) );
$anchor = Html::rawElement( 'a',
array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
- $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) );
+ $img . ' ' . wfMessage( 'config-download-localsettings' )->escaped() );
return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
}