MediaWiki master
DatabaseConnectForm.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Installer;
4
7
11abstract class DatabaseConnectForm extends DatabaseForm {
12
20 abstract public function getHtml();
21
31 abstract public function submit();
32
38 protected function getInstallUserBox() {
39 return "<span class=\"cdx-card\"><span class=\"cdx-card__text\">" .
41 'span',
42 [ 'class' => 'cdx-card__text__title' ],
43 wfMessage( 'config-db-install-account' )->text()
44 ) .
45 "<span class=\"cdx-card__text__description\">" .
46 $this->getTextBox(
47 '_InstallUser',
48 'config-db-username',
49 [ 'dir' => 'ltr' ],
50 $this->webInstaller->getHelpBox( 'config-db-install-username' )
51 ) .
52 $this->getPasswordBox(
53 '_InstallPassword',
54 'config-db-password',
55 [ 'dir' => 'ltr' ],
56 $this->webInstaller->getHelpBox( 'config-db-install-password' )
57 ) .
58 "</span></span></span>";
59 }
60
65 protected function submitInstallUserBox() {
66 $this->setVarsFromRequest( [ '_InstallUser', '_InstallPassword' ] );
67
68 return Status::newGood();
69 }
70
71}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
This class is a collection of static functions that serve two purposes:
Definition Html.php:56
getInstallUserBox()
Get a standard install-user fieldset.
submit()
Set variables based on the request array, assuming it was submitted via the form returned by getConne...
getHtml()
Get HTML for a web form that configures this database.
submitInstallUserBox()
Submit a standard install user fieldset.
getPasswordBox( $var, $label, $attribs=[], $helpData="")
Get a labelled password box to configure a local variable.
setVarsFromRequest( $varNames)
Convenience function to set variables based on form data.
getTextBox( $var, $label, $attribs=[], $helpData="")
Get a labelled text box to configure a local variable.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:54
element(SerializerNode $parent, SerializerNode $node, $contents)