useless call
[lhc/web/wiklou.git] / includes / SpecialPreferences.php
index 838e43e..ebbb6da 100644 (file)
@@ -435,9 +435,9 @@ class PreferencesForm {
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
                if ( $this->mSuccess || 'success' == $status ) {
-                       $wgOut->addWikitext( '<div class="preferences-save-success"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
+                       $wgOut->addWikitext( '<div class="successbox"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
                } else  if ( 'error' == $status ) {
-                       $wgOut->addWikitext( '<div class="error"><strong>' . $message  . '</strong></div>' );
+                       $wgOut->addWikitext( '<div class="errorbox"><strong>' . $message  . '</strong></div>' );
                } else if ( '' != $status ) {
                        $wgOut->addWikitext( $message . "\n----" );
                }
@@ -463,6 +463,7 @@ class PreferencesForm {
                # <FIXME>
                $this->mUserEmail = htmlspecialchars( $this->mUserEmail );
                $this->mRealName = htmlspecialchars( $this->mRealName );
+               $rawNick = $this->mNick;
                $this->mNick = htmlspecialchars( $this->mNick );
                if ( !$this->mEmailFlag ) { $emfc = 'checked="checked"'; }
                else { $emfc = ''; }
@@ -539,11 +540,23 @@ class PreferencesForm {
                        );
                }
 
+               global $wgParser;
+               if( !empty( $this->mToggles['fancysig'] ) &&
+                       false === $wgParser->validateSig( $rawNick ) ) {
+                       $invalidSig = $this->addRow(
+                               '&nbsp;',
+                               '<span class="error">' . wfMsgHtml( 'badsig' ) . '<span>'
+                       );
+               } else {
+                       $invalidSig = '';
+               }
+               
                $wgOut->addHTML(
                        $this->addRow(
                                '<label for="wpNick">' . wfMsg( 'yournick' ) . '</label>',
                                "<input type='text' name='wpNick' id='wpNick' value=\"{$this->mNick}\" size='25' />"
                        ) .
+                       $invalidSig .
                        # FIXME: The <input> part should be where the &nbsp; is, getToggle() needs
                        # to be changed to out return its output in two parts. -ævar
                        $this->addRow(
@@ -745,10 +758,16 @@ class PreferencesForm {
                if ($dateopts) {
                        $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg( 'dateformat' ) . "</legend>\n" );
                        $idCnt = 0;
+                       $epoch = '20010115161234';
                        foreach($dateopts as $key => $option) {
+                               if( $key == MW_DATE_DEFAULT ) {
+                                       $formatted = wfMsgHtml( 'datedefault' );
+                               } else {
+                                       $formatted = htmlspecialchars( $wgLang->timeanddate( $epoch, false, $key ) );
+                               }
                                ($key == $this->mDate) ? $checked = ' checked="checked"' : $checked = '';
                                $wgOut->addHTML( "<div><input type='radio' name=\"wpDate\" id=\"wpDate$idCnt\" ".
-                                       "value=\"$key\"$checked /> <label for=\"wpDate$idCnt\">$option</label></div>\n" );
+                                       "value=\"$key\"$checked /> <label for=\"wpDate$idCnt\">$formatted</label></div>\n" );
                                $idCnt++;
                        }
                        $wgOut->addHTML( "</fieldset>\n" );