From: Brion Vibber Date: Tue, 31 Oct 2006 14:41:59 +0000 (+0000) Subject: * Add tab links from extensions to classic-based skins (SkinTemplateTab hook) X-Git-Tag: 1.31.0-rc.0~55341 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=df51ff0949027386465fd56abc4d2e7d332865a1;p=lhc%2Fweb%2Fwiklou.git * Add tab links from extensions to classic-based skins (SkinTemplateTab hook) Provides better cross-skin compatibility for extensions using the modern skin hooks, such as Oversight * Moved variant language links on Cologne Blue and Nostalgia to before the login/logout link --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 19355f435f..e75e212640 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -111,6 +111,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added {{#special:}} parser function, to give the local default title for special pages * (bug 7766) Remove redundant / from AJAX requests, can break some servers +* Add tab links from extensions to classic-based skins (SkinTemplateTab hook) + Provides better cross-skin compatibility for extensions using the modern + skin hooks, such as Oversight +* Moved variant language links on Cologne Blue and Nostalgia to before the + login/logout link == Languages updated == diff --git a/includes/Skin.php b/includes/Skin.php index 1a74cfc0d7..374ca20990 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -896,10 +896,30 @@ END; #$s .= $sep . $this->specialPagesList(); $s .= $this->variantLinks(); + + $s .= $this->extensionTabLinks(); return $s; } + /** + * Compatibility for extensions adding functionality through tabs. + * Eventually these old skins should be replaced with SkinTemplate-based + * versions, sigh... + * @return string + */ + function extensionTabLinks() { + $tabs = array(); + $s = ''; + wfRunHooks( 'SkinTemplateTabs', array( $this, &$tabs ) ); + foreach( $tabs as $tab ) { + $s .= ' | ' . Xml::element( 'a', + array( 'href' => $tab['href'] ), + $tab['text'] ); + } + return $s; + } + /** * Language/charset variant links for classic-style skins * @return string diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 6ad8914843..8450cdec11 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -146,17 +146,19 @@ class SkinCologneBlue extends Skin { . " | " . $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ) . " | " . - $this->specialLink( "specialpages" ) . " | "; + $this->specialLink( "specialpages" ); + /* show links to different language variants */ + $s .= $this->variantLinks(); + $s .= $this->extensionTabLinks(); + + $s .= " | "; if ( $wgUser->isLoggedIn() ) { $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q ); } else { $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q ); } - /* show links to different language variants */ - $s .= $this->variantLinks(); - return $s; } diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index 1d76a951ac..3b19e41e64 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -63,15 +63,17 @@ class SkinNostalgia extends Skin { $s .= $sep . $this->editThisPage() . $sep . $this->historyLink(); } + + /* show links to different language variants */ + $s .= $this->variantLinks(); + $s .= $this->extensionTabLinks(); + if ( $wgUser->isAnon() ) { $s .= $sep . $this->specialLink( "userlogin" ); } else { $s .= $sep . $this->specialLink( "userlogout" ); } - /* show links to different language variants */ - $s .= $this->variantLinks(); - $s .= $sep . $this->specialPagesList(); return $s;