Deprecated Title::userIsWatching(); use User::isWatched() instead.
[lhc/web/wiklou.git] / skins / CologneBlue.php
index 3e5bc0f..214d9bc 100644 (file)
@@ -2,6 +2,21 @@
 /**
  * Cologne Blue: A nicer-looking alternative to Standard.
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @todo document
  * @file
  * @ingroup Skins
@@ -32,19 +47,23 @@ class SkinCologneBlue extends SkinLegacy {
                if ( 2 == $qb ) { # Right
                        $rules[] = "/* @noflip */#quickbar { position: absolute; right: 4px; }";
                        $rules[] = "/* @noflip */#article { margin-left: 4px; margin-right: 148px; }";
+                       $rules[] = "/* @noflip */#footer { margin-right: 152px; }";
                } elseif ( 1 == $qb ) {
                        $rules[] = "/* @noflip */#quickbar { position: absolute; left: 4px; }";
                        $rules[] = "/* @noflip */#article { margin-left: 148px; margin-right: 4px; }";
+                       $rules[] = "/* @noflip */#footer { margin-left: 152px; }";
                } elseif ( 3 == $qb ) { # Floating left
                        $rules[] = "/* @noflip */#quickbar { position:absolute; left:4px }";
                        $rules[] = "/* @noflip */#topbar { margin-left: 148px }";
                        $rules[] = "/* @noflip */#article { margin-left:148px; margin-right: 4px; }";
                        $rules[] = "/* @noflip */body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto; bottom:4px;}"; # Hides from IE
+                       $rules[] = "/* @noflip */#footer { margin-left: 152px; }";
                } elseif ( 4 == $qb ) { # Floating right
                        $rules[] = "/* @noflip */#quickbar { position: fixed; right: 4px; }";
                        $rules[] = "/* @noflip */#topbar { margin-right: 148px }";
                        $rules[] = "/* @noflip */#article { margin-right: 148px; margin-left: 4px; }";
                        $rules[] = "/* @noflip */body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE
+                       $rules[] = "/* @noflip */#footer { margin-right: 152px; }";
                }
                $style = implode( "\n", $rules );
                $out->addInlineStyle( $style, 'flip' );
