Index: trunk/extensions/DPLforum/DPLforum_body.php |
— | — | @@ -60,6 +60,8 @@ |
61 | 61 | var $sInput; |
62 | 62 | var $sOmit; |
63 | 63 | var $vMarkNew; |
| 64 | + var $sCreationDateFormat; |
| 65 | + var $sLastEditFormat; |
64 | 66 | |
65 | 67 | function cat( &$parser, $name ) { |
66 | 68 | $cats = array(); |
— | — | @@ -141,6 +143,16 @@ |
142 | 144 | return htmlspecialchars( wfMsg( $type ) ); |
143 | 145 | } |
144 | 146 | |
| 147 | + function date( $ts, $type = 'date', $df = false ) { // based on Language::date() |
| 148 | + global $wgLang; |
| 149 | + $ts = wfTimestamp( TS_MW, $ts ); |
| 150 | + $ts = $wgLang->userAdjust( $ts ); |
| 151 | + if ( $df === false ) { |
| 152 | + $df = $wgLang->getDateFormatString( $type, $wgLang->dateFormat( true ) ); |
| 153 | + } |
| 154 | + return $wgLang->sprintfDate( $df, $ts ); |
| 155 | + } |
| 156 | + |
145 | 157 | function parse( &$input, &$parser ) { |
146 | 158 | global $wgContLang; |
147 | 159 | |
— | — | @@ -150,8 +162,10 @@ |
151 | 163 | $this->bAddAuthor = ( $this->get( 'addauthor' ) == 'true' ); |
152 | 164 | $this->bTimestamp = ( $this->get( 'timestamp' ) != 'false' ); |
153 | 165 | $this->bAddLastEdit = ( $this->get( 'addlastedit' ) != 'false' ); |
| 166 | + $this->sLastEditFormat = $this->get( 'lasteditformat', false ); |
154 | 167 | $this->bAddLastEditor = ( $this->get( 'addlasteditor' ) == 'true' ); |
155 | 168 | $this->bAddCreationDate = ( $this->get( 'addcreationdate' ) == 'true' ); |
| 169 | + $this->sCreationDateFormat = $this->get( 'creationdateformat', false ); |
156 | 170 | |
157 | 171 | switch( $this->get( 'historylink' ) ) { |
158 | 172 | case 'embed': |
— | — | @@ -374,7 +388,7 @@ |
375 | 389 | |
376 | 390 | // Generates a single line of output. |
377 | 391 | function buildOutput( $page, $title, $time, $user = '', $author = '', $made = '' ) { |
378 | | - global $wgLang, $wgUser; |
| 392 | + global $wgUser; |
379 | 393 | |
380 | 394 | $sk = $wgUser->getSkin(); |
381 | 395 | $tm =& $this->bTableMode; |
— | — | @@ -382,7 +396,7 @@ |
383 | 397 | |
384 | 398 | if ( $this->bAddCreationDate ) { |
385 | 399 | if ( is_numeric( $made ) ) { |
386 | | - $made = $wgLang->date( $made, true ); |
| 400 | + $made = $this->date( $made, 'date', $this->sCreationDateFormat ); |
387 | 401 | } |
388 | 402 | |
389 | 403 | if ( $page && $this->bLinkHistory && !$this->bAddLastEdit ) { |
— | — | @@ -456,7 +470,7 @@ |
457 | 471 | |
458 | 472 | if ( $this->bAddLastEdit ) { |
459 | 473 | if ( is_numeric( $time ) ) { |
460 | | - $time = $wgLang->timeanddate( $time, true ); |
| 474 | + $time = $this->date( $time, 'both', $this->sLastEditFormat ); |
461 | 475 | } |
462 | 476 | |
463 | 477 | if ( $page && $this->bLinkHistory ) { |