API: fix copyright symbol, coding style cleanup, more braces
[lhc/web/wiklou.git] / includes / WatchlistEditor.php
index e49851b..e9e79ee 100644 (file)
@@ -143,8 +143,8 @@ class WatchlistEditor {
                        if( !$title instanceof Title )
                                $title = Title::newFromText( $title );
                        if( $title instanceof Title ) {
-                               $output->addHTML( "<li>" . $skin->makeLinkObj( $title )
-                               . ' (' . $skin->makeLinkObj( $title->getTalkPage(), $talk ) . ")</li>\n" );
+                               $output->addHTML( "<li>" . $skin->link( $title )
+                               . ' (' . $skin->link( $title->getTalkPage(), $talk ) . ")</li>\n" );
                        }
                }
                $output->addHTML( "</ul>\n" );
@@ -340,7 +340,7 @@ class WatchlistEditor {
                if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) {
                        $self = SpecialPage::getTitleFor( 'Watchlist' );
                        $form  = Xml::openElement( 'form', array( 'method' => 'post',
-                               'action' => $self->getLocalUrl( 'action=edit' ) ) );
+                               'action' => $self->getLocalUrl( array( 'action' => 'edit' ) ) ) );
                        $form .= Xml::hidden( 'token', $wgUser->editToken( 'watchlistedit' ) );
                        $form .= "<fieldset>\n<legend>" . wfMsgHtml( 'watchlistedit-normal-legend' ) . "</legend>";
                        $form .= wfMsgExt( 'watchlistedit-normal-explain', 'parse' );
@@ -407,19 +407,33 @@ class WatchlistEditor {
         * @return string
         */
        private function buildRemoveLine( $title, $redirect, $skin ) {
-               $link = $skin->makeLinkObj( $title );
+               global $wgLang;
+
+               $link = $skin->link( $title );
                if( $redirect )
                        $link = '<span class="watchlistredir">' . $link . '</span>';
-               $tools[] = $skin->makeLinkObj( $title->getTalkPage(), wfMsgHtml( 'talkpagelinktext' ) );
+               $tools[] = $skin->link( $title->getTalkPage(), wfMsgHtml( 'talkpagelinktext' ) );
                if( $title->exists() ) {
-                       $tools[] = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'history_short' ), 'action=history' );
+                       $tools[] = $skin->link(
+                               $title,
+                               wfMsgHtml( 'history_short' ),
+                               array(),
+                               array( 'action' => 'history' ),
+                               array( 'known', 'noclasses' )
+                       );
                }
                if( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
-                       $tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getText() ), wfMsgHtml( 'contributions' ) );
+                       $tools[] = $skin->link(
+                               SpecialPage::getTitleFor( 'Contributions', $title->getText() ),
+                               wfMsgHtml( 'contributions' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                }
                return "<li>"
                        . Xml::check( 'titles[]', false, array( 'value' => $title->getPrefixedText() ) )
-                       . $link . " (" . implode( ' | ', $tools ) . ")" . "</li>\n";
+                       . $link . " (" . $wgLang->pipeList( $tools ) . ")" . "</li>\n";
                }
 
        /**
@@ -433,7 +447,7 @@ class WatchlistEditor {
                $this->showItemCount( $output, $user );
                $self = SpecialPage::getTitleFor( 'Watchlist' );
                $form  = Xml::openElement( 'form', array( 'method' => 'post',
-                       'action' => $self->getLocalUrl( 'action=raw' ) ) );
+                       'action' => $self->getLocalUrl( array( 'action' => 'raw' ) ) ) );
                $form .= Xml::hidden( 'token', $wgUser->editToken( 'watchlistedit' ) );
                $form .= '<fieldset><legend>' . wfMsgHtml( 'watchlistedit-raw-legend' ) . '</legend>';
                $form .= wfMsgExt( 'watchlistedit-raw-explain', 'parse' );
@@ -480,11 +494,20 @@ class WatchlistEditor {
         * @return string
         */
        public static function buildTools( $skin ) {
+               global $wgLang;
+
                $tools = array();
                $modes = array( 'view' => false, 'edit' => 'edit', 'raw' => 'raw' );
                foreach( $modes as $mode => $subpage ) {
-                       $tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Watchlist', $subpage ), wfMsgHtml( "watchlisttools-{$mode}" ) );
+                       // can use messages 'watchlisttools-view', 'watchlisttools-edit', 'watchlisttools-raw'
+                       $tools[] = $skin->link(
+                               SpecialPage::getTitleFor( 'Watchlist', $subpage ),
+                               wfMsgHtml( "watchlisttools-{$mode}" ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                }
-               return implode( ' | ', $tools );
+               return $wgLang->pipeList( $tools );
        }
 }