@@ -64,12 +83,12 @@ class CologneBlueTemplate extends LegacyTemplate {
                  '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>';
 
                $s .= '<td class="top" nowrap="nowrap">';
-               $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">';
+               $s .= '<a href="' . htmlspecialchars( $mainPageObj->getLocalURL() ) . '">';
                $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
 
                $s .= '</td><td class="top" id="top-syslinks" width="100%">';
                $s .= $this->sysLinks();
-               $s .= '</td></tr><tr><td class="top-linkcollection">';
+               $s .= '</td></tr><tr><td class="top-subheader">';
 
                $s .= '<font size="-1"><span id="sitesub">';
                $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
@@ -105,14 +124,10 @@ class CologneBlueTemplate extends LegacyTemplate {
                $s .= "\n<div id='footer'>";
                $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
 
-               $qb = $this->getSkin()->qbSetting();
-               if ( 1 == $qb || 3 == $qb ) { # Left
-                       $s .= $this->getQuickbarCompensator();
-               }
                $s .= '<td class="bottom">';
 
                $s .= $this->bottomLinks();
-               $s .= $this->getSkin()->getLang()->pipeList( array(
+               $s .= $this->getSkin()->getLanguage()->pipeList( array(
                        "\n<br />" . Linker::link(
                                Title::newMainPage(),
                                null,
@@ -127,12 +142,9 @@ class CologneBlueTemplate extends LegacyTemplate {
                $s .= "\n<br />" . $this->pageStats();
 
                $s .= '</td>';
-               if ( 2 == $qb ) { # Right
-                       $s .= $this->getQuickbarCompensator();
-               }
                $s .= "</tr></table>\n</div>\n</div>\n";
 
-               if ( 0 != $qb ) {
+               if ( $this->getSkin()->qbSetting() != 0 ) {
                        $s .= $this->quickBar();
                }
                return $s;
@@ -192,7 +204,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                        );
                }
 
-               return $this->getSkin()->getLang()->pipeList( $s );
+               return $this->getSkin()->getLanguage()->pipeList( $s );
        }
 
        /**
@@ -202,8 +214,6 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function quickBar(){
-               $tns = $this->getSkin()->getTitle()->getNamespace();
-
                $s = "\n<div id='quickbar'>";
 
                $sep = '<br />';
@@ -240,6 +250,8 @@ class CologneBlueTemplate extends LegacyTemplate {
                        $barnumber++;
                }
 
+               $user = $this->getSkin()->getUser();
+
                if ( $this->data['isarticle'] ) {
                        $s .= $this->menuHead( 'qbedit' );
                        $s .= '<strong>' . $this->editThisPage() . '</strong>';
@@ -252,13 +264,13 @@ class CologneBlueTemplate extends LegacyTemplate {
                        if( $this->data['loggedin'] ) {
                                $s .= $sep . $this->moveThisPage();
                        }
-                       if ( $this->getSkin()->getUser()->isAllowed( 'delete' ) ) {
+                       if ( $user->isAllowed( 'delete' ) ) {
                                $dtp = $this->deleteThisPage();
                                if ( $dtp != '' ) {
                                        $s .= $sep . $dtp;
                                }
                        }
-                       if ( $this->getSkin()->getUser()->isAllowed( 'protect' ) ) {
+                       if ( $user->isAllowed( 'protect' ) ) {
                                $ptp = $this->protectThisPage();
                                if ( $ptp != '' ) {
                                        $s .= $sep . $ptp;
@@ -281,8 +293,10 @@ class CologneBlueTemplate extends LegacyTemplate {
                                        . $sep . $this->whatLinksHere()
                                        . $sep . $this->watchPageLinksLink();
 
-                       if( $tns == NS_USER || $tns == NS_USER_TALK ) {
-                               $id = User::idFromName( $this->getSkin()->getTitle()->getText() );
+                       $title = $this->getSkin()->getTitle();
+                       $tns = $title->getNamespace();
+                       if ( $tns == NS_USER || $tns == NS_USER_TALK ) {
+                               $id = User::idFromName( $title->getText() );
                                if( $id != 0 ) {
                                        $s .= $sep . $this->userContribsLink();
                                        if( $this->getSkin()->showEmailUser( $id ) ) {
@@ -296,18 +310,18 @@ class CologneBlueTemplate extends LegacyTemplate {
                $s .= $this->menuHead( 'qbmyoptions' );
                if ( $this->data['loggedin'] ) {
                        $tl = Linker::link(
-                               $this->getSkin()->getUser()->getTalkPage(),
+                               $user->getTalkPage(),
                                wfMsg( 'mytalk' ),
                                array(),
                                array(),
                                array( 'known', 'noclasses' )
                        );
-                       if ( $this->getSkin()->getUser()->getNewtalk() ) {
+                       if ( $user->getNewtalk() ) {
                                $tl .= ' *';
                        }
 
                        $s .= Linker::link(
-                                       $this->getSkin()->getUser()->getUserPage(),
+                                       $user->getUserPage(),
                                        wfMsg( 'mypage' ),
                                        array(),
                                        array(),
@@ -315,7 +329,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                                ) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' )
                                        . $sep .
                                Linker::link(
-                                       SpecialPage::getSafeTitleFor( 'Contributions', $this->getSkin()->getUser()->getName() ),
+                                       SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ),
                                        wfMsg( 'mycontris' ),
                                        array(),
                                        array(),
@@ -330,7 +344,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                        . Linker::specialLink( 'Newpages' )
                        . $sep . Linker::specialLink( 'Listfiles' )
                        . $sep . Linker::specialLink( 'Statistics' );
-               if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) {
+               if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) {
                        $s .= $sep . $this->getUploadLink();
                }