f-prot isn't so open now, so might aswell not advertise it in DefaultSetttings under...
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 8306304..4028e78 100644 (file)
@@ -258,7 +258,7 @@ class SkinTemplate extends Skin {
                /* XXX currently unused, might get useful later
                $tpl->set( 'editable', ( !$title->isSpecialPage() ) );
                $tpl->set( 'exists', $title->getArticleID() != 0 );
-               $tpl->set( 'watch', $title->userIsWatching() ? 'unwatch' : 'watch' );
+               $tpl->set( 'watch', $user->isWatched( $title ) ? 'unwatch' : 'watch' );
                $tpl->set( 'protect', count( $title->isProtected() ) ? 'unprotect' : 'protect' );
                $tpl->set( 'helppage', $this->msg( 'helppage' )->text() );
                */
@@ -426,10 +426,15 @@ class SkinTemplate extends Skin {
                                unset( $tmp );
                                $nt = Title::newFromText( $l );
                                if ( $nt ) {
+                                       $ilLangName = Language::fetchLanguageName( $nt->getInterwiki() );
+                                       if ( strval( $ilLangName ) === '' ) {
+                                               $ilLangName = $l;
+                                       } else {
+                                               $ilLangName = $this->getLanguage()->ucfirst( $ilLangName );
+                                       }
                                        $language_urls[] = array(
                                                'href' => $nt->getFullURL(),
-                                               'text' => ( Language::fetchLanguageName( $nt->getInterwiki() ) != '' ?
-                                                                       Language::fetchLanguageName( $nt->getInterwiki() ) : $l ),
+                                               'text' => $ilLangName,
                                                'title' => $nt->getText(),
                                                'class' => $class,
                                                'lang' => $nt->getInterwiki(),
@@ -969,7 +974,7 @@ class SkinTemplate extends Skin {
                                         * a change to that procedure these messages will have to remain as
                                         * the global versions.
                                         */
-                                       $mode = $title->userIsWatching() ? 'unwatch' : 'watch';
+                                       $mode = $user->isWatched( $title ) ? 'unwatch' : 'watch';
                                        $token = WatchAction::getWatchToken( $title, $user, $mode );
                                        $content_navigation['actions'][$mode] = array(
                                                'class' => $onPage && ( $action == 'watch' || $action == 'unwatch' ) ? 'selected' : false,