3 * Copyright (c) 2015 Marcin Cieślak (saper.info)
5 * This file is part of Beagle Skin for Mediawiki.
7 * Beagle skin is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * Beagle is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Beagle. If not, see <http://www.gnu.org/licenses/>.
23 * Inherit main code from SkinTemplate, set the CSS and template filter.
26 class SkinBeagle
extends SkinTemplate
{
27 var $skinname = 'beagle', $stylename = 'beagle',
28 $template = 'BeagleTemplate', $useHeadElement = true;
30 public function initPage( OutputPage
$out ) {
31 parent
::initPage( $out );
34 * Add CSS via ResourceLoader
36 * @param $out OutputPage
38 function setupSkinUserCss( OutputPage
$out ) {
39 parent
::setupSkinUserCss( $out );
40 $out->addModuleStyles( array(
51 class BeagleTemplate
extends BaseTemplate
{
53 $skin = $this->getSkin();
54 $body = $this->data
['bodycontent'];
56 $skin_path = $this->data
['stylepath'].'/'.$this->data
['stylename'];
58 // Suppress warnings to prevent notices about missing indexes in $this->data
62 $this->html( 'headelement' );
64 unset( $dd[ 'headelement' ] );
65 unset( $dd[ 'bodycontent' ] );
66 unset( $dd[ 'skin' ] );
67 wfDebugLog( 'BeagleSkin', var_export( $dd, TRUE ) );
69 ?
><!-- START main page container
-->
70 <div id
="pagecontainer">
72 <!-- START subsection header
and subnav
-->
76 <hr
class="clear spacing" />
79 $sidebar = $this->getSidebar();
80 $content = $sidebar[ 'navigation' ][ 'content' ];
82 if ( is_array( $content ) ) : ?
>
83 <ul id
="nav-top"><?php
84 foreach( $content as $item ) {
85 print $this->makeListItem( $item[ 'id' ], $item );
87 <li
class="cheat"></li
>
92 <div id
="content-body">
93 <div id
="articleBody">
95 <a name
="top" id
="contentTop"></a
>
96 <?php
if( $this->data
[ 'sitenotice' ]) : ?
>
97 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
><?php
endif; ?
>
98 <div id
="articleContent">
99 <div id
="contentSub"><?php
$this->html( 'subtitle' ) ?
></div
>
100 <?php
if ( $this->data
[ 'undelete' ] ) : ?
>
101 <div id
="contentSub2"><?php
$this->html('undelete') ?
></div
>
103 <?php
if ( $this->data
[ 'newtalk' ] ) : ?
>
104 <div id
="usermessage"><?php
$this->html('newtalk') ?
></div
>
106 <?php
if($this->data
['showjumplinks']) : ?
>
107 <div id
="jump-to-nav"><?php
$this->msg( 'jumpto' ) ?
> <a href
="#nav_top"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>, <a href
="#searchInput"><?php
$this->msg( 'jumptosearch' ) ?
></a
></div
>
109 <!-- START content
-->
110 <?php
$this->html( 'bodytext' ); ?
>
111 <?php
if( $this->data
[ 'catlinks' ] ) { $this->html( 'catlinks' ); } ?
>
114 </div
><!-- aricleContent
-->
115 </div
><!-- articleBody
-->
116 </div
><!-- content
-body
-->
118 <div id
="article-info">
119 <?php
if( $this->data
[ 'lastmod' ] ) : ?
>
120 <?php
$this->html( 'lastmod' ) ?
>
122 <?php
if( $this->data
[ 'viewcount' ] ) : ?
>
123 <?php
$this->html( 'viewcount' ) ?
>
127 </div
><!-- content
-->
128 <hr
class="clear dotted spacing" />
129 <?php
$this->html( 'dataAfterContent' ); ?
>
131 <ul
class="nav-bottom">
132 <?php
foreach( $this->getPersonalTools() as $key => $action ) {
133 print "\t" . $this->makeListItem( $key, $action ) . "\n";
137 <ul
class="nav-bottom">
138 <?php
foreach( $this->data
[ 'content_actions' ] as $key => $action ) {
139 print "\t" . $this->makeListItem( $key, $action ) . "\n";
142 <?php
if ( $this->data
['language_urls'] ): ?
>
143 <ul
class="nav-bottom">
144 <?php
foreach ( $this->data
['language_urls'] as $key => $langLink ) {
145 print "\t" . $this->makeListItem( $key, $langLink ) . "\n";
150 <div
class="searchForm">
151 <form id
="searchForm" class="searchForm" name
="searchForm" action
="<?php $this->text('searchaction') ?>">
152 <input type
="hidden" name
="title" value
="<?php $this->text( 'searchtitle' ) ?>" />
153 <?php
print $this->makeSearchInput(); ?
>
155 <?php
print $this->makeSearchButton( 'go' ); ?
>
157 <?php
print $this->makeSearchButton( 'fulltext' ); ?
>
162 <?php
if( $this->data
['notspecialpage'] ): ?
>
163 <ul
class="nav-bottom">
165 foreach( array( 'whatlinkshere', 'recentchanges', 'recentchangeslinked', 'upload', 'specialpages' ) as $special ) {
167 if ( $special === 'recentchanges' ) {
168 $d[ 'id' ] = 'nn-recentchanges';
169 $d[ 'text' ] = $this->getMsg( 'recentchanges' );
170 $rc = $this->getMsg( 'recentchanges-url' )->inContentLanguage()->text();
171 $title = Title
::newFromText( $rc );
173 $d[ 'href' ] = $title->getLinkURL();
178 $d = $this->data
[ 'nav_urls' ][ $special ];
182 print "\t" . $this->makeListItem( $special, $d ) . "\n";
187 <div
class="poweredby"><?php
if ( $this->data
['poweredbyico'] ) : ?
>
188 <span id
="footer-poweredbyico"><?php
$this->html( 'poweredbyico' ) ?
></span
>
193 <hr
class="clear dotted spacing" />
195 <?php
$this->html( 'reporttime' ) ?
>
196 <?php
if ( $this->data
['debug'] ): ?
>
198 <?php
$this->text( 'debug' ); ?
>
203 $this->printTrail(); ?
>