);
# Whether to use user or default setting in Language::date()
-define( 'MW_DATE_USER_FORMAT', true );
/* private */ $wgDateFormatsEn = array(
'Default',
'tog-highlightbroken' => 'Format broken links <a href="" class="new">like this</a> (alternative: like this<a href="" class="internal">?</a>).',
'tog-justify' => 'Justify paragraphs',
'tog-hideminor' => 'Hide minor edits in recent changes',
-'tog-usenewrc' => 'Enhanced recent changes (not for all browsers)',
+'tog-usenewrc' => 'Enhanced recent changes (JavaScript)',
'tog-numberheadings' => 'Auto-number headings',
'tog-showtoolbar' => 'Show edit toolbar (JavaScript)',
'tog-editondblclick' => 'Edit pages on double click (JavaScript)',
'updatedmarker' => '<span class=\'updatedmarker\'> updated (since my last visit) </span>',
'email_notification_mailer' => '{{SITENAME}} Notification Mailer',
-'email_notification_infotext' => "'''Email notification is on.'''
+'email_notification_infotext' => "Email notification is on.
You will be notified by email when someone changes a page which is listed in your watchlist.",
'email_notification_reset' => 'Reset all notification flags (set their status to "visited")',
'email_notification_newpagetext'=> 'This is a new page.',
*/
function dateFormat( $format ) {
global $wgUser;
-
- if ( MW_DATE_USER_FORMAT === true) {
- // Some files, such as Parser.php want us to return the
- // default format no matter what, obey them!
- if ($format === false) {
- return false; // Pass it along..
- } elseif ( $wgUser->isLoggedIn() ) {
- return $wgUser->getOption( 'date' );
- } else {
- return '0';
- }
- } else {
+
+ if ( !$wgUser->isLoggedIn() || $format === false ) {
$options = $this->getDefaultUserOptions();
return $options['date'];
+ } else {
+ return $wgUser->getOption( 'date' );
}
}
$month = $this->getMonthName( substr( $ts, 4, 2 ) );
$day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );
- $year = $this->formatNum( substr( $ts, 0, 4 ) );
+ $year = $this->formatNum( substr( $ts, 0, 4 ), true );
switch( $datePreference ) {
case '2': return "$day $month $year";
}
}
- function rfc1123( $ts ) {
- return date( 'D, d M Y H:i:s T', $ts );
- }
-
function getValidSpecialPages() {
global $wgValidSpecialPagesEn;
return $wgValidSpecialPagesEn;
* @access public
* @param mixed $number the string to be formatted, should be an integer or
* a floating point number.
+ * @param bool $year are we being passed a year? (turns off commafication)
+ * @return mixed whatever we're fed if it's a year, a string otherwise.
*/
- function formatNum( $number ) {
- return $this->commafy($number);
+ function formatNum( $number, $year = false ) {
+ return $year ? $number : $this->commafy($number);
}
/**
function commafy($_) {
return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
}
-
+
+ /**
+ * For the credit list in includes/Credits.php (action=credits)
+ *
+ * @param array $l
+ * @return string
+ */
function listToText( $l ) {
$s = '';
$m = count($l) - 1;
}
}
- # Grammatical transformations, needed for inflected languages
- # Invoked by putting {{grammar:case|word}} in a message
+ /**
+ * Grammatical transformations, needed for inflected languages
+ * Invoked by putting {{grammar:case|word}} in a message
+ *
+ * @param string $word
+ * @param string $case
+ * @return string
+ */
function convertGrammar( $word, $case ) {
return $word;
}
- # languages like Chinese need to be segmented in order for the diff
- # to be of any use
+ /**
+ * languages like Chinese need to be segmented in order for the diff
+ * to be of any use
+ *
+ * @param string $text
+ * @return string
+ */
function segmentForDiff( $text ) {
return $text;
}
- # and unsegment to show the result
+
+ /**
+ * and unsegment to show the result
+ *
+ * @param string $text
+ * @return string
+ */
function unsegmentForDiff( $text ) {
return $text;
}