$imagePage: ImagePage object ($this)
$output: $wgOut
+'InitPreferencesForm': called at the end of PreferencesForm's constructor
+$form: the PreferencesForm
+$request: the web request to initialized from
+
'InternalParseBeforeLinks': during Parser's internalParse method before links but
after noinclude/includeonly/onlyinclude and other processing.
&$this: Parser object
&$obj: RawPage object
&$text: The text that's going to be the output
+'RenderPreferencesForm': called at the end of PreferencesForm::mainPrefsForm
+$form: the PreferencesForm
+$out: output page to render to, probably $wgOut
+
+'ResetPreferences': called at the end of PreferencesForm::resetPrefs
+$form: the PreferencesForm
+$user: the User object to load preferences from
+
+'SavePreferences': called at the end of PreferencesForm::savePreferences;
+ returning false prevents the preferences from being saved.
+$form: the PreferencesForm
+$user: the User object to save preferences to
+$message: change this to set an error message (ignored if the hook does notreturn fals)
+
'SearchUpdate': Prior to search update completion
$id : Page id
$namespace : Page namespace
if ( !preg_match( '/^[a-z\-]*$/', $this->mUserLanguage ) ) {
$this->mUserLanguage = 'nolanguage';
}
+
+ wfRunHooks( "InitPreferencesForm", array( $this, $request ) );
}
function execute() {
$wgUser->setOption( $tname, $tvalue );
}
if (!$wgAuth->updateExternalDB($wgUser)) {
- $this->mainPrefsForm( wfMsg( 'externaldberror' ) );
+ $this->mainPrefsForm( 'error', wfMsg( 'externaldberror' ) );
+ return;
+ }
+
+ $msg = '';
+ if ( !wfRunHooks( "SavePreferences", array( $this, $wgUser, &$msg ) ) ) {
+ print "(($msg))";
+ $this->mainPrefsForm( 'error', $msg );
return;
}
+
$wgUser->setCookies();
$wgUser->saveSettings();
$this->mSearchNs[$i] = $wgUser->getOption( 'searchNs'.$i );
}
}
+
+ wfRunHooks( "ResetPreferences", array( $this, $wgUser ) );
}
/**
}
$wgOut->addHTML( '</fieldset>' );
+ wfRunHooks( "RenderPreferencesForm", array( $this, $wgOut ) );
+
$token = htmlspecialchars( $wgUser->editToken() );
$skin = $wgUser->getSkin();
$wgOut->addHTML( "