forked from nextcloud/nextcloud.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.php
137 lines (127 loc) · 2.72 KB
/
base.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
// Base file to handle each page request
require get_template_directory().'/config.php';
require get_template_directory().'/strings.php';
/**
* Pages that still use the old layout and haven't been migrated
*/
$oldPages = [
'5years',
'about',
'advisories',
'advisory',
'agreement',
'android',
'appform',
'appform-submit',
'apply',
'apply2',
'box',
'changelog',
'code-of-conduct',
'collaboraonline',
'community',
'conf',
'conference-program',
'confinfo',
'confsubscribe',
'connect',
'consulting',
'contact',
'contactform',
'contactsubmit',
'contribute',
'contributors',
'design',
'desktop',
'devices',
'events',
'faq',
'features',
'federation',
'hackathon',
'history',
'impressum',
'install',
'install-backup',
'jobs',
'meetups',
'news',
'newsletter',
'nine',
'pidrive',
'policy',
'pr20160602',
'pr20160614',
'pr20160705',
'pr20160719',
'pr20160721',
'pr20160725',
'pr20160812',
'pr20160825',
'pr20160901',
'press',
'privacy',
'promote',
'providers',
'providersubmit',
'release-channels',
'salessubmit',
'securesharesubmit',
'securesharing',
'security',
'sharing',
'speaking',
'spreedbox',
'support',
'team',
'thanks',
'thankyou',
'theming',
'threat-model',
'trademarks',
'translation',
'user',
'webrtc',
'workflow'
];
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
$currentPage = strtolower(get_post()->post_name);
$oldPage = true;
if(in_array($currentPage, $oldPages) || is_blog()) {
// It's an old page, use the old template
get_template_part('templates/head-old');
} else {
// It's a new page, use the new template
get_template_part('templates/head');
$oldPage = false;
}
?>
<body <?php body_class(); ?>>
<!--[if lt IE 8]>
<div class="alert alert-warning">
<?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?>
</div>
<![endif]-->
<?php
get_template_part('templates/header-top-navbar');
?>
<?php if($oldPage === true): ?>
<div class="wrap container" role="document">
<div class="content row">
<main class="main <?php echo roots_main_class(); ?>" role="main">
<?php include roots_template_path(); ?>
</main><!-- /.main -->
</div><!-- /.content -->
</div><!-- /.wrap -->
<?php else: ?>
<?php include roots_template_path(); ?>
<?php endif; ?>
<?php require get_template_directory().'/templates/footer.php'; ?>
<?php if(PIWIKTRACKING) { get_template_part('templates/piwik-tracking'); } ?>
</body>
</html>