[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Modern skin, derived from monobook template. 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License along 16 * with this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 * http://www.gnu.org/copyleft/gpl.html 19 * 20 * @todo document 21 * @file 22 * @ingroup Skins 23 */ 24 25 if ( !defined( 'MEDIAWIKI' ) ) { 26 die( -1 ); 27 } 28 29 /** 30 * Inherit main code from SkinTemplate, set the CSS and template filter. 31 * @todo document 32 * @ingroup Skins 33 */ 34 class SkinModern extends SkinTemplate { 35 public $skinname = 'modern'; 36 public $template = 'ModernTemplate'; 37 38 /** 39 * @param OutputPage $out 40 */ 41 function setupSkinUserCss( OutputPage $out ) { 42 parent::setupSkinUserCss( $out ); 43 $out->addModuleStyles( 'skins.modern' ); 44 } 45 } 46 47 /** 48 * @todo document 49 * @ingroup Skins 50 */ 51 class ModernTemplate extends MonoBookTemplate { 52 53 /** 54 * Template filter callback for Modern skin. 55 * Takes an associative array of data set from a SkinTemplate-based 56 * class, and a wrapper for MediaWiki's localization database, and 57 * outputs a formatted page. 58 * 59 * @access private 60 */ 61 function execute() { 62 // Suppress warnings to prevent notices about missing indexes in $this->data 63 wfSuppressWarnings(); 64 65 $this->html( 'headelement' ); 66 ?> 67 68 <!-- heading --> 69 <div id="mw_header"><h1 id="firstHeading" lang="<?php 70 $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode(); 71 $this->text( 'pageLanguage' ); 72 ?>"><span dir="auto"><?php $this->html( 'title' ) ?></span></h1></div> 73 74 <div id="mw_main"> 75 <div id="mw_contentwrapper"> 76 <!-- navigation portlet --> 77 <?php $this->cactions(); ?> 78 79 <!-- content --> 80 <div id="mw_content" role="main"> 81 <!-- contentholder does nothing by default, but it allows users to style the text inside 82 the content area without affecting the meaning of 'em' in #mw_content, which is used 83 for the margins --> 84 <div id="mw_contentholder" class="mw-body"> 85 <div class='mw-topboxes'> 86 <div id="mw-js-message" 87 style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div> 88 <div class="mw-topbox" id="siteSub"><?php $this->msg( 'tagline' ) ?></div> 89 <?php 90 if ( $this->data['newtalk'] ) { 91 ?> 92 <div class="usermessage mw-topbox"><?php $this->html( 'newtalk' ) ?></div> 93 <?php 94 } 95 ?> 96 <?php 97 if ( $this->data['sitenotice'] ) { 98 ?> 99 <div class="mw-topbox" id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div> 100 <?php 101 } 102 ?> 103 </div> 104 105 <div id="contentSub"<?php 106 $this->html( 'userlangattributes' ) 107 ?>><?php 108 $this->html( 'subtitle' ) 109 ?></div> 110 111 <?php 112 if ( $this->data['undelete'] ) { 113 ?> 114 <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div><?php 115 } 116 ?> 117 <div id="jump-to-nav"><?php $this->msg( 'jumpto' ) ?> 118 <a href="#mw_portlets"><?php 119 $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) 120 ?> 121 <a href="#searchInput"><?php $this->msg( 'jumptosearch' ) ?></a> 122 </div> 123 124 <?php $this->html( 'bodytext' ) ?> 125 <div class='mw_clear'></div> 126 <?php 127 if ( $this->data['catlinks'] ) { 128 $this->html( 'catlinks' ); 129 } 130 ?> 131 <?php $this->html( 'dataAfterContent' ) ?> 132 </div><!-- mw_contentholder --> 133 </div><!-- mw_content --> 134 </div><!-- mw_contentwrapper --> 135 136 <div id="mw_portlets"<?php $this->html( "userlangattributes" ) ?>> 137 <h2><?php $this->msg( 'navigation-heading' ) ?></h2> 138 139 <!-- portlets --> 140 <?php $this->renderPortals( $this->data['sidebar'] ); ?> 141 142 </div><!-- mw_portlets --> 143 144 145 </div><!-- main --> 146 147 <div class="mw_clear"></div> 148 149 <!-- personal portlet --> 150 <div class="portlet" id="p-personal" role="navigation"> 151 <h3><?php $this->msg( 'personaltools' ) ?></h3> 152 153 <div class="pBody"> 154 <ul> 155 <?php 156 foreach ( $this->getPersonalTools() as $key => $item ) { 157 ?> 158 <?php echo $this->makeListItem( $key, $item ); ?> 159 160 <?php 161 } 162 ?> 163 </ul> 164 </div> 165 </div> 166 167 168 <!-- footer --> 169 <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>> 170 <ul id="f-list"> 171 <?php 172 foreach ( $this->getFooterLinks( "flat" ) as $aLink ) { 173 if ( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { 174 ?> 175 <li id="<?php echo $aLink ?>"><?php $this->html( $aLink ) ?></li> 176 <?php 177 } 178 } 179 ?> 180 </ul> 181 <?php 182 foreach ( $this->getFooterIcons( "nocopyright" ) as $blockName => $footerIcons ) { 183 ?> 184 <div id="mw_<?php echo htmlspecialchars( $blockName ); ?>"> 185 <?php 186 foreach ( $footerIcons as $icon ) { 187 ?> 188 <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?> 189 190 <?php 191 } ?> 192 </div> 193 <?php 194 } 195 ?> 196 </div> 197 198 <?php $this->printTrail(); ?> 199 200 </body> 201 </html> 202 <?php 203 wfRestoreWarnings(); 204 } // end of execute() method 205 } // end of class
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |