summaryrefslogtreecommitdiff
path: root/includes/SpecialPreferences.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-05-16 20:58:53 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-05-16 20:58:53 +0000
commitcecb985bee3bdd252e1b8dc0bd500b37cd52be01 (patch)
tree17266aa237742640aabee7856f0202317a45d540 /includes/SpecialPreferences.php
parent0bac06c301f2a83edb0236e4c2434da16848d549 (diff)
Aktualisierung auf MediaWiki 1.10.0
Plugins angepasst und verbessert kleine Korrekturen am Design
Diffstat (limited to 'includes/SpecialPreferences.php')
-rw-r--r--includes/SpecialPreferences.php49
1 files changed, 31 insertions, 18 deletions
diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php
index 643932c4..5ca818cd 100644
--- a/includes/SpecialPreferences.php
+++ b/includes/SpecialPreferences.php
@@ -1,8 +1,7 @@
<?php
/**
* Hold things related to displaying and saving user preferences.
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
*/
/**
@@ -18,14 +17,13 @@ function wfSpecialPreferences() {
/**
* Preferences form handling
* This object will show the preferences form and can save it as well.
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
*/
class PreferencesForm {
var $mQuickbar, $mOldpass, $mNewpass, $mRetypePass, $mStubs;
var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick;
var $mUserLanguage, $mUserVariant;
- var $mSearch, $mRecent, $mHourDiff, $mSearchLines, $mSearchChars, $mAction;
+ var $mSearch, $mRecent, $mRecentDays, $mHourDiff, $mSearchLines, $mSearchChars, $mAction;
var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize;
var $mUnderline, $mWatchlistEdits;
@@ -54,6 +52,7 @@ class PreferencesForm {
$this->mUserVariant = $request->getVal( 'wpUserVariant' );
$this->mSearch = $request->getVal( 'wpSearch' );
$this->mRecent = $request->getVal( 'wpRecent' );
+ $this->mRecentDays = $request->getVal( 'wpRecentDays' );
$this->mHourDiff = $request->getVal( 'wpHourDiff' );
$this->mSearchLines = $request->getVal( 'wpSearchLines' );
$this->mSearchChars = $request->getVal( 'wpSearchChars' );
@@ -170,7 +169,7 @@ class PreferencesForm {
/**
* Used to validate the user inputed timezone before saving it as
- * 'timeciorrection', will return '00:00' if fed bogus data.
+ * 'timecorrection', will return '00:00' if fed bogus data.
* Note: It's not a 100% correct implementation timezone-wise, it will
* accept stuff like '14:30',
* @access private
@@ -263,6 +262,7 @@ class PreferencesForm {
$wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) );
$wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars ) );
$wgUser->setOption( 'rclimit', $this->validateIntOrNull( $this->mRecent ) );
+ $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, 7 ) );
$wgUser->setOption( 'wllimit', $this->validateIntOrNull( $this->mWatchlistEdits, 0, 1000 ) );
$wgUser->setOption( 'rows', $this->validateInt( $this->mRows, 4, 1000 ) );
$wgUser->setOption( 'cols', $this->validateInt( $this->mCols, 4, 1000 ) );
@@ -365,6 +365,7 @@ class PreferencesForm {
$this->mImageSize = $wgUser->getOption( 'imagesize' );
$this->mThumbSize = $wgUser->getOption( 'thumbsize' );
$this->mRecent = $wgUser->getOption( 'rclimit' );
+ $this->mRecentDays = $wgUser->getOption( 'rcdays' );
$this->mWatchlistEdits = $wgUser->getOption( 'wllimit' );
$this->mUnderline = $wgUser->getOption( 'underline' );
$this->mWatchlistDays = $wgUser->getOption( 'watchlistdays' );
@@ -838,7 +839,7 @@ class PreferencesForm {
# Editing
#
- global $wgLivePreview, $wgUseRCPatrol;
+ global $wgLivePreview;
$wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'textboxsize' ) . '</legend>
<div>' .
wfInputLabel( wfMsg( 'rows' ), 'wpRows', 'wpRows', 3, $this->mRows ) .
@@ -861,15 +862,27 @@ class PreferencesForm {
) ) . '</fieldset>'
);
- $wgOut->addHTML( '<fieldset><legend>' . htmlspecialchars(wfMsg('prefs-rc')) . '</legend>' .
- wfInputLabel( wfMsg( 'recentchangescount' ),
- 'wpRecent', 'wpRecent', 3, $this->mRecent ) .
- $this->getToggles( array(
- 'hideminor',
- $wgRCShowWatchingUsers ? 'shownumberswatching' : false,
- 'usenewrc' )
- ) . '</fieldset>'
- );
+ # Recent changes
+ $wgOut->addHtml( '<fieldset><legend>' . wfMsgHtml( 'prefs-rc' ) . '</legend>' );
+
+ $rc = '<table><tr>';
+ $rc .= '<td>' . Xml::label( wfMsg( 'recentchangesdays' ), 'wpRecentDays' ) . '</td>';
+ $rc .= '<td>' . Xml::input( 'wpRecentDays', 3, $this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . '</td>';
+ $rc .= '</tr><tr>';
+ $rc .= '<td>' . Xml::label( wfMsg( 'recentchangescount' ), 'wpRecent' ) . '</td>';
+ $rc .= '<td>' . Xml::input( 'wpRecent', 3, $this->mRecent, array( 'id' => 'wpRecent' ) ) . '</td>';
+ $rc .= '</tr></table>';
+ $wgOut->addHtml( $rc );
+
+ $wgOut->addHtml( '<br />' );
+
+ $toggles[] = 'hideminor';
+ if( $wgRCShowWatchingUsers )
+ $toggles[] = 'shownumberswatching';
+ $toggles[] = 'usenewrc';
+ $wgOut->addHtml( $this->getToggles( $toggles ) );
+
+ $wgOut->addHtml( '</fieldset>' );
# Watchlist
$wgOut->addHtml( '<fieldset><legend>' . wfMsgHtml( 'prefs-watchlist' ) . '</legend>' );
@@ -941,11 +954,11 @@ class PreferencesForm {
$wgOut->addHTML( '</fieldset>' );
$token = $wgUser->editToken();
+ $skin = $wgUser->getSkin();
$wgOut->addHTML( "
<div id='prefsubmit'>
<div>
- <input type='submit' name='wpSaveprefs' class='btnSavePrefs' value=\"" . wfMsgHtml( 'saveprefs' ) . "\" accesskey=\"".
- wfMsgHtml('accesskey-save')."\" title=\"".wfMsgHtml('tooltip-save')."\" />
+ <input type='submit' name='wpSaveprefs' class='btnSavePrefs' value=\"" . wfMsgHtml( 'saveprefs' ) . '"'.$skin->tooltipAndAccesskey('save')." />
<input type='submit' name='wpReset' value=\"" . wfMsgHtml( 'resetprefs' ) . "\" />
</div>