36 $this->modifiedUser =
$user;
43 if ( $this->modifiedUser ===
null ) {
65 $html = Xml::tags(
'div', [
'id' =>
'preferences' ],
$html );
67 return parent::wrapForm(
$html );
74 if ( !$this->
getModifiedUser()->isAllowedAny(
'editmyprivateinfo',
'editmyoptions' ) ) {
78 $html = parent::getButtons();
83 $html .=
new OOUI\ButtonWidget( [
85 'id' =>
'mw-prefs-restoreprefs',
86 'label' => $this->
msg(
'restoreprefs' )->
text(),
87 'href' =>
$t->getLinkURL(),
88 'flags' => [
'destructive' ],
92 $html = Xml::tags(
'div', [
'class' =>
'mw-prefs-buttons' ],
$html );
105 foreach ( $this->mFlatFields
as $fieldname => $field ) {
107 $info = $field->mParams;
108 $prefix = $info[
'prefix'] ?? $fieldname;
109 foreach ( $field->filterDataForSubmit(
$data[$fieldname] )
as $key =>
$value ) {
112 unset(
$data[$fieldname] );
120 $layout = parent::wrapFieldSetSection( $legend,
$section, $attributes, $isRoot );
122 $layout->addClasses( [
'mw-prefs-fieldset-wrapper' ] );
123 $layout->removeClasses( [
'oo-ui-panelLayout-framed' ] );
134 foreach ( $this->mFieldTree
as $key => $val ) {
135 if ( !is_array( $val ) ) {
136 wfDebug( __METHOD__ .
" encountered a field not attached to a section: '$key'" );
143 $this->mFieldTree[$key],
145 "mw-prefsection-$key-"
149 $tabPanels[] =
new OOUI\TabPanelLayout( [
150 'classes' => [
'mw-htmlform-autoinfuse-lazy' ],
151 'name' =>
'mw-prefsection-' . $key,
153 'content' =>
new OOUI\FieldsetLayout( [
154 'classes' => [
'mw-prefs-section-fieldset' ],
155 'id' =>
"mw-prefsection-$key",
159 'content' =>
new OOUI\HtmlSnippet(
$content )
168 $indexLayout =
new OOUI\IndexLayout( [
171 'autoFocus' =>
false,
172 'classes' => [
'mw-prefs-tabs' ],
174 $indexLayout->addTabPanels( $tabPanels );
176 return new OOUI\PanelLayout( [
179 'classes' => [
'mw-prefs-tabs-wrapper' ],
180 'content' => $indexLayout
191 $legend = parent::getLegend( $key );
192 Hooks::run(
'PreferencesGetLegend', [ $this, $key, &$legend ] );
201 return array_keys( array_filter( $this->mFieldTree,
'is_array' ) );
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
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
return true to allow those checks to and false if checking is done & $user
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php