Made very important preview message more obvious
[lhc/web/wiklou.git] / includes / EditPage.php
index 88100c2..b233bb9 100644 (file)
@@ -295,6 +295,7 @@ class EditPage {
         * @todo document
         */
        function importFormData( &$request ) {
+               global $wgLang ;
                $fname = 'EditPage::importFormData';
                wfProfileIn( $fname );
 
@@ -305,7 +306,8 @@ class EditPage {
                        $this->textbox1 = $this->safeUnicodeInput( $request, 'wpTextbox1' );
                        $this->textbox2 = $this->safeUnicodeInput( $request, 'wpTextbox2' );
                        $this->mMetaData = rtrim( $request->getText( 'metadata'   ) );
-                       $this->summary   =        $request->getText( 'wpSummary'  );
+                       # Truncate for whole multibyte characters. +5 bytes for ellipsis
+                       $this->summary   = $wgLang->truncate( $request->getText( 'wpSummary'  ), 250 );
 
                        $this->edittime = $request->getVal( 'wpEdittime' );
                        $this->starttime = $request->getVal( 'wpStarttime' );
@@ -979,7 +981,7 @@ END
                wfProfileIn( $fname );
 
                $previewhead = '<h2>' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>\n" .
-                       "<p class='previewnote'>" . htmlspecialchars( wfMsg( 'previewnote' ) ) . "</p>\n";
+                       "<p class='previewnote'><strong>" . htmlspecialchars( wfMsg( 'previewnote' ) ) . "</strong></p>\n";
                if ( $this->isConflict ) {
                        $previewhead.='<h2>' . htmlspecialchars( wfMsg( 'previewconflict' ) ) .
                                "</h2>\n";
@@ -1315,13 +1317,15 @@ END
         * @return string HTML
         */
        function getDiff() {
+               global $wgUser;
+
                require_once( 'DifferenceEngine.php' );
                $oldtext = $this->mArticle->fetchContent();
                $newtext = $this->mArticle->replaceSection(
                        $this->section, $this->textbox1, $this->summary, $this->edittime );
                $oldtitle = wfMsg( 'currentrev' );
                $newtitle = wfMsg( 'yourtext' );
-               if ( $oldtext != wfMsg( 'noarticletext' ) || $newtext != '' ) {
+               if ( $oldtext != wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) || $newtext != '' ) {
                        $difftext = DifferenceEngine::getDiff( $oldtext, $newtext, $oldtitle, $newtitle );
                }