-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPortalAdmin.template.php
128 lines (108 loc) · 3.39 KB
/
PortalAdmin.template.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
<?php
/**
* @package SimplePortal
*
* @author SimplePortal Team
* @copyright 2014 SimplePortal Team
* @license BSD 3-clause
*
* @version 2.4
*/
function template_information()
{
global $context, $txt;
if ($context['in_admin'])
{
echo '
<div id="sp_admin_main">
<div id="admin_main_section">
<div id="sp_live_info" class="floatleft">
<h3 class="category_header hdicon cat_img_talk">
', $txt['sp-info_live'], '
</h3>
<div class="windowbg">
<div id="spAnnouncements">', $txt['sp-info_no_live'], '</div>
</div>
</div>
<div id="sp_general_info" class="floatright">
<h3 class="category_header hdicon cat_img_config">
', $txt['sp-info_general'], '
</h3>
<div class="context windowbg">
<strong>', $txt['sp-info_versions'], ':</strong><br />
', $txt['sp-info_your_version'], ':
<em id="spYourVersion" style="white-space: nowrap;">', $context['sp_version'], '</em><br />
', $txt['sp-info_current_version'], ':
<em id="spCurrentVersion" style="white-space: nowrap;">??</em><br />
<strong>', $txt['sp-info_managers'], ':</strong>
', implode(', ', $context['sp_managers']), '
</div>
</div>
</div>
<script src="http://www.simpleportal.net/sp/current-version.js"></script>
<script src="http://www.simpleportal.net/sp/latest-news.js"></script>
<script><!-- // --><![CDATA[
function spSetAnnouncements()
{
if (typeof(window.spAnnouncements) == "undefined" || typeof(window.spAnnouncements.length) == "undefined")
return;
var str = "<div style=\"margin: 4px; font-size: 0.85em;\">";
for (var i = 0; i < window.spAnnouncements.length; i++)
{
str += "\n <div style=\"padding-bottom: 2px;\"><a hre" + "f=\"" + window.spAnnouncements[i].href + "\">" + window.spAnnouncements[i].subject + "<" + "/a> ', $txt['on'], ' " + window.spAnnouncements[i].time + "<" + "/div>";
str += "\n <div style=\"padding-left: 2ex; margin-bottom: 1.5ex; border-top: 1px dashed;\">"
str += "\n " + window.spAnnouncements[i].message;
str += "\n <" + "/div>";
}
setInnerHTML(document.getElementById("spAnnouncements"), str + "<" + "/div>");
}
function spCurrentVersion()
{
var spVer, yourVer;
if (typeof(window.spVersion) != "string")
return;
spVer = document.getElementById("spCurrentVersion");
yourVer = document.getElementById("spYourVersion");
setInnerHTML(spVer, window.spVersion);
var currentVersion = getInnerHTML(yourVer);
if (currentVersion != window.spVersion)
setInnerHTML(yourVer, "<span class=\"alert\">" + currentVersion + "<" + "/span>");
}';
echo '
var func = function ()
{
spSetAnnouncements();
spCurrentVersion();
}
addLoadEvent(func);
// ]]></script>';
}
echo '
<div class="quick_tasks" id="sp_credits">';
foreach ($context['sp_credits'] as $section)
{
if (isset($section['pretext']))
echo '
<p>', $section['pretext'], '</p>';
foreach ($section['groups'] as $group)
{
if (empty($group['members']))
continue;
echo '
<p>';
if (isset($group['title']))
echo '
<strong>', $group['title'], ':</strong> ';
echo implode(', ', $group['members']), '
</p>';
}
if (isset($section['posttext']))
echo '
<p>', $section['posttext'], '</p>';
}
echo '
<hr />
<p>', sprintf($txt['sp-info_contribute'], 'http://www.simpleportal.net/index.php?page=contribute'), '</p>
</div>
</div>';
}