Postgres: make sure ar_len is added when updating, alpha stuff in updaters.inc
[lhc/web/wiklou.git] / includes / SpecialWatchlist.php
index 92ee4d6..2e660bd 100644 (file)
@@ -7,7 +7,7 @@
 /**
  *
  */
-require_once( 'SpecialRecentchanges.php' );
+require_once( dirname(__FILE__) . '/SpecialRecentchanges.php' );
 
 /**
  * Constructor
@@ -85,22 +85,22 @@ function wfSpecialWatchlist( $par ) {
         # Deleting items from watchlist
        if(($action == 'submit') && isset($remove) && is_array($id)) {
                $wgOut->addWikiText( wfMsg( 'removingchecked' ) );
-               $wgOut->addHTML( '<p>' );
+               $wgOut->addHTML( "<ul id=\"mw-unwatch-list\">\n" );
                foreach($id as $one) {
                        $t = Title::newFromURL( $one );
                        if( !is_null( $t ) ) {
                                $wl = WatchedItem::fromUserTitle( $wgUser, $t );
                                if( $wl->removeWatch() === false ) {
-                                       $wgOut->addHTML( wfMsg( 'couldntremove', htmlspecialchars($one) ) . "<br />\n" );
+                                       $wgOut->addHTML( '<li class="mw-unwatch-failure">' . wfMsg( 'couldntremove', htmlspecialchars($one) ) . "</li>\n" );
                                } else {
                                        wfRunHooks('UnwatchArticle', array(&$wgUser, new Article($t)));
-                                       $wgOut->addHTML( '(' . htmlspecialchars($one) . ')<br />' );
+                                       $wgOut->addHTML( '<li class="mw-unwatch-success">[[' . htmlspecialchars($one) . "]]</li>\n" );
                                }
                        } else {
-                               $wgOut->addHTML( wfMsg( 'iteminvalidname', htmlspecialchars($one) ) . "<br />\n" );
+                               $wgOut->addHTML( '<li class="mw-unwatch-invalid">' . wfMsg( 'iteminvalidname', htmlspecialchars($one) ) . "</li>\n" );
                        }
                }
-               $wgOut->addHTML( "</p>\n<p>" . wfMsg( 'wldone' ) . "</p>\n" );
+               $wgOut->addHTML( "</ul>\n<p>" . wfMsg( 'wldone' ) . "</p>\n" );
        }
 
        $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
@@ -157,7 +157,7 @@ function wfSpecialWatchlist( $par ) {
 
        /* Edit watchlist form */
        if($wgRequest->getBool('edit') || $par == 'edit' ) {
-               $wgOut->addWikiText( wfMsg( 'watchlistcontains', $wgLang->formatNum( $nitems ) ) .
+               $wgOut->addWikiText( wfMsgExt( 'watchlistcontains', array( 'parseinline' ), $wgLang->formatNum( $nitems ) ) .
                        "\n\n" . wfMsg( 'watcheditlist' ) );
 
                $wgOut->addHTML( '<form action=\'' .
@@ -257,7 +257,8 @@ function wfSpecialWatchlist( $par ) {
                $andLatest='';
                $limitWatchlist = 'LIMIT ' . intval( $wgUser->getOption( 'wllimit' ) );
        } else {
-               $andLatest= 'AND rc_this_oldid=page_latest';
+       # Top log Ids for a page are not stored
+               $andLatest= 'AND (rc_this_oldid=page_latest OR rc_type=' . RC_LOG . ') ';
                $limitWatchlist = '';
        }
 
@@ -298,10 +299,10 @@ function wfSpecialWatchlist( $par ) {
        $wgOut->addHTML( "<hr />\n" );
 
        if($days >= 1) {
-               $wgOut->addWikiText( wfMsg( 'rcnote', $wgLang->formatNum( $numRows ),
+               $wgOut->addWikiText( wfMsgExt( 'rcnote', array( 'parseinline' ), $wgLang->formatNum( $numRows ),
                        $wgLang->formatNum( $days ), $wgLang->timeAndDate( wfTimestampNow(), true ) ) . '<br />' , false );
        } elseif($days > 0) {
-               $wgOut->addWikiText( wfMsg( 'wlnote', $wgLang->formatNum( $numRows ),
+               $wgOut->addWikiText( wfMsgExt( 'wlnote', array( 'parseinline' ), $wgLang->formatNum( $numRows ),
                        $wgLang->formatNum( round($days*24) ) ) . '<br />' , false );
        }