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 ++++++++++++++++++++++------------------------------ 1 file changed, 130 insertions(+), 176 deletions(-) (limited to 'skins/ArchLinux.php') 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 ); ?>