Go to the documentation of this file.
43 $this->modifiedUser = $user;
50 if ( $this->modifiedUser ===
null ) {
69 $this->privateInfoEditable = $editable;
101 $html =
Xml::tags(
'div', [
'id' =>
'preferences' ], $html );
103 return parent::wrapForm( $html );
114 $html = parent::getButtons();
117 $t = $this->
getTitle()->getSubpage(
'reset' );
119 $html .=
new OOUI\ButtonWidget( [
121 'id' =>
'mw-prefs-restoreprefs',
122 'label' => $this->
msg(
'restoreprefs' )->text(),
123 'href' =>
$t->getLinkURL(),
124 'flags' => [
'destructive' ],
128 $html =
Xml::tags(
'div', [
'class' =>
'mw-prefs-buttons' ], $html );
141 foreach ( $this->mFlatFields as $fieldname => $field ) {
145 $info = $field->mParams;
146 $prefix = $info[
'prefix'] ?? $fieldname;
147 foreach ( $field->filterDataForSubmit( $data[$fieldname] ) as $key => $value ) {
148 $data[
"$prefix$key"] = $value;
150 unset( $data[$fieldname] );
158 $layout = parent::wrapFieldSetSection( $legend, $section, $attributes, $isRoot );
160 $layout->addClasses( [
'mw-prefs-fieldset-wrapper' ] );
161 $layout->removeClasses( [
'oo-ui-panelLayout-framed' ] );
172 foreach ( $this->mFieldTree as $key => $val ) {
173 if ( !is_array( $val ) ) {
174 wfDebug( __METHOD__ .
" encountered a field not attached to a section: '$key'" );
181 $this->mFieldTree[$key],
183 "mw-prefsection-$key-"
187 $tabPanels[] =
new OOUI\TabPanelLayout(
'mw-prefsection-' . $key, [
188 'classes' => [
'mw-htmlform-autoinfuse-lazy' ],
190 'content' =>
new OOUI\FieldsetLayout( [
191 'classes' => [
'mw-prefs-section-fieldset' ],
192 'id' =>
"mw-prefsection-$key",
196 'content' =>
new OOUI\HtmlSnippet(
$content )
205 $indexLayout =
new OOUI\IndexLayout( [
208 'autoFocus' =>
false,
209 'classes' => [
'mw-prefs-tabs' ],
211 $indexLayout->addTabPanels( $tabPanels );
213 return new OOUI\PanelLayout( [
216 'classes' => [
'mw-prefs-tabs-wrapper' ],
217 'content' => $indexLayout
228 $legend = parent::getLegend( $key );
229 Hooks::run(
'PreferencesGetLegend', [ $this, $key, &$legend ] );
238 return array_keys( array_filter( $this->mFieldTree,
'is_array' ) );
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
static tags( $element, $attribs, $contents)
Same as Xml::element(), but does not escape contents.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.