From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- skins/ArchLinux.php | 306 +++++++-------- skins/Chick.php | 6 +- skins/CologneBlue.php | 173 +++++---- skins/Modern.php | 99 +---- skins/MonoBook.php | 299 ++++++-------- skins/Nostalgia.php | 46 ++- skins/Simple.php | 9 +- skins/Standard.php | 149 ++++--- skins/Vector.php | 609 +++++++---------------------- skins/archlinux/IE60Fixes.css | 18 +- skins/archlinux/IE70Fixes.css | 14 +- skins/archlinux/external-ltr.png | Bin 0 -> 143 bytes skins/archlinux/external.png | Bin 143 -> 0 bytes skins/archlinux/main.css | 114 +++--- skins/archlinux/print.css | 3 + skins/archlinux/rtl.css | 251 ------------ skins/chick/main.css | 26 +- skins/cologneblue/screen.css | 230 +++++++++++ skins/common/IEFixes.js | 4 +- skins/common/Makefile | 2 - skins/common/ajax.js | 2 - skins/common/ajaxwatch.js | 120 ------ skins/common/block.js | 89 ----- skins/common/cologneblue.css | 210 ---------- skins/common/commonPrint.css | 36 +- skins/common/common_rtl.css | 59 --- skins/common/config.css | 22 +- skins/common/config.js | 2 +- skins/common/diff.css | 75 ---- skins/common/diff.js | 20 - skins/common/edit.js | 231 ----------- skins/common/enhancedchanges.js | 40 -- skins/common/history.js | 77 ---- skins/common/htmlform.js | 40 -- skins/common/images/cc-by.png | Bin 0 -> 4739 bytes skins/common/images/critical-32.png | Bin 2395 -> 1914 bytes skins/common/images/download-32.png | Bin 2057 -> 1846 bytes skins/common/images/info-32.png | Bin 2159 -> 1940 bytes skins/common/images/magnify-clip-rtl.png | Bin 0 -> 252 bytes skins/common/images/sort_down.gif | Bin 464 -> 0 bytes skins/common/images/sort_none.gif | Bin 462 -> 0 bytes skins/common/images/sort_up.gif | Bin 466 -> 0 bytes skins/common/images/tick-32.png | Bin 1457 -> 1137 bytes skins/common/images/warning-32.png | Bin 1895 -> 1349 bytes skins/common/metadata.js | 53 --- skins/common/mwsuggest.js | 46 +-- skins/common/nostalgia.css | 48 --- skins/common/oldshared.css | 32 +- skins/common/prefs.js | 138 ------- skins/common/preview.js | 16 +- skins/common/protect.js | 2 + skins/common/search.css | 14 - skins/common/search.js | 50 --- skins/common/shared.css | 645 ++++++++++++++----------------- skins/common/upload.js | 49 +-- skins/common/wikibits.js | 440 +-------------------- skins/modern/main.css | 74 ++-- skins/modern/rtl.css | 162 -------- skins/monobook/IE60Fixes.css | 18 +- skins/monobook/IE70Fixes.css | 14 +- skins/monobook/external-ltr.png | Bin 0 -> 143 bytes skins/monobook/external.png | Bin 143 -> 0 bytes skins/monobook/main.css | 114 +++--- skins/monobook/rtl.css | 251 ------------ skins/nostalgia/screen.css | 51 +++ skins/simple/main.css | 43 +-- skins/vector/images/arrow-down-icon.png | Bin 188 -> 241 bytes skins/vector/images/user-icon.png | Bin 308 -> 584 bytes skins/vector/screen.css | 120 +++--- skins/vector/vector.js | 19 + 70 files changed, 1602 insertions(+), 4178 deletions(-) create mode 100644 skins/archlinux/external-ltr.png delete mode 100644 skins/archlinux/external.png create mode 100644 skins/archlinux/print.css delete mode 100644 skins/archlinux/rtl.css create mode 100644 skins/cologneblue/screen.css delete mode 100644 skins/common/Makefile delete mode 100644 skins/common/ajaxwatch.js delete mode 100644 skins/common/block.js delete mode 100644 skins/common/cologneblue.css delete mode 100644 skins/common/common_rtl.css delete mode 100644 skins/common/diff.css delete mode 100644 skins/common/diff.js delete mode 100644 skins/common/edit.js delete mode 100644 skins/common/enhancedchanges.js delete mode 100644 skins/common/history.js delete mode 100644 skins/common/htmlform.js create mode 100644 skins/common/images/cc-by.png create mode 100644 skins/common/images/magnify-clip-rtl.png delete mode 100644 skins/common/images/sort_down.gif delete mode 100644 skins/common/images/sort_none.gif delete mode 100644 skins/common/images/sort_up.gif delete mode 100644 skins/common/metadata.js delete mode 100644 skins/common/nostalgia.css delete mode 100644 skins/common/prefs.js delete mode 100644 skins/common/search.css delete mode 100644 skins/common/search.js delete mode 100644 skins/modern/rtl.css create mode 100644 skins/monobook/external-ltr.png delete mode 100644 skins/monobook/external.png delete mode 100644 skins/monobook/rtl.css create mode 100644 skins/nostalgia/screen.css create mode 100644 skins/vector/vector.js (limited to 'skins') diff --git a/skins/ArchLinux.php b/skins/ArchLinux.php index 62942536..02598641 100644 --- a/skins/ArchLinux.php +++ b/skins/ArchLinux.php @@ -22,25 +22,22 @@ class SkinArchLinux extends SkinTemplate { function setupSkinUserCss( OutputPage $out ) { global $wgHandheldStyle; - parent::setupSkinUserCss( $out ); - // Append to the default screen common & print styles... - $out->addStyle( 'archlinux/main.css', 'screen' ); + $out->addModuleStyles( 'skins.archlinux' ); + + // Ugh. Can't do this properly because $wgHandheldStyle may be a URL if( $wgHandheldStyle ) { // Currently in testing... try 'chick/main.css' $out->addStyle( $wgHandheldStyle, 'handheld' ); } + // TODO: Migrate all of these $out->addStyle( 'archlinux/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); $out->addStyle( 'archlinux/IE55Fixes.css', 'screen', 'IE 5.5000' ); $out->addStyle( 'archlinux/IE60Fixes.css', 'screen', 'IE 6' ); $out->addStyle( 'archlinux/IE70Fixes.css', 'screen', 'IE 7' ); - $out->addStyle( 'archlinux/rtl.css', 'screen', '', 'rtl' ); - - $out->addStyle( 'archlinux/archnavbar.css', 'screen' ); - $out->addStyle( 'archlinux/arch.css', 'screen' ); } } @@ -48,8 +45,13 @@ class SkinArchLinux extends SkinTemplate { * @todo document * @ingroup Skins */ -class ArchLinuxTemplate extends QuickTemplate { +class ArchLinuxTemplate extends BaseTemplate { + + /** + * @var Skin + */ var $skin; + /** * Template filter callback for ArchLinux skin. * Takes an associative array of data set from a SkinTemplate-based @@ -59,37 +61,15 @@ class ArchLinuxTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgRequest, $wgArchNavBar, $wgArchHome, $wgArchNavBarSelected, $wgArchNavBarSelectedDefault; - $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); + global $wgArchNavBar, $wgArchHome, $wgArchNavBarSelected, $wgArchNavBarSelectedDefault; + $this->skin = $this->data['skin']; // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - // fold footerlinks into a single array using a bit of trickery - $footerlinks = call_user_func_array('array_merge', array_values($footerlinks)); - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset any icons which don't have an image - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) { - if ( !is_string($footerIcon) && !isset($footerIcon["src"]) ) { - unset($footerIconsBlock[$footerIconKey]); - } - } - } - // Redo removal of any empty blocks - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - if ( count($footerIconsBlock) <= 0 ) { - unset($footericons[$footerIconsKey]); - } - } - $this->html( 'headelement' ); +?> -if (empty($_REQUEST['printable'])) {?>
-
-
html("specialpageattributes") ?>> +
+
data['sitenotice']) { ?>
html('sitenotice') ?>
@@ -139,77 +118,45 @@ if (empty($_REQUEST['printable'])) {?>
html('userlangattributes') ?>> -
-
msg('views') ?>
- -
+cactions(); ?>
msg('personaltools') ?>
html('userlangattributes') ?>> -data['personal_urls'] as $key => $item) { ?> -
  • " class="active">tooltipAndAccesskey('pt-'.$key) ?> class="">
  • - +getPersonalTools() as $key => $item) { ?> + makeListItem($key, $item); ?> + +
    data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } + $this->renderPortals( $this->data['sidebar'] ); ?>
    +getFooterIcons( "icononly" ); + $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links + + if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?> -
    -html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -html('reporttime') ?> -data['debug'] ): ?> - - +printTrail(); echo Html::closeElement( 'body' ); echo Html::closeElement( 'html' ); wfRestoreWarnings(); } // end of execute() method /*************************************************************************************************/ + + protected function renderPortals( $sidebar ) { + if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; + if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; + if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; + + foreach( $sidebar as $boxName => $content ) { + if ( $content === false ) + continue; + + if ( $boxName == 'SEARCH' ) { + $this->searchBox(); + } elseif ( $boxName == 'TOOLBOX' ) { + $this->toolbox(); + } elseif ( $boxName == 'LANGUAGES' ) { + $this->languageBox(); + } else { + $this->customBox( $boxName, $content ); + } + } + } + function searchBox() { global $wgUseTwoButtonsSearchForm; ?> @@ -263,19 +218,15 @@ if (empty($_REQUEST['printable'])) {?>
    - data['search'] ) ? $this->data['search'] : '', 'search', - array( - 'id' => 'searchInput', - 'title' => $this->skin->titleAttrib( 'search' ), - 'accesskey' => $this->skin->accesskey( 'search' ) - ) ); ?> + makeSearchInput(array( "id" => "searchInput" )); ?> - skin->tooltipAndAccesskey( 'search-go' ); ?> />  - skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /> + makeSearchButton("go", array( "id" => "searchGoButton", "class" => "searchButton" )); + if ($wgUseTwoButtonsSearchForm): ?>  + makeSearchButton("fulltext", array( "id" => "mw-searchButton", "class" => "searchButton" )); + else: ?> - +
    @@ -283,6 +234,43 @@ if (empty($_REQUEST['printable'])) {?> +
    +
    msg('views') ?>
    +
    +
      data['content_actions'] as $key => $tab) { + $linkAttribs = array( 'href' => $tab['href'] ); + + if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) { + $title = Linker::titleAttrib( "ca-$key" ); + if ( $title !== false ) { + $linkAttribs['title'] = $title; + } + } else { + $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" ); + } + $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] ); + + /* Surround with a
    • */ + $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) ); + if( $tab['class'] ) { + $liAttribs['class'] = $tab['class']; + } + echo ' + ' . Html::rawElement( 'li', $liAttribs, $linkHtml ); + } ?> + +
    +
    +
    + @@ -291,51 +279,13 @@ if (empty($_REQUEST['printable'])) {?>
    @@ -351,10 +301,9 @@ if (empty($_REQUEST['printable'])) {?> html('userlangattributes') ?>>msg('otherlanguages') ?>
      -data['language_urls'] as $langlink) { ?> -
    • +data['language_urls'] as $key => $langlink) { ?> + makeListItem($key, $langlink); ?> +
    @@ -365,16 +314,21 @@ if (empty($_REQUEST['printable'])) {?> /*************************************************************************************************/ function customBox( $bar, $cont ) { + $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) ); + $tooltip = Linker::titleAttrib( "p-$bar" ); + if ( $tooltip !== false ) { + $portletAttribs['title'] = $tooltip; + } + echo ' ' . Html::openElement( 'div', $portletAttribs ); ?> -
    skin->tooltip('p-'.$bar) ?>> -
    + +
    exists() ? $msg->text() : $bar ); ?>
    addStyle( 'chick/main.css', 'screen,handheld' ); + + $out->addModuleStyles( 'skins.chick' ); + + // TODO: Migrate all of these to RL $out->addStyle( 'chick/IE50Fixes.css', 'screen,handheld', 'lt IE 5.5000' ); $out->addStyle( 'chick/IE55Fixes.css', 'screen,handheld', 'IE 5.5000' ); $out->addStyle( 'chick/IE60Fixes.css', 'screen,handheld', 'IE 6' ); diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 1ff2ccab..58b00fc6 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -15,37 +15,67 @@ if( !defined( 'MEDIAWIKI' ) ) { * @todo document * @ingroup Skins */ -class SkinCologneBlue extends Skin { +class SkinCologneBlue extends SkinLegacy { + var $skinname = 'cologneblue', $stylename = 'cologneblue', + $template = 'CologneBlueTemplate'; - function getStylesheet() { - return 'common/cologneblue.css'; - } + function setupSkinUserCss( OutputPage $out ){ + parent::setupSkinUserCss( $out ); + $out->addModuleStyles( 'skins.cologneblue' ); + + $qb = $this->qbSetting(); + $rules = array(); - function getSkinName() { - return 'cologneblue'; + 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' ); } +} + +class CologneBlueTemplate extends LegacyTemplate { + function doBeforeContent() { $mainPageObj = Title::newMainPage(); $s = "\n
    \n
    " . ''; - $s .= ''; - if ( $shove && !$left ) { # Right - $s .= $this->getQuickbarCompensator(); - } $s .= "
    '; + $s .= ''; $s .= ''; $s .= '' . wfMsg( 'sitetitle' ) . ''; - $s .= ''; + $s .= '
    '; + $s .= '
    '; $s .= ''; $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . ''; - $s .= ''; + $s .= ''; $s .= ''; $s .= str_replace( '
    ', '', $this->otherLanguages() ); - $cat = $this->getCategoryLinks(); + $cat = ''; if( $cat ) { $s .= "
    $cat\n"; } @@ -56,7 +86,7 @@ class SkinCologneBlue extends Skin { $s .= "\n\n
    "; - $notice = wfGetSiteNotice(); + $notice = $this->getSkin()->getSiteNotice(); if( $notice ) { $s .= "\n
    $notice
    \n"; } @@ -73,75 +103,38 @@ class SkinCologneBlue extends Skin { $s .= "\n\n
    \n"; - if ( 0 != $qb ) { + if ( $this->getSkin()->qbSetting() != 0 ) { $s .= $this->quickBar(); } return $s; } - function setupSkinUserCss( OutputPage $out ){ - global $wgContLang; - $qb = $this->qbSetting(); - $rules = array(); - - if ( 2 == $qb ) { # Right - $rules[] = "#quickbar { position: absolute; right: 4px; }"; - $rules[] = "#article { margin-left: 4px; margin-right: 148px; }"; - } elseif ( 1 == $qb ) { - $rules[] = "#quickbar { position: absolute; left: 4px; }"; - $rules[] = "#article { margin-left: 148px; margin-right: 4px; }"; - } elseif ( 3 == $qb ) { # Floating left - $rules[] = "#quickbar { position:absolute; left:4px }"; - $rules[] = "#topbar { margin-left: 148px }"; - $rules[] = "#article { margin-left:148px; margin-right: 4px; }"; - $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE - } elseif ( 4 == $qb ) { # Floating right - $rules[] = "#quickbar { position: fixed; right: 4px; }"; - $rules[] = "#topbar { margin-right: 148px }"; - $rules[] = "#article { margin-right: 148px; margin-left: 4px; }"; - $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE - } - $style = implode( "\n", $rules ); - if ( $wgContLang->getDir() === 'rtl' ) { - $style = CSSJanus::transform( $style, true, false ); - } - $out->addInlineStyle( $style ); - parent::setupSkinUserCss( $out ); - } - function sysLinks() { global $wgUser, $wgLang; $li = SpecialPage::getTitleFor( 'Userlogin' ); $lo = SpecialPage::getTitleFor( 'Userlogout' ); - $rt = $this->mTitle->getPrefixedURL(); + $rt = $this->getSkin()->getTitle()->getPrefixedURL(); if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { $q = array(); } else { @@ -149,20 +142,20 @@ class SkinCologneBlue extends Skin { } $s = array( - $this->mainPageLink(), - $this->linkKnown( + $this->getSkin()->mainPageLink(), + Linker::linkKnown( Title::newFromText( wfMsgForContent( 'aboutpage' ) ), wfMsg( 'about' ) ), - $this->linkKnown( + Linker::linkKnown( Title::newFromText( wfMsgForContent( 'helppage' ) ), wfMsg( 'help' ) ), - $this->linkKnown( + Linker::linkKnown( Title::newFromText( wfMsgForContent( 'faqpage' ) ), wfMsg( 'faq' ) ), - $this->specialLink( 'Specialpages' ) + Linker::specialLink( 'Specialpages' ) ); /* show links to different language variants */ @@ -173,14 +166,14 @@ class SkinCologneBlue extends Skin { $s[] = $this->extensionTabLinks(); } if ( $wgUser->isLoggedIn() ) { - $s[] = $this->linkKnown( + $s[] = Linker::linkKnown( $lo, wfMsg( 'logout' ), array(), $q ); } else { - $s[] = $this->linkKnown( + $s[] = Linker::linkKnown( $li, wfMsg( 'login' ), array(), @@ -198,7 +191,7 @@ class SkinCologneBlue extends Skin { function quickBar(){ global $wgOut, $wgUser; - $tns = $this->mTitle->getNamespace(); + $tns = $this->getSkin()->getTitle()->getNamespace(); $s = "\n
    "; @@ -209,24 +202,38 @@ class SkinCologneBlue extends Skin { $s .= $this->menuHead( 'qbbrowse' ); # Use the first heading from the Monobook sidebar as the "browse" section - $bar = $this->buildSidebar(); + $bar = $this->getSkin()->buildSidebar(); unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); - $browseLinks = reset( $bar ); - foreach ( $browseLinks as $link ) { - if ( $link['text'] != '-' ) { - $s .= "" . - htmlspecialchars( $link['text'] ) . '' . $sep; + $barnumber = 1; + foreach ( $bar as $heading => $browseLinks ) { + if ( $barnumber > 1 ) { + $headingMsg = wfMessage( $heading ); + if ( $headingMsg->exists() ) { + $h = $headingMsg->text(); + } else { + $h = $heading; + } + $s .= "\n
    " . htmlspecialchars( $h ) . "
    "; + } + if( is_array( $browseLinks ) ) { + foreach ( $browseLinks as $link ) { + if ( $link['text'] != '-' ) { + $s .= "" . + htmlspecialchars( $link['text'] ) . '' . $sep; + } + } } + $barnumber++; } if ( $wgOut->isArticle() ) { $s .= $this->menuHead( 'qbedit' ); $s .= '' . $this->editThisPage() . ''; - $s .= $sep . $this->linkKnown( + $s .= $sep . Linker::linkKnown( Title::newFromText( wfMsgForContent( 'edithelppage' ) ), wfMsg( 'edithelp' ) ); @@ -264,10 +271,10 @@ class SkinCologneBlue extends Skin { . $sep . $this->watchPageLinksLink(); if( $tns == NS_USER || $tns == NS_USER_TALK ) { - $id = User::idFromName( $this->mTitle->getText() ); + $id = User::idFromName( $this->getSkin()->getTitle()->getText() ); if( $id != 0 ) { $s .= $sep . $this->userContribsLink(); - if( $this->showEmailUser( $id ) ) { + if( $this->getSkin()->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); } } @@ -277,7 +284,7 @@ class SkinCologneBlue extends Skin { $s .= $this->menuHead( 'qbmyoptions' ); if ( $wgUser->isLoggedIn() ) { - $tl = $this->link( + $tl = Linker::link( $wgUser->getTalkPage(), wfMsg( 'mytalk' ), array(), @@ -288,30 +295,30 @@ class SkinCologneBlue extends Skin { $tl .= ' *'; } - $s .= $this->link( + $s .= Linker::link( $wgUser->getUserPage(), wfMsg( 'mypage' ), array(), array(), array( 'known', 'noclasses' ) - ) . $sep . $tl . $sep . $this->specialLink( 'Watchlist' ) + ) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' ) . $sep . - $this->link( + Linker::link( SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), wfMsg( 'mycontris' ), array(), array(), array( 'known', 'noclasses' ) - ) . $sep . $this->specialLink( 'Preferences' ) - . $sep . $this->specialLink( 'Userlogout' ); + ) . $sep . Linker::specialLink( 'Preferences' ) + . $sep . Linker::specialLink( 'Userlogout' ); } else { - $s .= $this->specialLink( 'Userlogin' ); + $s .= Linker::specialLink( 'Userlogin' ); } $s .= $this->menuHead( 'qbspecialpages' ) - . $this->specialLink( 'Newpages' ) - . $sep . $this->specialLink( 'Listfiles' ) - . $sep . $this->specialLink( 'Statistics' ); + . Linker::specialLink( 'Newpages' ) + . $sep . Linker::specialLink( 'Listfiles' ) + . $sep . Linker::specialLink( 'Statistics' ); if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { $s .= $sep . $this->getUploadLink(); } @@ -323,7 +330,7 @@ class SkinCologneBlue extends Skin { . wfMsg( 'sitesupport' ) . ''; } - $s .= $sep . $this->link( + $s .= $sep . Linker::link( SpecialPage::getTitleFor( 'Specialpages' ), wfMsg( 'moredotdotdot' ), array(), @@ -344,7 +351,7 @@ class SkinCologneBlue extends Skin { global $wgRequest, $wgUseTwoButtonsSearchForm; $search = $wgRequest->getText( 'search' ); - $action = $this->escapeSearchLink(); + $action = $this->data['searchaction']; $s = "
    searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">"; if( $label != '' ) { $s .= "{$label}: "; diff --git a/skins/Modern.php b/skins/Modern.php index 752d0ded..c4070b5d 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -22,11 +22,8 @@ class SkinModern extends SkinTemplate { $template = 'ModernTemplate', $useHeadElement = true; function setupSkinUserCss( OutputPage $out ){ - // Do not call parent::setupSkinUserCss(), we have our own print style - $out->addStyle( 'common/shared.css', 'screen' ); - $out->addStyle( 'modern/main.css', 'screen' ); - $out->addStyle( 'modern/print.css', 'print' ); - $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' ); + parent::setupSkinUserCss( $out ); + $out->addModuleStyles ('skins.modern'); } } @@ -35,6 +32,10 @@ class SkinModern extends SkinTemplate { * @ingroup Skins */ class ModernTemplate extends MonoBookTemplate { + + /** + * @var Skin + */ var $skin; /** * Template filter callback for Modern skin. @@ -45,25 +46,11 @@ class ModernTemplate extends MonoBookTemplate { * @access private */ function execute() { - global $wgRequest; $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - // fold footerlinks into a single array using a bit of trickery - $footerlinks = call_user_func_array('array_merge', array_values($footerlinks)); - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset copyright.copyright since we don't need the icon and already output a copyright from footerlinks - unset($footericons["copyright"]["copyright"]); - if ( count($footericons["copyright"]) <= 0 ) { - unset($footericons["copyright"]); - } - $this->html( 'headelement' ); ?> @@ -73,41 +60,14 @@ class ModernTemplate extends MonoBookTemplate {
    -
    -
    msg('views') ?>
    - -
    +cactions(); ?>
    -
    html("specialpageattributes") ?>> +
    msg('tagline') ?>
    @@ -135,24 +95,7 @@ class ModernTemplate extends MonoBookTemplate {
    html("userlangattributes") ?>> - data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } - ?> + renderPortals( $this->data['sidebar'] ); ?>
    @@ -166,14 +109,10 @@ class ModernTemplate extends MonoBookTemplate {
    msg('personaltools') ?>
    @@ -183,7 +122,7 @@ class ModernTemplate extends MonoBookTemplate {
    "; $s .= $this->bottomLinks(); $s .= "\n
    " . $wgLang->pipeList( array( - $this->mainPageLink(), - $this->aboutLink(), - $this->specialLink( 'Recentchanges' ), + $this->getSkin()->mainPageLink(), + $this->getSkin()->aboutLink(), + Linker::specialLink( 'Recentchanges' ), $this->searchForm() ) ) . '
    ' . $this->pageStats() . ''; $s .= '
    \n
    \n
    \n"; - wfProfileOut( __METHOD__ . '-3' ); - wfProfileIn( __METHOD__ . '-4' ); - if ( 0 != $qb ) { + wfProfileOut( __METHOD__ . '-2' ); + wfProfileIn( __METHOD__ . '-3' ); + if ( $this->getSkin()->qbSetting() != 0 ) { $s .= $this->quickBar(); } - wfProfileOut( __METHOD__ . '-4' ); + wfProfileOut( __METHOD__ . '-3' ); wfProfileOut( __METHOD__ ); return $s; } @@ -104,39 +92,49 @@ class SkinStandard extends Skin { $action = $wgRequest->getText( 'action' ); $wpPreview = $wgRequest->getBool( 'wpPreview' ); - $tns = $this->mTitle->getNamespace(); + $tns = $this->getSkin()->getTitle()->getNamespace(); $s = "\n
    "; - $s .= "\n" . $this->logoText() . "\n
    "; + $s .= "\n" . $this->getSkin()->logoText() . "\n
    "; $sep = "\n
    "; # Use the first heading from the Monobook sidebar as the "browse" section - $bar = $this->buildSidebar(); + $bar = $this->getSkin()->buildSidebar(); unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); - $browseLinks = reset( $bar ); - foreach ( $browseLinks as $link ) { - if ( $link['text'] != '-' ) { - $s .= "" . - htmlspecialchars( $link['text'] ) . '' . $sep; + $barnumber = 1; + foreach ( $bar as $browseLinks ) { + if ( is_array( $browseLinks ) ) { + if ( $barnumber > 1 ) { + $s .= "\n
    "; + } + foreach ( $browseLinks as $link ) { + if ( $link['text'] != '-' ) { + $s .= "" . + htmlspecialchars( $link['text'] ) . '' . $sep; + } + } + } + if ( $barnumber == 1 ) { + // only show watchlist link if logged in + if( $wgUser->isLoggedIn() ) { + $s.= Linker::specialLink( 'Watchlist' ) ; + $s .= $sep . Linker::linkKnown( + SpecialPage::getTitleFor( 'Contributions' ), + wfMsg( 'mycontris' ), + array(), + array( 'target' => $wgUser->getName() ) + ); + } } + $barnumber = $barnumber + 1; } - if( $wgUser->isLoggedIn() ) { - $s.= $this->specialLink( 'Watchlist' ) ; - $s .= $sep . $this->linkKnown( - SpecialPage::getTitleFor( 'Contributions' ), - wfMsg( 'mycontris' ), - array(), - array( 'target' => $wgUser->getName() ) - ); - } - // only show watchlist link if logged in $s .= "\n
    "; - $articleExists = $this->mTitle->getArticleId(); + $articleExists = $this->getSkin()->getTitle()->getArticleId(); if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) { if( $wgOut->isArticle() ) { $s .= '' . $this->editThisPage() . ''; @@ -181,17 +179,14 @@ class SkinStandard extends Skin { $text = wfMsg( 'articlepage' ); } - $link = $this->mTitle->getText(); + $link = $this->getSkin()->getTitle()->getText(); $nstext = $wgContLang->getNsText( $tns ); if( $nstext ) { # add namespace if necessary $link = $nstext . ':' . $link; } - $s .= $this->link( - Title::newFromText( $link ), - $text - ); - } elseif( $this->mTitle->getNamespace() != NS_SPECIAL ) { + $s .= Linker::link( Title::newFromText( $link ), $text ); + } elseif( $this->getSkin()->getTitle()->getNamespace() != NS_SPECIAL ) { # we just throw in a "New page" text to tell the user that he's in edit mode, # and to avoid messing with the separator that is prepended to the next item $s .= '' . wfMsg( 'newpage' ) . ''; @@ -199,9 +194,9 @@ class SkinStandard extends Skin { } # "Post a comment" link - if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) - $s .= '
    ' . $this->link( - $this->mTitle, + if( ( $this->getSkin()->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) + $s .= '
    ' . $this->getSkin()->link( + $this->getSkin()->getTitle(), wfMsg( 'postcomment' ), array(), array( @@ -221,7 +216,7 @@ class SkinStandard extends Skin { if( $action != 'edit' && $action != 'submit' ) { $s .= $sep . $this->watchThisPage(); } - if ( $this->mTitle->userCan( 'edit' ) ) + if ( $this->getSkin()->getTitle()->userCan( 'edit' ) ) $s .= $sep . $this->moveThisPage(); } if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) { @@ -239,17 +234,17 @@ class SkinStandard extends Skin { } if ( - NS_USER == $this->mTitle->getNamespace() || - $this->mTitle->getNamespace() == NS_USER_TALK + NS_USER == $this->getSkin()->getTitle()->getNamespace() || + $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK ) { - $id = User::idFromName( $this->mTitle->getText() ); - $ip = User::isIP( $this->mTitle->getText() ); + $id = User::idFromName( $this->getSkin()->getTitle()->getText() ); + $ip = User::isIP( $this->getSkin()->getTitle()->getText() ); if( $id || $ip ){ $s .= $sep . $this->userContribsLink(); } - if( $this->showEmailUser( $id ) ) { + if( $this->getSkin()->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); } } @@ -260,7 +255,7 @@ class SkinStandard extends Skin { $s .= $this->getUploadLink() . $sep; } - $s .= $this->specialLink( 'Specialpages' ); + $s .= Linker::specialLink( 'Specialpages' ); global $wgSiteSupportPage; if( $wgSiteSupportPage ) { diff --git a/skins/Vector.php b/skins/Vector.php index 84f38d30..97161611 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -1,7 +1,7 @@ stylename}/csshover{$min}.htc\")}" ); + + $out->addModuleScripts( 'skins.vector' ); } /** @@ -51,355 +52,66 @@ class SkinVector extends SkinTemplate { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.vector' ); } - - /** - * Builds a structured array of links used for tabs and menus - * @return array - * @private - */ - function buildNavigationUrls() { - global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle; - global $wgDisableLangConversion, $wgVectorUseIconWatch; - - wfProfileIn( __METHOD__ ); - - $links = array( - 'namespaces' => array(), - 'views' => array(), - 'actions' => array(), - 'variants' => array() - ); - - // Detects parameters - $action = $wgRequest->getVal( 'action', 'view' ); - $section = $wgRequest->getVal( 'section' ); - - $userCanRead = $this->mTitle->userCanRead(); - - // Checks if page is some kind of content - if( $this->iscontent ) { - // Gets page objects for the related namespaces - $subjectPage = $this->mTitle->getSubjectPage(); - $talkPage = $this->mTitle->getTalkPage(); - - // Determines if this is a talk page - $isTalk = $this->mTitle->isTalkPage(); - - // Generates XML IDs from namespace names - $subjectId = $this->mTitle->getNamespaceKey( '' ); - - if ( $subjectId == 'main' ) { - $talkId = 'talk'; - } else { - $talkId = "{$subjectId}_talk"; - } - - // Adds namespace links - $links['namespaces'][$subjectId] = $this->tabAction( - $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', $userCanRead - ); - $links['namespaces'][$subjectId]['context'] = 'subject'; - $links['namespaces'][$talkId] = $this->tabAction( - $talkPage, 'talk', $isTalk, '', $userCanRead - ); - $links['namespaces'][$talkId]['context'] = 'talk'; - - // Adds view view link - if ( $this->mTitle->exists() && $userCanRead ) { - $links['views']['view'] = $this->tabAction( - $isTalk ? $talkPage : $subjectPage, - 'vector-view-view', ( $action == 'view' || $action == 'purge' ), '', true - ); - } - - wfProfileIn( __METHOD__ . '-edit' ); - - // Checks if user can... - if ( - // read and edit the current page - $userCanRead && $this->mTitle->quickUserCan( 'edit' ) && - ( - // if it exists - $this->mTitle->exists() || - // or they can create one here - $this->mTitle->quickUserCan( 'create' ) - ) - ) { - // Builds CSS class for talk page links - $isTalkClass = $isTalk ? ' istalk' : ''; - - // Determines if we're in edit mode - $selected = ( - ( $action == 'edit' || $action == 'submit' ) && - ( $section != 'new' ) - ); - $links['views']['edit'] = array( - 'class' => ( $selected ? 'selected' : '' ) . $isTalkClass, - 'text' => $this->mTitle->exists() - ? wfMsg( 'vector-view-edit' ) - : wfMsg( 'vector-view-create' ), - 'href' => - $this->mTitle->getLocalURL( $this->editUrlOptions() ) - ); - // Checks if this is a current rev of talk page and we should show a new - // section link - if ( ( $isTalk && $wgArticle && $wgArticle->isCurrent() ) || ( $wgOut->showNewSectionLink() ) ) { - // Checks if we should ever show a new section link - if ( !$wgOut->forceHideNewSectionLink() ) { - // Adds new section link - //$links['actions']['addsection'] - $links['views']['addsection'] = array( - 'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ), - 'text' => wfMsg( 'vector-action-addsection' ), - 'href' => $this->mTitle->getLocalURL( - 'action=edit§ion=new' - ) - ); - } - } - // Checks if the page has some kind of viewable content - } elseif ( $this->mTitle->hasSourceText() && $userCanRead ) { - // Adds view source view link - $links['views']['viewsource'] = array( - 'class' => ( $action == 'edit' ) ? 'selected' : false, - 'text' => wfMsg( 'vector-view-viewsource' ), - 'href' => - $this->mTitle->getLocalURL( $this->editUrlOptions() ) - ); - } - wfProfileOut( __METHOD__ . '-edit' ); - - wfProfileIn( __METHOD__ . '-live' ); - - // Checks if the page exists - if ( $this->mTitle->exists() && $userCanRead ) { - // Adds history view link - $links['views']['history'] = array( - 'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ), - 'text' => wfMsg( 'vector-view-history' ), - 'href' => $this->mTitle->getLocalURL( 'action=history' ), - 'rel' => 'archives', - ); - - if( $wgUser->isAllowed( 'delete' ) ) { - $links['actions']['delete'] = array( - 'class' => ( $action == 'delete' ) ? 'selected' : false, - 'text' => wfMsg( 'vector-action-delete' ), - 'href' => $this->mTitle->getLocalURL( 'action=delete' ) - ); - } - if ( $this->mTitle->quickUserCan( 'move' ) ) { - $moveTitle = SpecialPage::getTitleFor( - 'Movepage', $this->thispage - ); - $links['actions']['move'] = array( - 'class' => $this->mTitle->isSpecial( 'Movepage' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-move' ), - 'href' => $moveTitle->getLocalURL() - ); - } - - if ( - $this->mTitle->getNamespace() !== NS_MEDIAWIKI && - $wgUser->isAllowed( 'protect' ) - ) { - if ( !$this->mTitle->isProtected() ) { - $links['actions']['protect'] = array( - 'class' => ( $action == 'protect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-protect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=protect' ) - ); - - } else { - $links['actions']['unprotect'] = array( - 'class' => ( $action == 'unprotect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-unprotect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=unprotect' ) - ); - } - } - } else { - // article doesn't exist or is deleted - if ( - $wgUser->isAllowed( 'deletedhistory' ) && - $wgUser->isAllowed( 'undelete' ) - ) { - $n = $this->mTitle->isDeleted(); - if( $n ) { - $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); - $links['actions']['undelete'] = array( - 'class' => false, - 'text' => wfMsgExt( - 'vector-action-undelete', - array( 'parsemag' ), - $wgLang->formatNum( $n ) - ), - 'href' => $undelTitle->getLocalURL( - 'target=' . urlencode( $this->thispage ) - ) - ); - } - } - - if ( - $this->mTitle->getNamespace() !== NS_MEDIAWIKI && - $wgUser->isAllowed( 'protect' ) - ) { - if ( !$this->mTitle->getRestrictions( 'create' ) ) { - $links['actions']['protect'] = array( - 'class' => ( $action == 'protect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-protect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=protect' ) - ); - - } else { - $links['actions']['unprotect'] = array( - 'class' => ( $action == 'unprotect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-unprotect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=unprotect' ) - ); - } - } - } - wfProfileOut( __METHOD__ . '-live' ); - /** - * The following actions use messages which, if made particular to - * the Vector skin, would break the Ajax code which makes this - * action happen entirely inline. Skin::makeGlobalVariablesScript - * defines a set of messages in a javascript object - and these - * messages are assumed to be global for all skins. Without making - * a change to that procedure these messages will have to remain as - * the global versions. - */ - // Checks if the user is logged in - if ( $this->loggedin ) { - if ( $wgVectorUseIconWatch ) { - $class = 'icon'; - $place = 'views'; - } else { - $class = ''; - $place = 'actions'; - } - $mode = $this->mTitle->userIsWatching() ? 'unwatch' : 'watch'; - $links[$place][$mode] = array( - 'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ), - 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message - 'href' => $this->mTitle->getLocalURL( 'action=' . $mode ) - ); - } - // This is instead of SkinTemplateTabs - which uses a flat array - wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) ); - - // If it's not content, it's got to be a special page - } else { - $links['namespaces']['special'] = array( - 'class' => 'selected', - 'text' => wfMsg( 'nstab-special' ), - 'href' => $wgRequest->getRequestURL() - ); - // Equiv to SkinTemplateBuildContentActionUrlsAfterSpecialPage - wfRunHooks( 'SkinTemplateNavigation::SpecialPage', array( &$this, &$links ) ); - } - - // Gets list of language variants - $variants = $wgContLang->getVariants(); - // Checks that language conversion is enabled and variants exist - if( !$wgDisableLangConversion && count( $variants ) > 1 ) { - // Gets preferred variant - $preferred = $wgContLang->getPreferredVariant(); - // Loops over each variant - foreach( $variants as $code ) { - // Gets variant name from language code - $varname = $wgContLang->getVariantname( $code ); - // Checks if the variant is marked as disabled - if( $varname == 'disable' ) { - // Skips this variant - continue; - } - // Appends variant link - $links['variants'][] = array( - 'class' => ( $code == $preferred ) ? 'selected' : false, - 'text' => $varname, - 'href' => $this->mTitle->getLocalURL( '', $code ) - ); - } - } - - // Equiv to SkinTemplateContentActions - wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$links ) ); - - wfProfileOut( __METHOD__ ); - - return $links; - } } /** * QuickTemplate class for Vector skin * @ingroup Skins */ -class VectorTemplate extends QuickTemplate { +class VectorTemplate extends BaseTemplate { /* Members */ /** - * @var Cached skin object + * @var Skin Cached skin object */ var $skin; /* Functions */ /** - * Outputs the entire contents of the XHTML page + * Outputs the entire contents of the (X)HTML page */ public function execute() { - global $wgRequest, $wgLang; + global $wgLang, $wgVectorUseIconWatch; $this->skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); // Build additional attributes for navigation urls - $nav = $this->skin->buildNavigationUrls(); + //$nav = $this->skin->buildNavigationUrls(); + $nav = $this->data['content_navigation']; + + if ( $wgVectorUseIconWatch ) { + $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch'; + if ( isset( $nav['actions'][$mode] ) ) { + $nav['views'][$mode] = $nav['actions'][$mode]; + $nav['views'][$mode]['class'] = rtrim( 'icon ' . $nav['views'][$mode]['class'], ' ' ); + $nav['views'][$mode]['primary'] = true; + unset( $nav['actions'][$mode] ); + } + } + + $xmlID = ''; foreach ( $nav as $section => $links ) { foreach ( $links as $key => $link ) { - $xmlID = $key; - if ( isset( $link['context'] ) && $link['context'] == 'subject' ) { - $xmlID = 'ca-nstab-' . $xmlID; - } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) { - $xmlID = 'ca-talk'; - } else { - $xmlID = 'ca-' . $xmlID; + if ( $section == 'views' && !( isset( $link['primary'] ) && $link['primary'] ) ) { + $link['class'] = rtrim( 'collapsible ' . $link['class'], ' ' ); } + + $xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID; $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId( $xmlID ) . '"'; - if ( $nav[$section][$key]['class'] ) { + if ( $link['class'] ) { $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars( $link['class'] ) . '"'; unset( $nav[$section][$key]['class'] ); } - // We don't want to give the watch tab an accesskey if the page - // is being edited, because that conflicts with the accesskey on - // the watch checkbox. We also don't want to give the edit tab - // an accesskey, because that's fairly superfluous and conflicts - // with an accesskey (Ctrl-E) often used for editing in Safari. - if ( - in_array( $action, array( 'edit', 'submit' ) ) && - in_array( $key, array( 'edit', 'watch', 'unwatch' ) ) - ) { + if ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) { $nav[$section][$key]['key'] = - $this->skin->tooltip( $xmlID ); + Linker::tooltip( $xmlID ); } else { $nav[$section][$key]['key'] = - $this->skin->tooltipAndAccesskey( $xmlID ); + Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) ); } } } @@ -407,49 +119,7 @@ class VectorTemplate extends QuickTemplate { $this->data['view_urls'] = $nav['views']; $this->data['action_urls'] = $nav['actions']; $this->data['variant_urls'] = $nav['variants']; - // Build additional attributes for personal_urls - foreach ( $this->data['personal_urls'] as $key => $item) { - $this->data['personal_urls'][$key]['attributes'] = - ' id="' . Sanitizer::escapeId( "pt-$key" ) . '"'; - if ( isset( $item['active'] ) && $item['active'] ) { - $this->data['personal_urls'][$key]['attributes'] .= - ' class="active"'; - } - $this->data['personal_urls'][$key]['key'] = - $this->skin->tooltipAndAccesskey('pt-'.$key); - } - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - - // Reduce footer links down to only those which are being used - $validFooterLinks = array(); - foreach( $footerlinks as $category => $links ) { - $validFooterLinks[$category] = array(); - foreach( $links as $link ) { - if( isset( $this->data[$link] ) && $this->data[$link] ) { - $validFooterLinks[$category][] = $link; - } - } - } - - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset any icons which don't have an image - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) { - if ( !is_string($footerIcon) && !isset($footerIcon["src"]) ) { - unset($footerIconsBlock[$footerIconKey]); - } - } - } - // Redo removal of any empty blocks - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - if ( count($footerIconsBlock) <= 0 ) { - unset($footericons[$footerIconsKey]); - } - } - // Reverse horizontally rendered navigation elements if ( $wgLang->isRTL() ) { $this->data['view_urls'] = @@ -465,9 +135,9 @@ class VectorTemplate extends QuickTemplate {
    -
    html('specialpageattributes') ?>> +
    - + data['sitenotice'] ): ?>
    html( 'sitenotice' ) ?>
    @@ -478,18 +148,20 @@ class VectorTemplate extends QuickTemplate {
    + data['isarticle'] ): ?>
    msg( 'tagline' ) ?>
    + -
    html('userlangattributes') ?>>html( 'subtitle' ) ?>
    +
    html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
    data['undelete'] ): ?>
    html( 'undelete' ) ?>
    - data['newtalk'] ): ?> + data['newtalk'] ): ?>
    html( 'newtalk' ) ?>
    @@ -502,9 +174,16 @@ class VectorTemplate extends QuickTemplate {
    - - html( 'bodytext' ) ?> - + + html( 'bodycontent' ) ?> + + data['printfooter'] ): ?> + +
    + html( 'printfooter' ); ?> +
    + + data['catlinks'] ): ?> html( 'catlinks' ); ?> @@ -516,6 +195,9 @@ class VectorTemplate extends QuickTemplate {
    + + html( 'debughtml' ); ?> +
    @@ -534,28 +216,25 @@ class VectorTemplate extends QuickTemplate {
    - + renderPortals( $this->data['sidebar'] ); ?>
    -