Commit c48f7edf authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add graph for users/groups/views weekly data


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 05fa15f9
......@@ -73,13 +73,22 @@ $closeform = pieform(array(
),
));
$smarty = smarty();
$jsfiles = array();
if (empty($upgrades)) {
$sitedata = site_statistics();
if (!empty($sitedata['weekly'])) {
$jsfiles = array('js/PlotKit/excanvas.js', 'js/PlotKit/PlotKit.js');
$sitedata['dataarray'] = json_encode($sitedata['weekly']);
}
}
$smarty = smarty($jsfiles);
$smarty->assign('PAGEHEADING', hsc(get_string('administration', 'admin')));
// normal admin page starts here
$smarty->assign('upgrades', $upgrades);
if (empty($upgrades)) {
$smarty->assign('sitedata', site_statistics());
if (isset($sitedata)) {
$smarty->assign('sitedata', $sitedata);
}
if (isset($register)) {
......
......@@ -164,6 +164,9 @@ input#register_register {
.site-stats p {
margin: .1em;
}
#site-stats-graph {
margin: 0 .3em 1em;
}
.admin-home-column {
width: 49%;
......
<div class="site-stats">
<div id="site-stats-graph" class="fr" width="300" height="200">
</div>
{if $sitedata.weekly}
<script type="text/javascript">
addLoadEvent(function () {literal}{{/literal}
EasyPlot('line', {literal}{}{/literal}, $('site-stats-graph'), {$sitedata.dataarray});
{literal}}{/literal});
</script>
{/if}
<div class="site-stats fl">
<h5>{$sitedata.name}: {str tag=sitestatistics section=admin}</h5>
<p><strong>{str tag=users}:</strong> {$sitedata.users}{if $sitedata.rank.users} ({str tag=Rank section=admin}: $sitedata.rank.users}){/if}</p>
<p><strong>{str tag=groups}:</strong> {$sitedata.groups}{if $sitedata.rank.groups} ({str tag=Rank section=admin}: $sitedata.rank.groups}){/if}</p>
<p><strong>{str tag=views}:</strong> {$sitedata.views}{if $sitedata.rank.views} ({str tag=Rank section=admin}: $sitedata.rank.views}){/if}</p>
</div>
<div class="cb"></div>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment