1
0
mirror of https://github.com/Hutchy68/pivot.git synced 2024-11-21 18:09:03 +01:00

improvements, update to readme.md with config settings

This commit is contained in:
Tom Hutchison 2015-10-03 19:09:14 -04:00
parent c76ba86d9f
commit efe9bb809b
3 changed files with 156 additions and 65 deletions

View File

@ -16,15 +16,17 @@ class Skinpivot extends SkinTemplate {
global $wgPivotFeatures;
$wgPivotFeaturesDefaults = array(
'showActionsForAnon' => true,
'NavWrapperType' => '0',
'fixedNavBar' => false,
'showHelpUnderTools' => true,
'showRecentChangesUnderTools' => true,
'wikiName' => &$GLOBALS['wgSitename'],
'wikiNameDesktop' => &$GLOBALS['wgSitename'],
'navbarIcon' => false,
'navbarIcon' => true,
'IeEdgeCode' => 1,
'showFooterIcons' => 0,
'addThisFollowPUBID' => ''
'showFooterIcons' => false,
'addThisPUBID' => '',
'useAddThisShare' => false,
'useAddThisFollow' => false
);
foreach ($wgPivotFeaturesDefaults as $fgOption => $fgOptionValue) {
if ( !isset($wgPivotFeatures[$fgOption]) ) {
@ -61,16 +63,6 @@ class pivotTemplate extends BaseTemplate {
global $wgPivotFeatures;
wfSuppressWarnings();
$this->html('headelement');
switch ($wgPivotFeatures['NavWrapperType']) {
case '0':
break;
case 'divonly':
echo "<div id='navwrapper'>";
break;
default:
echo "<div id='navwrapper' class='". $wgPivotFeatures['NavWrapperType']. "'>";
break;
}
switch ($wgPivotFeatures['usePivotTabs']) {
case 'true':
ob_start();
@ -84,24 +76,46 @@ class pivotTemplate extends BaseTemplate {
default:
break;
}
switch ($wgPivotFeatures['showFooterIcons']) {
case true:
$footerLeftClass = 'small-12 medium-8 large-9 columns';
$footerRightClass = 'small-12 medium-4 large-3 columns';
$poweredbyType = "icononly";
$poweredbyMakeType = 'withImage';
break;
default:
$footerLeftClass = 'small-12 medium-8 large-9 columns';
$footerRightClass = 'small-12 medium-4 large-3 columns';
$poweredbyType = "nocopyright";
$poweredbyMakeType = 'withoutImage';
break;
}
?>
<!-- START FOREGROUNDTEMPLATE -->
<div class="off-canvas-wrap docs-wrap" data-offcanvas="">
<div class="inner-wrap">
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "<div class='fixed'>";?>
<nav class="tab-bar">
<section class="left-small show-for-small">
<a class="left-off-canvas-toggle"><span id="menu-user"><i class="fa fa-navicon fa-lg"></i></span></a>
</section>
<section class="middle tab-bar-section">
<h1 class="title"><a href="<?php echo $this->data['nav_urls']['mainpage']['href']; ?>"><span class="show-for-medium-up"><?php echo $wgPivotFeatures['wikiNameDesktop']; ?></span><span class="show-for-small-only"><?php echo $wgPivotFeatures['wikiName']; ?></span></a></h1>
<h1 class="title"><a href="<?php echo $this->data['nav_urls']['mainpage']['href']; ?>">
<span class="show-for-medium-up"><?php echo $wgPivotFeatures['wikiNameDesktop']; ?></span>
<span class="show-for-small-only">
<?php if ($wgPivotFeatures['navbarIcon'] != false) { ?>
<img alt="<?php echo $this->text('sitename'); ?>" src="<?php echo $this->text('logopath'); ?>" style="max-width: 64px;height:auto; max-height:36px; display: inline-block; vertical-align:middle;">
<?php } ?>
<?php echo $wgPivotFeatures['wikiName']; ?></span></a></h1>
</section>
<section class="right-small">
<a class="right-off-canvas-toggle"><span id="menu-user"><i class="fa fa-user fa-lg"></i></span></a>
</section>
</nav>
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "</div>";?>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
@ -143,8 +157,7 @@ class pivotTemplate extends BaseTemplate {
</ul>
</aside>
<section class="main-section">
<?php if ($wgPivotFeatures['NavWrapperType'] != '0') echo "</div>"; ?>
<section class="main-section" <?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "style='margin-top:2.8125em'"; ?>>
<div id="page-content">
@ -194,7 +207,7 @@ class pivotTemplate extends BaseTemplate {
</div>
<?php if ($wgUser->isLoggedIn() || $wgPivotFeatures['showActionsForAnon']): ?>
<a href="#" data-options="align:left" data-dropdown="drop1" class="button secondary small radius pull-right" id="drop"><i class="fa fa-navicon fa-lg"><span id="page-actions" class="show-for-medium-up">&nbsp;Page&nbsp;<?php echo wfMessage( 'actions' )->text() ?></span></i></a>
<a href="#" data-options="align:left" data-dropdown="drop1" class="button secondary small radius pull-right" id="drop"><i class="fa fa-navicon fa-lg"><span id="page-actions" class="show-for-medium-up">&nbsp;<?php echo wfMessage( 'actions' )->text() ?></span></i></a>
<ul id="drop1" class="tiny content f-dropdown" data-dropdown-content>
<?php foreach( $this->data['content_actions'] as $key => $item ) { echo preg_replace(array('/\sprimary="1"/','/\scontext="[a-z]+"/','/\srel="archives"/'),'',$this->makeListItem($key, $item)); } ?>
<?php wfRunHooks( SkinTemplateToolboxEnd, array( &$this, true ) ); ?>
@ -211,6 +224,10 @@ class pivotTemplate extends BaseTemplate {
$displaytitle = str_replace($pagetitle, $newtitle, $displaytitle);
?><h4 class="namespace label"><?php print $namespace; ?></h4><?php } ?>
<h2 class="title"><?php print $displaytitle; ?></h2>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_sharing_toolbox show-for-large-up"></div>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<!-- moved to resource loader <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50f7269b339fed7f" async="async"></script> -->
<?php if ( $this->data['isarticle'] ) { ?><h3 id="tagline"><?php $this->msg( 'tagline' ) ?></h3><?php } ?>
<h5 class="subtitle"><?php $this->html('subtitle') ?></h5>
<div class="clear_both"></div>
@ -234,18 +251,33 @@ class pivotTemplate extends BaseTemplate {
<footer class="row">
<ul class="large-12 columns">
<div id="footer">
<div id="footer-left" class="<?php echo $footerLeftClass;?>">
<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> <?php foreach ( $this->getFooterIcons( "nocopyright" ) as $blockName => $footerIcons ) { ?>
</div>
<div id="footer-right-icons" class="<?php echo $footerRightClass;?>">
<ul id="footer-right">
<li class="social-follow">
<?php if ($wgPivotFeatures['addThisFollow'] != false) { ?>
<div class="social-links">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_horizontal_follow_toolbox show-for-large-up"></div>
</div>
<?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, 'withoutImage' ); ?>
<?php echo $this->getSkin()->makeFooterIcon( $icon, $poweredbyMakeType ); ?>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
</div>
</footer>
</div>
@ -261,6 +293,9 @@ class pivotTemplate extends BaseTemplate {
<?php $this->printTrail(); ?>
<?php if ($wgForegroundFeatures['addThisFollowPUBID'] != '') { ?>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgForegroundFeatures['addThisPUBID'];?>" async="async">></script>
<?php } ?>
</body>
</html>

View File

@ -37,20 +37,32 @@ To activate Pivot for all users and anonymous visitors, you need to set the `$wg
Use following features in `LocalSettings.php` to change the behavior.
- `showActionsForAnon => true` displays page actions for non-logged-in visitors.
- `NavWrapperType => 'divonly'`: only a div with id `navwrapper` will be created. `'0'` - no div will be created (old behavior), other values will be used as class.
- `showHelpUnderTools => true` a Link to "Help" will be created under "Tools".
- `showRecentChangesUnderTools => true` a Link to "recent changes" will be created under "Tools".
- `IeEdgeCode => 1` will produce a meta tag with "X-UA-Compatible" content="IE=edge", `2` will sent a header, `0` nothing will be done
- `'showActionsForAnon' => true` displays page actions for non-logged-in visitors.
- `'showHelpUnderTools' => true` a Link to "Help" will be created under "Tools".
- `'showRecentChangesUnderTool's => true` a Link to "recent changes" will be created under "Tools".
- `'IeEdgeCode' => 1` will produce a meta tag with "X-UA-Compatible" content="IE=edge", `2` will sent a header, `0` nothing will be done
- `'fixedNavBar' => false` will allow the NavBar to scroll with the content, `true` will lock the NavBar.
- `'navbarIcon' => false` no icon in mobile view, `true` to use the global set logopath image of the wiki.
- `'showFooterIcons' => false` will show text in place of footer icons, `true` will output the icons as globally set.
- `'addThisPUBID' => '' empty string will not fire the AddThis script, `'ra-##-#######'` publisher ID will allow the run the AddThis script in async.
- `'useAddThisShare' => false` default, do not use AddThis share, `true` will insert the share toolbox div directly under page title, but before the tagline.
- `'useAddThisFollow' => false` default, do not use AddThis follow, `true` will insert the follow toolbox div in the `right-footer` area before icon or text output.
These are the default values:
$wgPivotFeatures = array(
'showActionsForAnon' => true,
'NavWrapperType' => 'divonly',
'fixedNavBar' => false,
'showHelpUnderTools' => true,
'showRecentChangesUnderTools' => true,
'IeEdgeCode' => 1
'wikiName' => &$GLOBALS['wgSitename'],
'wikiNameDesktop' => &$GLOBALS['wgSitename'],
'navbarIcon' => false,
'IeEdgeCode' => 1,
'showFooterIcons' => false,
'addThisPUBID' => '',
'useAddThisShare' => false,
'useAddThisFollow' => false
);
### Usage of NavWrapperType

View File

@ -184,27 +184,16 @@ div.small-9.columns textarea {
margin-bottom: 0.25em;
}
footer.row {
padding-top: 1.5em;
text-align: center;
font-size: .8em;
color: #333;
max-width: 100%;
background-color: #fff;
}
div {
line-height: 1.60em;
}
/* NOTICES, ALERTS, WARNINGS */
div#userloginprompt, p#userloginlink {
font-size: 80%;
}
/* LISTS */
ul#drop1.f-dropdown {
@ -224,15 +213,6 @@ ul#drop1.f-dropdown {
margin: .5em 0 1em 2em;
}
footer.row ul {
list-style-type: none;
margin: .5em 0em;
}
footer.row ul.views.columns li {
margin-right: 1em;
}
.columns ul.special li {
float:none;
width: 100%;
@ -264,10 +244,6 @@ footer.row ul.views.columns li {
.mw-specialpages-table td ul.columns li {width: 50%;}
/*#mw-content-text .columns li {float:none;width:90%;}*/
footer.row ul.columns li { display: inline;float:none;}
.columns #mw-normal-catlinks ul li {
float: none;
width: auto;
@ -279,6 +255,66 @@ footer.row ul.columns li { display: inline;float:none;}
ul.vcard { padding: 0.5em 0.5em 0.55em 0.5em; }
/*#mw-content-text .columns li {float:none;width:90%;}*/
/* Footer Classes */
footer.row ul.columns li { display: inline;float:none;}
footer.row ul {
list-style-type: none;
margin: .5em 0em;
}
footer.row ul.views.columns li {
margin-right: 1em;
}
footer.row {
border-top: 1px solid #c3c3e5;
padding-top: 1em;
padding-bottom: 2em;
color: #333;
max-width: 100%;
background-color: #fff;
}
@media only screen and (min-width: 1025px) { footer.row { padding-bottom: .5em } }
ul#footer-left {
text-align: left;
font-size: 12px;
}
ul#footer-right {
text-align: right;
font-size: 12px;
}
li#footer-privacy {
float: left;
margin-right: 2em;
}
li#footer-about {
float: left;
margin-right: 2em;
}
ul#footer-right li {
float: right;
margin: 0 0 .5em .5em;
}
/* FollowUs AddThis Tweaks */
li.social-follow {
width: 100%;
}
.addthis_horizontal_follow_toolbox {
float: right;
margin-bottom: .5em;
}
.social-links p {
margin:0 .2em 0 0;
font-weight: bold;
}
/* TABS */
#mw-content-text ul.tabs {
@ -1095,3 +1131,11 @@ td.htmlform-tip {
font-size: 90%;
margin-top: 1em;
}
/* Orbit Slider Overrides for MW */
.orbit-container .orbit-slides-container img {
width: 100%;
}
.orbit-bullets {
margin: 0 auto 30px auto !important;
}