diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7ab734b33b9..0dc2d9f6484 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2262,6 +2262,25 @@ $wgDisableOutputCompression = false; */ $wgExperimentalHtmlIds = true; +/** + * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code + * You can add new icons to the built in copyright or poweredby, or you can create + * a new block. Though note that you may need to add some custom css to get good styling + * of new blocks in monobook. vector and modern should work without any special css. + */ +$wgFooterIcons = array( + "copyright" => array( + "copyright" => array(), // placeholder for the built in copyright icon + ), + "poweredby" => array( + "mediawiki" => array( + "src" => null, // Defaults to "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" + "url" => "http://www.mediawiki.org/", + "alt" => "Powered by MediaWiki", + ) + ), +); + /** * Search form behavior for Vector skin only * true = use an icon search button diff --git a/includes/Setup.php b/includes/Setup.php index d78aade74a2..b937c0ead84 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -63,6 +63,28 @@ if( isset( $wgFileStore['deleted']['directory'] ) ) { $wgDeletedDirectory = $wgFileStore['deleted']['directory']; } +if( isset($wgFooterIcons["copyright"]) && + isset($wgFooterIcons["copyright"]["copyright"]) && + $wgFooterIcons["copyright"]["copyright"] === array() ) { + if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) { + $wgFooterIcons["copyright"]["copyright"] = $wgCopyrightIcon; + } elseif ( $wgRightsIcon || $wgRightsText ) { + $wgFooterIcons["copyright"]["copyright"] = array( + "url" => $wgRightsUrl, + "src" => $wgRightsIcon, + "alt" => $wgRightsText, + ); + } else { + unset($wgFooterIcons["copyright"]["copyright"]); + } +} + +if( isset($wgFooterIcons["poweredby"]) && + isset($wgFooterIcons["poweredby"]["mediawiki"]) && + $wgFooterIcons["poweredby"]["mediawiki"]["src"] === null ) { + $wgFooterIcons["poweredby"]["mediawiki"]["src"] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png"; +} + /** * Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a * sysadmin to set $wgNamespaceProtection incorrectly and leave the wiki insecure. diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 5a78f909f39..a7229712397 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -425,6 +425,21 @@ class SkinTemplate extends Skin { 'disclaimer', ), ) ); + + global $wgFooterIcons; + $tpl->set( 'footericons', $wgFooterIcons ); + foreach ( $tpl->data["footericons"] as $footerIconsKey => &$footerIconsBlock ) { + if ( count($footerIconsBlock) > 0 ) { + foreach ( $footerIconsBlock as &$footerIcon ) { + if ( isset($footerIcon["src"]) ) { + if ( !isset($footerIcon["width"]) ) $footerIcon["width"] = 88; + if ( !isset($footerIcon["height"]) ) $footerIcon["height"] = 31; + } + } + } else { + unset($tpl->data["footericons"][$footerIconsKey]); + } + } if ( $wgDebugComments ) { $tpl->setRef( 'debug', $out->mDebugtext ); diff --git a/skins/Modern.php b/skins/Modern.php index c5bddc63bcf..086f8bfabce 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -21,17 +21,6 @@ class SkinModern extends SkinTemplate { var $skinname = 'modern', $stylename = 'modern', $template = 'ModernTemplate', $useHeadElement = true; - /* - * We don't like the default getPoweredBy, the icon clashes with the - * skin L&F. - */ - function getPoweredBy() { - global $wgVersion; - $text = "