$modeName: the requested content model name
&$handler: set this to a ContentHandler object, if desired.
+'ContentModelCanBeUsedOn': Called to determine whether that content model can
+be used on a given page. This is especially useful to prevent some content models
+to be used in some special location.
+$contentModel: ID of the content model in question
+$title: the Title in question.
+&$ok: Output parameter, whether it is OK to use $contentModel on $title.
+Handler functions that modify $ok should generally return false to prevent further
+hooks from further modifying $ok.
+
'ConvertContent': Called by AbstractContent::convert when a conversion to another
content model is requested.
$content: The Content object to be converted.
'DiffRevisionTools': Override or extend the revision tools available from the
diff view, i.e. undo, etc.
-$rev: Revision object
+$newRev: Revision object of the "new" revision
&$links: Array of HTML links
+$oldRev: Revision object of the "old" revision (may be null)
'DiffViewHeader': Called before diff display
$diff: DifferenceEngine object that's calling
$key: the section name
&$legend: the legend text. Defaults to wfMessage( "prefs-$key" )->text() but may be overridden
+ 'PreferencesFormPreSave': Override preferences being saved
+ $formData: array of user submitted data
+ $form: PreferencesForm object, also a ContextSource
+ $user: User object with preferences to be saved set
+ &$result: boolean indicating success
+
'PrefixSearchBackend': Override the title prefix search used for OpenSearch and
AJAX search suggestions. Put results into &$results outparam and return false.
$ns : array of int namespace keys to search in
'label-raw' => $context->msg( 'stub-threshold' )->text(), // Raw HTML message. Yay?
);
- if ( $wgAllowUserCssPrefs ) {
- $defaultPreferences['showtoc'] = array(
- 'type' => 'toggle',
- 'section' => 'rendering/advancedrendering',
- 'label-message' => 'tog-showtoc',
- );
- }
$defaultPreferences['showhiddencats'] = array(
'type' => 'toggle',
'section' => 'rendering/advancedrendering',
'label-message' => 'tog-showhiddencats'
);
- if ( $wgAllowUserCssPrefs ) {
- $defaultPreferences['justify'] = array(
- 'type' => 'toggle',
- 'section' => 'rendering/advancedrendering',
- 'label-message' => 'tog-justify',
- );
- }
-
$defaultPreferences['numberheadings'] = array(
'type' => 'toggle',
'section' => 'rendering/advancedrendering',
global $wgAllowUserCssPrefs;
## Editing #####################################
- if ( $wgAllowUserCssPrefs ) {
- $defaultPreferences['editsection'] = array(
- 'type' => 'toggle',
- 'section' => 'editing/advancedediting',
- 'label-message' => 'tog-editsection',
- );
- }
$defaultPreferences['editsectiononrightclick'] = array(
'type' => 'toggle',
'section' => 'editing/advancedediting',
$user->setOption( $key, $value );
}
+ wfRunHooks( 'PreferencesFormPreSave', array( $formData, $form, $user, &$result ) );
$user->saveSettings();
}