forked from ushahidi/SwiftRiver
/
header.php
129 lines (106 loc) · 4.28 KB
/
header.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><?php echo (isset($title) ? $title.' ~ ' : '').$site_name; ?></title>
<meta name="description" content="SwiftRiver" />
<meta name="keywords" content="SwiftRiver">
<?php Swiftriver_Event::run('swiftriver.template.meta'); ?>
<link rel="index" title="SwiftRiver" href="<?php echo URL::base(TRUE,TRUE); ?>" />
<link rel="icon" href="<?php echo URL::base(); ?>themes/default/media/img/favicon.png" type="image/png">
<?php
echo $meta;
echo(HTML::style("themes/default/media/css/styles.css"));
// Inline css
echo $css;
Swiftriver_Event::run('swiftriver.template.head.css');
?>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<script type="text/javascript">
// Globals
<?php if ( ! empty($user)): ?>
<?php if ($user['id']): ?>
window.logged_in_account = <?php echo $user['id']; ?>;
window.logged_in_account_path = "<?php echo $user['account_path']; ?>";
<?php endif; ?>
window.logged_in_user = <?php echo $user['id']; ?>;
<?php else: ?>
window.logged_in_account = null;
window.logged_in_account_path = null;
window.logged_in_user = null;
<?php endif; ?>
window.public_registration_enabled = <?php echo Swiftriver::get_setting('public_registration_enabled') ? "true" : "false"; ?>;
window.site_url = "<?php echo URL::base(TRUE, FALSE); ?>";
window.system_messages = <?php echo $messages; ?>;
</script>
<?php
echo(HTML::script("themes/default/media/js/jquery-1.7.2.min.js"));
// Outside events plugin
echo(HTML::script("themes/default/media/js/jquery.outside.js"));
// Masonry plugin
echo(HTML::script("themes/default/media/js/jquery.masonry.min.js"));
echo(HTML::script("themes/default/media/js/jquery.imagesloaded.min.js"));
echo(HTML::script("themes/default/media/js/modernizr.custom.01220.js"));
// Fileupload jQuery plugin
echo(HTML::script("themes/default/media/js/jquery.ui.widget.js"));
echo(HTML::script("themes/default/media/js/jquery.iframe-transport.js"));
echo(HTML::script("themes/default/media/js/jquery.fileupload.js"));
// Touch Plugin
// echo(HTML::script("themes/default/media/js/jquery.touch.min.js"));
// Backbone
echo(HTML::script("themes/default/media/js/underscore-min.js"));
echo(HTML::script("themes/default/media/js/backbone-min.js"));
// SwiftRiver global JS
echo(HTML::script("themes/default/media/js/global.js"));
echo(HTML::script("themes/default/media/js/assets.js"));
// Dynamic inline JS
echo $js;
Swiftriver_Event::run('swiftriver.template.head.js');
?>
<script type="text/javascript">
// Loading image
var loading_image_html = '<?php echo HTML::image("themes/default/media/img/loading.gif", array("class"=>"loading_image")); ?>';
window.loading_image = $(loading_image_html);
// Squares loading image
loading_image_html = '<?php echo HTML::image("themes/default/media/img/loader.gif", array("class"=>"loading_image")); ?>';
window.loading_image_squares = $(loading_image_html);
window.loading_message = $('<div class="loading"></div>').append(loading_image);
// Preload loading_image
(new Image()).src = window.loading_image.attr('src');
//Preload default avatar
var default_avatar_html = '<?php echo HTML::image("themes/default/media/img/avatar_default.gif"); ?>';
window.default_avatar = $(default_avatar_html);
(new Image()).src = window.default_avatar.attr('src');
</script>
<script type="text/javascript">
$(function() {
<?php if (isset($bucket_list)): ?>
// Bootstrap the global bucket list
Assets.bucketList.reset(<?php echo $bucket_list; ?>);
<?php endif; ?>
<?php if (isset($river_list)): ?>
// Bootstrap the global bucket list
Assets.riverList.reset(<?php echo $river_list; ?>);
<?php endif; ?>
<?php if (isset($form_list)): ?>
// Bootstrap the global form list
Assets.formList.reset(<?php echo $form_list; ?>);
<?php endif; ?>
});
</script>
<?php Swiftriver_Event::run('swiftriver.template.head'); ?>
</head>
<body>
<?php if ($show_nav): ?>
<header class="toolbar">
<div class="center">
<div class="col_6">
<h1 class="logo">
<a href="<?php echo $dashboard_url; ?>">
<span class="nodisplay">SwiftRiver</span>
</a>
</h1>
<?php echo $nav_header;?>
</div>
</header>
<?php endif; ?>