31 private $modifiedUser;
34 private $privateInfoEditable =
true;
37 private $optionsEditable =
true;
43 $this->modifiedUser = $user;
50 if ( $this->modifiedUser ===
null ) {
53 return $this->modifiedUser;
61 return $this->privateInfoEditable;
69 $this->privateInfoEditable = $editable;
76 return $this->optionsEditable;
83 $this->optionsEditable = $optionsEditable;
101 $html = Xml::tags(
'div', [
'id' =>
'preferences' ], $html );
103 return parent::wrapForm( $html );
114 $html = parent::getButtons();
117 $html = Xml::tags(
'div', [
'class' =>
'mw-prefs-buttons' ], $html );
130 foreach ( $this->mFlatFields as $fieldname => $field ) {
132 $info = $field->mParams;
133 $prefix = $info[
'prefix'] ?? $fieldname;
134 foreach ( $field->filterDataForSubmit( $data[$fieldname] ) as $key => $value ) {
135 $data[
"$prefix$key"] = $value;
137 unset( $data[$fieldname] );
145 $layout = parent::wrapFieldSetSection( $legend, $section, $attributes, $isRoot );
147 $layout->addClasses( [
'mw-prefs-fieldset-wrapper' ] );
148 $layout->removeClasses( [
'oo-ui-panelLayout-framed' ] );
159 foreach ( $this->mFieldTree as $key => $val ) {
160 if ( !is_array( $val ) ) {
161 wfDebug( __METHOD__ .
" encountered a field not attached to a section: '$key'" );
170 "mw-prefsection-$key-"
174 $tabPanels[] =
new OOUI\TabPanelLayout(
'mw-prefsection-' . $key, [
175 'classes' => [
'mw-htmlform-autoinfuse-lazy' ],
177 'content' =>
new OOUI\FieldsetLayout( [
178 'classes' => [
'mw-prefs-section-fieldset' ],
179 'id' =>
"mw-prefsection-$key",
183 'content' =>
new OOUI\HtmlSnippet(
$content )
192 $indexLayout =
new OOUI\IndexLayout( [
195 'autoFocus' =>
false,
196 'classes' => [
'mw-prefs-tabs' ],
198 $indexLayout->addTabPanels( $tabPanels );
201 $form =
new OOUI\PanelLayout( [
204 'classes' => [
'mw-prefs-tabs-wrapper' ],
205 'content' => $indexLayout
218 $legend = parent::getLegend( $key );
219 $this->getHookRunner()->onPreferencesGetLegend( $this, $key, $legend );
228 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.