forked from nternetinspired/OneWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic.php
executable file
·108 lines (95 loc) · 5 KB
/
logic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php defined('_JEXEC') or die;
/* =====================================================================
Template: OneWeb for Joomla
Author: Seth Warburton - Internet Inspired! - @nternetinspired
Version: 3.0
Created: April 2013
Copyright: Seth Warburton - (C) 2013 - All rights reserved
Licenses: GNU/GPL v3 or later http://www.gnu.org/licenses/gpl-3.0.html
DBAD License http://philsturgeon.co.uk/code/dbad-license
Sources: http://construct-framework.com
/* ===================================================================== */
$app = JFactory::getApplication();
// Define shortcuts for template parameters
$loadMoo = $this->params->get('loadMoo');
$jQuery = $this->params->get('jQuery');
$bootBloatJS = $this->params->get('bootBloatJS');
$scripts = $this->params->get('scripts');
$frontpage = $this->params->get('frontpage');
$setGeneratorTag = $this->params->get('setGeneratorTag');
$analytics = $this->params->get('analytics');
$googleplus = $this->params->get('googleplus');
$googleWebFonts = $this->params->get('googleWebFonts');
$twitter = $this->params->get('twitter');
$twitterLink = $this->params->get('twitterLink');
$dribbble = $this->params->get('dribbble');
$dribbbleLink = $this->params->get('dribbbleLink');
$facebook = $this->params->get('facebook');
$facebookLink = $this->params->get('facebookLink');
$googleplus = $this->params->get('googleplus');
$googleplusLink = $this->params->get('googleplusLink');
$github = $this->params->get('github');
$githubLink = $this->params->get('githubLink');
$debug = $this->params->get('debug');
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$itemid = $app->input->getCmd('Itemid', '');
// Are we are on the homepage?
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {$siteHome = 'home';} else {$siteHome = 'sub';};
// Do we have social links?
$social = ($twitterLink?1:0)+ ($dribbbleLink?1:0)+ ($facebookLink?1:0)+ ($googleplusLink?1:0)+ ($githubLink?1:0);
#----------------------------- Construct Code Snippets-----------------------------#
// GPL code taken from Construct template framework by Matt Thomas http://construct-framework.com/
// To enable use of site configuration
$pageParams = $app->getParams();
// Returns a reference to the global document object
$doc = JFactory::getDocument();
// Define relative path to the current template directory
$template = 'templates/'.$this->template;
// Change generator tag
$this->setGenerator($setGeneratorTag);
#----------------------------- End Construct Code -----------------------------#
// Remove MooTools if set to no.
if ( !$loadMoo ) {
unset($doc->_scripts[$this->baseurl.'/media/system/js/mootools-core.js']);
unset($doc->_scripts[$this->baseurl.'/media/system/js/mootools-more.js']);
unset($doc->_scripts[$this->baseurl.'/media/system/js/core.js']);
unset($doc->_scripts[$this->baseurl.'/media/system/js/caption.js']);
unset($doc->_scripts[$this->baseurl.'/media/system/js/modal.js']);
unset($doc->_scripts[$this->baseurl.'/media/system/js/mootools.js']);
unset($doc->_scripts[$this->baseurl.'/plugins/system/mtupgrade/mootools.js']);
}
// Self explanatory
if ( !$bootBloatJS ) {
unset($doc->_scripts[$this->baseurl.'/media/jui/js/jquery.min.js']);
unset($doc->_scripts[$this->baseurl.'/media/jui/js/jquery-noconflict.js']);
unset($doc->_scripts[$this->baseurl.'/media/jui/js/jquery-migrate.min.js']);
unset($doc->_scripts[$this->baseurl.'/media/jui/js/bootstrap.min.js']);
unset($doc->_scripts[$this->baseurl.'/media/system/js/tabs-state.js']);
}
#----------------------------- Inject extras into the head -----------------------------#
// Currently the latest minified version from Google. It's smaller than the Joomla version.
if ($jQuery) {
$doc->addScript($this->baseurl.'/templates/'.$this->template.'/js/jquery-1.8.2.min.js');
}
// Global styles
$doc->addStyleSheet($template.'/css/style.css');
// Google fonts styles
if ($googleWebFonts != "") {
$doc->addStyleSheet(''.$googleWebFonts.'');
}
//Debug stylesheet
if ($debug =="1") {
$doc->addStyleSheet('https://rawgithub.com/nternetinspired/debug-css/master/debug.css');
}
// Metas
$doc->setMetaData( 'HandheldFriendly', 'True' );
$doc->setMetaData( 'MobileOptimized', '320' );
// This lets mobile devices know we have thought about them
$doc->setMetaData( 'viewport', 'width=device-width, initial-scale=1.0' );
// Kick IE out of compatibility mode and disable it
//$doc->setMetaData( 'X-UA-Compatible', 'IE=edge;chrome=1' );
// For Win mobile
//$doc->setMetaData( 'cleartype', 'on');