User:AGreatUsernameChoice/common.php

 true,

'fixedNavBar' => false,

'usePivotTabs' => false,

'showHelpUnderTools' => true,

'showRecentChangesUnderTools' => true,

'wikiName' => &$GLOBALS['wgSitename'],

'wikiNameDesktop' => &$GLOBALS['wgSitename'],

'navbarIcon' => false,

'preloadFontAwesome' => false,

'showFooterIcons' => false,

'addThisPUBID' => '',

'useAddThisShare' => '',

'useAddThisFollow' => ''

);

foreach ($wgPivotFeaturesDefaults as $fgOption => $fgOptionValue) {

if ( !isset($wgPivotFeatures[$fgOption]) ) {

$wgPivotFeatures[$fgOption] = $fgOptionValue;

}

}

if ( $wgPivotFeatures['preloadFontAwesome'] ) {

$out->addHeadItem('font', '');

}

$out->addModuleStyles('skins.pivot.styles');

}

public function initPage(OutputPage $out) {

global $wgLocalStylePath;

parent::initPage($out);

$viewport_meta = 'width=device-width, user-scalable=yes, initial-scale=1.0';

$out->addMeta('viewport', $viewport_meta);

$out->addModules('skins.pivot.js');

}

}

class pivotTemplate extends BaseTemplate {

public function execute {

global $wgUser;

global $wgPivotFeatures;

wfSuppressWarnings;

$this->html('headelement');

switch ($wgPivotFeatures['usePivotTabs']) {

case true:

ob_start;

$this->html('bodytext');

$out = ob_get_contents;

ob_end_clean;

$markers = array("&lt;a", "&lt;/a", "&gt;");

$tags = array("");

$body = str_replace($markers, $tags, $out);

break;

default:

$body = '';

break;

}

switch ($wgPivotFeatures['showFooterIcons']) {

case true:

$poweredbyType = "icononly";

$poweredbyMakeType = 'withImage';

break;

default:

$poweredbyType = "nocopyright";

$poweredbyMakeType = 'withoutImage';

break;

}

?>







  



data['nav_urls']['mainpage']['href']; ?>">





text('sitename'); ?>" src="text('logopath'); ?>" style="max-width: 64px;height:auto; max-height:36px; display: inline-block; vertical-align:middle;">

<?php } ?>

<?php echo $wgPivotFeatures['wikiName']; ?> </a>

<section id="right-nav-aside" class="right-small">

<a href="#" class="right-off-canvas-toggle"> <i class="fa <?php if ($wgUser->isLoggedIn): ?>fa-user<?php else: ?>fa-navicon<?php endif; ?> fa-lg"></i> </a>

<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo " "; ?>

<aside class="left-off-canvas-menu">

<ul class="off-canvas-list">

<li class="has-form">

<form action="<?php $this->text( 'wgScript' ); ?>" id="searchform" class="mw-search">

<input type="search" name="search" placeholder="<?php echo wfMessage( 'search' )->text ?>" title="Search [alt-shift-f]" accesskey="f" id="searchInput-offcanvas" autocomplete="off">

</li>

<?php $this->renderSidebar ?>

</ul>

<aside class="right-off-canvas-menu">

<ul class="off-canvas-list">

<?php if ($wgUser->isLoggedIn): ?>

<li id="personal-tools"> Personal </li>

<?php foreach ($this->getPersonalTools as $key => $item) { echo $this->makeListItem($key, $item); } ?>

<?php else: ?>

<?php if (isset($this->data['personal_urls']['anonlogin'])): ?>

<li><a href="<?php echo $this->data['personal_urls']['anonlogin']['href']; ?>"><?php echo wfMessage( 'login' )->text ?></a></li>

<?php elseif (isset($this->data['personal_urls']['login'])): ?>

<li><a href="<?php echo htmlspecialchars($this->data['personal_urls']['login']['href']); ?>"><?php echo wfMessage( 'login' )->text ?></a></li>

<?php else: ?>

<li><?php echo Linker::link(Title::newFromText('Special:UserLogin'), wfMessage( 'login' )->text); ?></li>

<?php endif; ?>

<?php endif; ?>

</ul>

<section id="main-section" class="main-section" <?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "style='margin-top:2.8125em'"; ?>>

<ul class="side-nav">

<a href="<?php echo $this->data['nav_urls']['mainpage']['href']; ?>">

<img alt="<?php echo $this->text('sitename'); ?>" src="<?php echo $this->text('logopath') ?>" style="max-width: 100%;height: auto;display: inline-block; vertical-align: middle;"></a>

</li>

<li class="has-form">

<form action="<?php $this->text( 'wgScript' ); ?>" id="searchform" class="mw-search">

<input type="search" name="search" placeholder="<?php echo wfMessage( 'search' )->text ?>" title="Search [alt-shift-f]" accesskey="f" id="searchInput" autocomplete="off">

</li>

<?php $this->renderSidebar ?>

</ul>

<?php echo $this->getIndicators; ?>

<?php if ($wgUser->isLoggedIn): ?>

<?php endif; ?>

<?php if ( $this->data['sitenotice'] ) { ?> <?php $this->html( 'sitenotice' ); ?> <?php } ?>

<?php if ( $this->data['newtalk'] ) { ?> <?php $this->html( 'newtalk' ); ?> <?php } ?>

<?php if ($wgUser->isLoggedIn || $wgPivotFeatures['showActionsForAnon']): ?>

<a href="#" data-options="align:left" data-dropdown="drop1" class="button secondary small radius pull-right hide-for-print" id="drop"><i class="fa fa-navicon fa-lg"> <?php echo wfMessage( 'actions' )->text ?> </i></a>

<ul id="drop1" class="tiny content f-dropdown" data-dropdown-content>

<?php foreach($this->data['content_actions'] as $key => $tab) { echo preg_replace(array('/\sprimary="1"/', '/\scontext="[a-z]+"/', '/\srel="archives"/'),'',$this->makeListItem($key, $tab)); } ?>

<?php Hooks::run( 'SkinTemplateToolboxEnd', array( &$this, true )); ?>

</ul>

<?php endif;

$namespace = str_replace('_', ' ', $this->getSkin->getTitle->getNsText);

$displaytitle = $this->data['title'];

if (!empty($namespace)) {

$pagetitle = $this->getSkin->getTitle;

$newtitle = str_replace($namespace.':', '', $pagetitle);

$displaytitle = str_replace($pagetitle, $newtitle, $displaytitle);

?><h4 class="namespace label"><?php print $namespace; ?> <?php } ?>

<?php print $displaytitle; ?>

<?php if ($wgPivotFeatures['useAddThisShare'] !== '') { ?>

<div class="<?php echo $wgPivotFeatures['useAddThisShare']; ?> hide-for-print">

<?php } ?>

<?php if ( $this->data['isarticle'] ) { ?> <?php $this->msg( 'tagline' ) ?> <?php } ?>

<?php if ( $this->html('subtitle') ) { ?><h5 id="sitesub" class="subtitle"><?php $this->html('subtitle') ?> <?php } ?>

<div id="contentSub" class="clear_both">

<?php

switch ($wgPivotFeatures['usePivotTabs']) {

case true:

echo $body;

break;

default:

$this->html('bodytext');

break;

}

?>

<div class="clear_both">

<?php $this->html('catlinks'); ?>

<?php $this->html('dataAfterContent'); ?>

<ul id="footer-left">

<?php foreach ($this->getFooterLinks("flat") as $key) { ?>

<li id="footer-<?php echo $key ?>"><?php $this->html($key) ?></li>

<?php } ?>

</ul>

<ul id="footer-right">

<li class="social-follow hide-for-print">

<?php if ($wgPivotFeatures['useAddThisFollow'] !== '') { ?>

<div class="<?php echo $wgPivotFeatures['useAddThisFollow']; ?> hide-for-print">

<?php } ?>

</li>

<?php foreach ($this->getFooterIcons($poweredbyType) as $blockName => $footerIcons) { ?>

<li class="<?php echo $blockName ?>"><?php foreach ($footerIcons as $icon) { ?>

<?php echo $this->getSkin->makeFooterIcon($icon, $poweredbyMakeType); ?>

<?php } ?>

</li>

<?php } ?>

</ul>

<a class="exit-off-canvas"></a>

<?php $this->printTrail; ?>

<?php if ($this->data['isarticle'] && $wgPivotFeatures['addThisPUBID'] !== '') { ?>

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgPivotFeatures['addThisPUBID']; ?>" async="async">

<?php } ?>

<?php

wfRestoreWarnings;

}

function renderSidebar {

$sidebar = $this->getSidebar;

foreach ($sidebar as $boxName => $box) {

echo '<li><label class="sidebar" id="'.Sanitizer::escapeId( $box['id'] ).'"';echo Linker::tooltip( $box['id'] ).'>'.htmlspecialchars( $box['header'] ).' </li>';

if ( is_array( $box['content'] ) ) {

foreach ($box['content'] as $key => $item) { echo $this->makeListItem($key, $item); }

}

}

return;	}

}

?>