diff --git a/DeepSea.skin.php b/DeepSea.skin.php index 514e5f3..757d6f7 100644 --- a/DeepSea.skin.php +++ b/DeepSea.skin.php @@ -1,544 +1,532 @@ getRequest()->getFuzzyBool( 'debug' ) ? '' : '.min'; $out->addHeadItem( 'csshover', '" ); $out->addMeta( 'viewport', 'width=device-width' ); // Load JS $out->addModuleScripts( 'skins.deepsea' ); } /** * Load skin and user CSS files in the correct order * fixes bug 22916 * * @param $out OutputPage object */ function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addModuleStyles( array( 'mediawiki.skinning.interface', 'skins.deepsea' ) ); global $wgUser; $user = $wgUser->getName(); $globalCSS = "meta.brickimedia.org/index.php/User:$user/global.css"; $wgResourceModules['skins.deepsea']['styles'][$globalCSS] = array( 'media' => 'screen' ); } } /** * QuickTemplate class for Deep sea skin * @ingroup Skins */ class DeepSeaTemplate extends BaseTemplate { /* Functions */ /** * Outputs the entire contents of the (X)HTML page */ public function execute() { global $wgVectorUseIconWatch; // Build additional attributes for navigation urls $nav = $this->data['content_navigation']; if ( $wgVectorUseIconWatch ) { $mode = $this->getSkin()->getUser()->isWatched( $this->getSkin()->getTitle() ) ? '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 ) { 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 ( isset( $link['class'] ) ) { $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars( $link['class'] ) . '"'; unset( $nav[$section][$key]['class'] ); } if ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) { $nav[$section][$key]['key'] = Linker::tooltip( $xmlID ); } else { $nav[$section][$key]['key'] = Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) ); } } } $this->data['namespace_urls'] = $nav['namespaces']; $this->data['view_urls'] = $nav['views']; $this->data['action_urls'] = $nav['actions']; $this->data['variant_urls'] = $nav['variants']; // Reverse horizontally rendered navigation elements if ( $this->data['rtl'] ) { $this->data['view_urls'] = array_reverse( $this->data['view_urls'] ); $this->data['namespace_urls'] = array_reverse( $this->data['namespace_urls'] ); $this->data['personal_urls'] = array_reverse( $this->data['personal_urls'] ); } // Output HTML Page $this->html( 'headelement' ); ?>
>
data['sitenotice'] ) { ?>
html( 'sitenotice' ) ?>
getIndicators(); } ?>

html( 'title' ) ?>

data['isarticle'] ) { ?>
msg( 'tagline' ) ?>
html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
data['undelete'] ) { ?>
html( 'undelete' ) ?>
data['newtalk'] ) { ?>
html( 'newtalk' ) ?>
data['showjumplinks'] ) { ?> html( 'bodycontent' ); ?> data['printfooter'] ) { ?>
html( 'printfooter' ); ?>
data['catlinks'] ) { ?> html( 'catlinks' ); ?> data['dataAfterContent'] ) { ?> html( 'dataAfterContent' ); ?>
html( 'debughtml' ); ?>
renderNavigation( 'MEDIA' ); ?> renderNavigation( 'PERSONAL' ); ?>
renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?>
renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?>
renderPortals( $this->data['sidebar'] ); ?>
printTrail(); ?> $content ) { if ( $content === false ) continue; echo "\n\n"; switch( $name ) { case 'SEARCH': break; case 'TOOLBOX': $this->renderPortal( 'tb', $this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd' ); break; case 'LANGUAGES': if ( $this->data['language_urls'] ) { $this->renderPortal( 'lang', $this->data['language_urls'], 'otherlanguages' ); } break; default: $this->renderPortal( $name, $content ); break; } echo "\n\n"; } } private function renderPortal( $name, $content, $msg = null, $hook = null ) { if ( $msg === null ) { $msg = $name; } ?>
>
html( 'userlangattributes' ) ?>>exists() ? $msgObj->text() : $msg ); ?>
getSkin()->getSkinStylePath() unfortunately only works for core skins... $imgPath = $wgStylePath . '/DeepSea/deepsea/'; // If only one element was given, wrap it in an array, allowing more // flexible arguments if ( !is_array( $elements ) ) { $elements = array( $elements ); // If there's a series of elements, reverse them when in RTL mode } elseif ( $this->data['rtl'] ) { $elements = array_reverse( $elements ); } // Render elements foreach ( $elements as $name => $element ) { echo "\n\n"; switch ( $element ) { // @todo FIXME: there should be an