From: Tim Starling Date: Tue, 1 Jul 2003 12:47:44 +0000 (+0000) Subject: Dynamic dates X-Git-Tag: 1.1.0~463 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=8249ea81bb3f0db4835076ed64907d96239d9eca;p=lhc%2Fweb%2Fwiklou.git Dynamic dates --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 598bdcde28..a4c8e3abec 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -649,9 +649,9 @@ class OutputPage { # function doWikiPass2( $text, $linestart ) { - global $wgUser; + global $wgUser, $wgLang; wfProfileIn( "OutputPage::doWikiPass2" ); - + $text = $this->removeHTMLtags( $text ); $text = $this->replaceVariables( $text ); @@ -661,7 +661,8 @@ class OutputPage { $text = $this->doQuotes( $text ); $text = $this->doHeadings( $text ); $text = $this->doBlockLevels( $text, $linestart ); - + + $text = $wgLang->replaceDates( $text ); $text = $this->replaceExternalLinks( $text ); $text = $this->replaceInternalLinks ( $text ); @@ -709,7 +710,7 @@ class OutputPage { wfProfileOut(); return $text; } - + /* private */ function subReplaceExternalLinks( $s, $protocol, $autonumber ) { global $wgUser, $printable; diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 18117a3e15..c7354473d4 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -62,7 +62,7 @@ function wfSpecialPreferences() { global $wgUser, $wgLang, $wgDeferredUpdateList; global $wpQuickbar, $wpOldpass, $wpNewpass, $wpRetype; - global $wpSkin, $wpMath, $wpEmail, $wpEmailFlag, $wpNick, $wpSearch, $wpRecent; + global $wpSkin, $wpMath, $wpDate, $wpEmail, $wpEmailFlag, $wpNick, $wpSearch, $wpRecent; global $wpSearchLines, $wpSearchChars, $wpStubs; global $wpRows, $wpCols, $wpHourDiff, $HTTP_POST_VARS; global $wpNs0, $wpNs1, $wpNs2, $wpNs3, $wpNs4, $wpNs5, $wpNs6, $wpNs7; @@ -86,6 +86,7 @@ function wfSpecialPreferences() $wgUser->setOption( "quickbar", $wpQuickbar ); $wgUser->setOption( "skin", $wpSkin ); $wgUser->setOption( "math", $wpMath ); + $wgUser->setOption( "date", $wpDate ); $wgUser->setOption( "searchlimit", validateIntOrNull( $wpSearch ) ); $wgUser->setOption( "contextlines", validateIntOrNull( $wpSearchLines ) ); $wgUser->setOption( "contextchars", validateIntOrNull( $wpSearchChars ) ); @@ -125,7 +126,7 @@ function wfSpecialPreferences() { global $wgUser, $wgLang; global $wpQuickbar, $wpOldpass, $wpNewpass, $wpRetype, $wpStubs; - global $wpRows, $wpCols, $wpSkin, $wpMath, $wpEmail, $wpEmailFlag, $wpNick; + global $wpRows, $wpCols, $wpSkin, $wpMath, $wpDate, $wpEmail, $wpEmailFlag, $wpNick; global $wpSearch, $wpRecent, $HTTP_POST_VARS; global $wpHourDiff, $wpSearchLines, $wpSearchChars; @@ -138,6 +139,7 @@ function wfSpecialPreferences() $wpQuickbar = $wgUser->getOption( "quickbar" ); $wpSkin = $wgUser->getOption( "skin" ); $wpMath = $wgUser->getOption( "math" ); + $wpDate = $wgUser->getOption( "date" ); $wpRows = $wgUser->getOption( "rows" ); $wpCols = $wgUser->getOption( "cols" ); $wpStubs = $wgUser->getOption( "stubthreshold" ); @@ -196,7 +198,7 @@ function wfSpecialPreferences() { global $wgUser, $wgOut, $wgLang; global $wpQuickbar, $wpOldpass, $wpNewpass, $wpRetype; - global $wpSkin, $wpMath, $wpEmail, $wpEmailFlag, $wpNick, $wpSearch, $wpRecent; + global $wpSkin, $wpMath, $wpDate, $wpEmail, $wpEmailFlag, $wpNick, $wpSearch, $wpRecent; global $wpRows, $wpCols, $wpSaveprefs, $wpReset, $wpHourDiff; global $wpSearchLines, $wpSearchChars, $wpStubs; @@ -215,6 +217,7 @@ function wfSpecialPreferences() $qbs = $wgLang->getQuickbarSettings(); $skins = $wgLang->getSkinNames(); $mathopts = $wgLang->getMathNames(); + $dateopts = $wgLang->getDateFormats(); $togs = $wgLang->getUserToggles(); $action = wfLocalUrlE( $wgLang->specialPage( "Preferences" ), @@ -223,6 +226,7 @@ function wfSpecialPreferences() $cp = wfMsg( "changepassword" ); $sk = wfMsg( "skin" ); $math = wfMsg( "math" ); + $dateFormat = wfMsg("dateformat"); $opw = wfMsg( "oldpassword" ); $npw = wfMsg( "newpassword" ); $rpw = wfMsg( "retypenew" ); @@ -283,7 +287,7 @@ value=\"$i\"$checked> {$skins[$i]}
\n" ); # Various checkbox options # - $wgOut->addHTML( "\n" ); + $wgOut->addHTML( "\n" ); foreach ( $togs as $tname => $ttext ) { if ( 1 == $wgUser->getOption( $tname ) ) { $checked = " checked"; @@ -304,9 +308,20 @@ value=\"$i\"$checked> {$skins[$i]}
\n" ); $wgOut->addHTML( "
\n" ); } - - $wgOut->addHTML( "" ); - + $wgOut->addHTML( "" ); + + # Date format + # + $wgOut->addHTML( "$dateFormat:
" ); + for ( $i = 0; $i < count( $dateopts ); ++$i) { + if ( $i == $wpDate ) { + $checked = " checked"; + } else { + $checked = ""; + } + $wgOut->addHTML( " {$dateopts[$i]}
\n" ); + } + $wgOut->addHTML( ""); # Textbox rows, cols # $nowlocal = $wgLang->time( $now = wfTimestampNow(), true );