In LockServerDaemon:
[lhc/web/wiklou.git] / skins / CologneBlue.php
index 66255ad..c5b3b11 100644 (file)
@@ -32,22 +32,26 @@ 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 css if RTL */true );
+               $out->addInlineStyle( $style, 'flip' );
        }
 
 }
@@ -64,12 +68,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>';
@@ -77,10 +81,9 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= '<font size="-1"><span id="langlinks">';
                $s .= str_replace( '<br />', '', $this->otherLanguages() );
-               $cat = '<div id="catlinks" class="catlinks">' . $this->getSkin()->getCategoryLinks() . '</div>';
-               if( $cat ) {
-                       $s .= "<br />$cat\n";
-               }
+
+               $s .= $this->getSkin()->getCategories();
+
                $s .= '<br />' . $this->pageTitleLinks();
                $s .= '</span></font>';
 
@@ -101,21 +104,15 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function doAfterContent(){
-               global $wgLang;
-
                $s = "\n</div><br clear='all' />\n";
 
                $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 .= $wgLang->pipeList( array(
+               $s .= $this->getSkin()->getLanguage()->pipeList( array(
                        "\n<br />" . Linker::link(
                                Title::newMainPage(),
                                null,
@@ -130,12 +127,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;
@@ -145,7 +139,6 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function sysLinks() {
-               global $wgUser, $wgLang;
                $li = SpecialPage::getTitleFor( 'Userlogin' );
                $lo = SpecialPage::getTitleFor( 'Userlogout' );
 
@@ -180,7 +173,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                if( $this->extensionTabLinks() ) {
                        $s[] = $this->extensionTabLinks();
                }
-               if ( $wgUser->isLoggedIn() ) {
+               if ( $this->data['loggedin'] ) {
                        $s[] = Linker::linkKnown(
                                $lo,
                                wfMsg( 'logout' ),
@@ -196,7 +189,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                        );
                }
 
-               return $wgLang->pipeList( $s );
+               return $this->getSkin()->getLanguage()->pipeList( $s );
        }
 
        /**
@@ -206,10 +199,6 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function quickBar(){
-               global $wgOut, $wgUser;
-
-               $tns = $this->getSkin()->getTitle()->getNamespace();
-
                $s = "\n<div id='quickbar'>";
 
                $sep = '<br />';
@@ -246,7 +235,9 @@ class CologneBlueTemplate extends LegacyTemplate {
                        $barnumber++;
                }
 
-               if ( $wgOut->isArticle() ) {
+               $user = $this->getSkin()->getUser();
+
+               if ( $this->data['isarticle'] ) {
                        $s .= $this->menuHead( 'qbedit' );
                        $s .= '<strong>' . $this->editThisPage() . '</strong>';
 
@@ -255,16 +246,16 @@ class CologneBlueTemplate extends LegacyTemplate {
                                wfMsg( 'edithelp' )
                        );
 
-                       if( $wgUser->isLoggedIn() ) {
+                       if( $this->data['loggedin'] ) {
                                $s .= $sep . $this->moveThisPage();
                        }
-                       if ( $wgUser->isAllowed( 'delete' ) ) {
+                       if ( $user->isAllowed( 'delete' ) ) {
                                $dtp = $this->deleteThisPage();
                                if ( $dtp != '' ) {
                                        $s .= $sep . $dtp;
                                }
                        }
-                       if ( $wgUser->isAllowed( 'protect' ) ) {
+                       if ( $user->isAllowed( 'protect' ) ) {
                                $ptp = $this->protectThisPage();
                                if ( $ptp != '' ) {
                                        $s .= $sep . $ptp;
@@ -276,7 +267,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                        $s .= $this->talkLink()
                                        . $sep . $this->commentLink()
                                        . $sep . $this->printableLink();
-                       if ( $wgUser->isLoggedIn() ) {
+                       if ( $this->data['loggedin'] ) {
                                $s .= $sep . $this->watchThisPage();
                        }
 
@@ -287,8 +278,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 ) ) {
@@ -300,20 +293,20 @@ class CologneBlueTemplate extends LegacyTemplate {
                }
 
                $s .= $this->menuHead( 'qbmyoptions' );
-               if ( $wgUser->isLoggedIn() ) {
+               if ( $this->data['loggedin'] ) {
                        $tl = Linker::link(
-                               $wgUser->getTalkPage(),
+                               $user->getTalkPage(),
                                wfMsg( 'mytalk' ),
                                array(),
                                array(),
                                array( 'known', 'noclasses' )
                        );
-                       if ( $wgUser->getNewtalk() ) {
+                       if ( $user->getNewtalk() ) {
                                $tl .= ' *';
                        }
 
                        $s .= Linker::link(
-                                       $wgUser->getUserPage(),
+                                       $user->getUserPage(),
                                        wfMsg( 'mypage' ),
                                        array(),
                                        array(),
@@ -321,7 +314,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                                ) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' )
                                        . $sep .
                                Linker::link(
-                                       SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
+                                       SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ),
                                        wfMsg( 'mycontris' ),
                                        array(),
                                        array(),
@@ -336,7 +329,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                        . Linker::specialLink( 'Newpages' )
                        . $sep . Linker::specialLink( 'Listfiles' )
                        . $sep . Linker::specialLink( 'Statistics' );
-               if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+               if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) {
                        $s .= $sep . $this->getUploadLink();
                }
 
@@ -373,9 +366,9 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function searchForm( $label = '' ) {
-               global $wgRequest, $wgUseTwoButtonsSearchForm;
+               global $wgUseTwoButtonsSearchForm;
 
-               $search = $wgRequest->getText( 'search' );
+               $search = $this->getSkin()->getRequest()->getText( 'search' );
                $action = $this->data['searchaction'];
                $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
                if( $label != '' ) {