3 * This file is a rewrite of the Beagle Project MediaWiki skin:
4 * http://web.archive.org/web/20090106025017/http://beagle-project.org/
7 * Beagle - modified from MonoBook
8 * by: Joe Shaw (joeshaw@novell.com)
9 * license: TBD, probably GPL
11 * Default artwork used:
12 * "Beagle puppy's head", extracted by Marcin Cieślak
13 * out of the photography by Wikimedia Commons user Juanelverdolaga
14 * https://commons.wikimedia.org/wiki/File:Beagle_puppy%27s_head.png
16 * Availabe under Creative Commons Attribution-Share Alike 4.0:
17 * https://creativecommons.org/licenses/by-sa/4.0/deed.en
21 * Inherit main code from SkinTemplate, set the CSS and template filter.
24 class SkinBeagle
extends SkinTemplate
{
25 var $skinname = 'beagle', $stylename = 'beagle',
26 $template = 'BeagleTemplate', $useHeadElement = true;
28 public function initPage( OutputPage
$out ) {
29 global $wgBeagleImage;
30 parent
::initPage( $out );
31 $out->addInlineStyle( "#header h1 { background: transparent " .
32 "url(" . ( $wgBeagleImage ?
:
33 $this->getSkinStylePath( '/bigielbanner.png' ) . ") " .
36 $out->addModuleStyles( array(
41 * Add CSS via ResourceLoader
43 * @param $out OutputPage
45 function setupSkinUserCss( OutputPage
$out ) {
46 parent
::setupSkinUserCss( $out );
55 class BeagleTemplate
extends BaseTemplate
{
57 function sel( $sel ) {
60 return ' id="' . substr( $sel, 1 ) . '"';
62 return ' class="' . $sel . '"';
67 function div ( $sel = false, $role = false) {
68 print "<div" . $this->sel( $sel );
69 if ( $role ) print " role=\"$role\"";
73 function div_ends ( $sel = false ) {
77 function div_html( $dataitem, $sel ) {
78 if ( $this->data
[ $dataitem ] ) {
80 $this->html( $dataitem );
81 $this->div_ends( $sel );
85 function div_span_html( $dataitem, $sel, $span = false ) {
86 if ( $this->data
[ $dataitem ] ) {
88 if ( $span ) { print "<span" . $this->sel( $span ) . ">" ; }
89 $this->html( $dataitem );
90 if ( $span ) { print "</span>"; }
91 $this->div_ends( $sel );
95 function a_href_msg( $target_id, $msg ) {
96 print " <a href=\"$target_id\">";
101 function jumplinks() {
102 if ( $this->data
['showjumplinks'] ) {
103 $this->div( '#jump-to-nav' );
104 $this->msg( 'jumpto' );
105 $this->a_href_msg( '#nav_top', 'jumptonavigation' );
107 $this->a_href_msg( '#searchInput', 'jumptosearch' );
108 $this->div_ends( '#jump-to-nav' );
112 function data_html( $dataitem ) {
113 if ( $this->data
[ $dataitem ] )
114 $this->html( $dataitem );
117 function data_rem( $dataitem ) {
118 if ( $this->data
[ $dataitem ] ) {
119 print "<!-- Debug output:\n";
120 $this->text( $dataitem );
125 function ul_list( $source, $sel, $last_item = false ) {
126 if ( $source && is_array( $source ) ) {
127 print "<ul" . $this->sel( $sel ) . ">\n";
128 foreach( $source as $key => $action ) {
129 print "\t" . $this->makeListItem( $key, $action ) . "\n";
132 print "\t" . $last_item . "\n";
137 function ul_html ( $source ) {
138 if ( $source && is_array( $source ) ) {
139 print "<ul class=\"nav-bottom\">\n";
140 foreach( $source as $key ) {
142 print $this->html( $key );
149 function ul_plain ( $source ) {
150 if ( $source && is_array( $source ) ) {
151 print "<ul class=\"nav-bottom\">\n";
152 foreach( $source as $value ) {
161 function nav_top( $source ) {
163 $this->ul_list( $source, '#nav-top', '<li class="cheat"></li>' );
167 function nav_bottom( $source ) {
169 $this->ul_list( $source, 'nav-bottom' );
173 function recent_changes_link() {
175 $d[ 'id' ] = 'nn-recentchanges';
176 $d[ 'text' ] = $this->getMsg( 'recentchanges' );
177 $rc = $this->getMsg( 'recentchanges-url' )->inContentLanguage()->text();
178 $title = Title
::newFromText( $rc );
180 $d[ 'href' ] = $title->getLinkURL();
187 function main_bar_source() {
188 $sidebar = $this->getSidebar();
190 if ( isset( $sidebar[ 'navigation' ] ) )
191 if ( isset( $sidebar[ 'navigation' ][ 'content' ] ) )
192 return $sidebar[ 'navigation' ][ 'content' ];
196 function special_pages_source() {
197 $source = $this->getToolbox();
198 $source [ 'recentchanges' ] = $this->recent_changes_link();
202 function page_info() {
203 $this->div( '#article_info', 'contentinfo' );
204 $this->data_html( 'lastmod' );
205 $this->data_html( 'viewcount' );
206 $this->div_ends( '#article_info ');
209 function footer_icons() {
211 foreach ( $this->getFooterIcons( 'icononly' ) as $blockName => $footerIcons )
212 foreach ( $footerIcons as $icon )
213 array_push ( $source, $this->getSkin()->makeFooterIcon( $icon ) );
217 function search_form() { ?
>
218 <div
class="searchForm" role
="search">
219 <form id
="searchForm" class="searchForm" name
="searchForm" action
="<?php $this->text('searchaction') ?>">
220 <input type
="hidden" name
="title" value
="<?php $this->text( 'searchtitle' ) ?>" />
221 <?php
print $this->makeSearchInput(); ?
>
223 <?php
print $this->makeSearchButton( 'go' ); ?
>
225 <?php
print $this->makeSearchButton( 'fulltext' ); ?
>
232 function dotted_spacing() {
233 print "<hr class=\"clear dotted spacing\" />\n";
237 $skin = $this->getSkin();
238 $body = $this->data
['bodycontent'];
240 $skin_path = $this->data
['stylepath'].'/'.$this->data
['stylename'];
243 $this->html( 'headelement' );
245 ?
><!-- START main page container
-->
246 <div id
="pagecontainer">
248 <!-- START subsection header
and subnav
-->
250 <h1
><?php
$this->text( 'pagetitle' ) ?
></h1
>
252 <hr
class="clear spacing" />
254 $this->nav_top( $this->main_bar_source() );
256 <div id
="content" role
="main">
257 <div id
="content-body">
258 <div id
="articleBody">
260 <?php
$this->div_html( 'sitenotice', '#siteNotice' ); ?
>
261 <div id
="articleContent">
263 $this->div_html( 'subtitle', '#contentSub' );
264 $this->div_html( 'undelete', '#contentSub2' );
265 $this->div_html( 'newtalk', '#usermessage' );
267 $this->html( 'bodytext' );
268 $this->data_html( 'catlinks' );
270 </div
><!-- aricleContent
-->
271 </div
><!-- articleBody
-->
272 </div
><!-- content
-body
-->
275 print $this->getIndicators();
278 </div
><!-- content
-->
280 $this->dotted_spacing();
281 $this->html( 'dataAfterContent' );
283 $this->nav_bottom( $this->getPersonalTools() );
284 $this->nav_bottom( $this->data
[ 'content_actions' ] );
285 $this->nav_bottom( $this->data
[ 'language_urls' ] );
286 $this->search_form();
287 $this->nav_bottom( $this->special_pages_source() );
288 Hooks
::Run( 'SkinTemplateToolboxEnd', array( &$this ) );
289 # $this->ul_html( $this->getFooterLinks( )[ 'places' ] );
290 $this->ul_plain( $this->footer_icons() );
292 $this->dotted_spacing();
294 $this->html( 'reporttime' );
295 $this->data_rem( 'debug' );
296 $this->printTrail(); ?
>