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

Add headings to tables and centre numeric cells


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 9db2fa23
...@@ -177,6 +177,9 @@ $string['rankingsupdated'] = 'Rankings last updated: %s'; ...@@ -177,6 +177,9 @@ $string['rankingsupdated'] = 'Rankings last updated: %s';
$string['uptodate'] = 'up to date'; $string['uptodate'] = 'up to date';
$string['latestversionis'] = 'latest version is <a href="%s">%s</a>'; $string['latestversionis'] = 'latest version is <a href="%s">%s</a>';
$string['viewsbytype'] = 'Views by Type'; $string['viewsbytype'] = 'Views by Type';
$string['userstatstabletitle'] = 'Daily User Statistics';
$string['groupstatstabletitle'] = 'Biggest Groups';
$string['viewstatstabletitle'] = 'Most Popular Views';
// Site options // Site options
$string['adminsonly'] = 'Administrators only'; $string['adminsonly'] = 'Administrators only';
......
...@@ -261,12 +261,14 @@ function site_statistics($full=false) { ...@@ -261,12 +261,14 @@ function site_statistics($full=false) {
function user_statistics($limit, $offset, &$sitedata) { function user_statistics($limit, $offset, &$sitedata) {
$data = array(); $data = array();
$data['tableheadings'] = array( $data['tableheadings'] = array(
get_string('date'), array('name' => get_string('date')),
get_string('Loggedin', 'admin'), array('name' => get_string('Loggedin', 'admin'), 'class' => 'center'),
get_string('Created'), array('name' => get_string('Created'), 'class' => 'center'),
get_string('Total'), array('name' => get_string('Total'), 'class' => 'center'),
); );
$data['table'] = user_stats_table($limit, $offset); $data['table'] = user_stats_table($limit, $offset);
$data['tabletitle'] = get_string('userstatstabletitle', 'admin');
$maxfriends = get_records_sql_array(" $maxfriends = get_records_sql_array("
SELECT u.id, u.firstname, u.lastname, u.preferredname, SUM(f.friends) AS friends SELECT u.id, u.firstname, u.lastname, u.preferredname, SUM(f.friends) AS friends
FROM {usr} u INNER JOIN ( FROM {usr} u INNER JOIN (
...@@ -511,14 +513,15 @@ function user_institution_graph() { ...@@ -511,14 +513,15 @@ function user_institution_graph() {
function group_statistics($limit, $offset) { function group_statistics($limit, $offset) {
$data = array(); $data = array();
$data['tableheadings'] = array( $data['tableheadings'] = array(
'#', array('name' => '#'),
get_string('Group', 'group'), array('name' => get_string('Group', 'group')),
get_string('Members', 'group'), array('name' => get_string('Members', 'group'), 'class' => 'center'),
get_string('views'), array('name' => get_string('views'), 'class' => 'center'),
get_string('nameplural', 'interaction.forum'), array('name' => get_string('nameplural', 'interaction.forum'), 'class' => 'center'),
get_string('Posts', 'interaction.forum'), array('name' => get_string('Posts', 'interaction.forum'), 'class' => 'center'),
); );
$data['table'] = group_stats_table($limit, $offset); $data['table'] = group_stats_table($limit, $offset);
$data['tabletitle'] = get_string('groupstatstabletitle', 'admin');
$smarty = smarty_core(); $smarty = smarty_core();
$smarty->assign('grouptypecounts', get_records_sql_array(" $smarty->assign('grouptypecounts', get_records_sql_array("
...@@ -677,13 +680,14 @@ function group_type_graph() { ...@@ -677,13 +680,14 @@ function group_type_graph() {
function view_statistics($limit, $offset) { function view_statistics($limit, $offset) {
$data = array(); $data = array();
$data['tableheadings'] = array( $data['tableheadings'] = array(
'#', array('name' => '#'),
get_string('view'), array('name' => get_string('view')),
get_string('Owner', 'view'), array('name' => get_string('Owner', 'view')),
get_string('Visits'), array('name' => get_string('Visits'), 'class' => 'center'),
get_string('Comments', 'artefact.comment'), array('name' => get_string('Comments', 'artefact.comment'), 'class' => 'center'),
); );
$data['table'] = view_stats_table($limit, $offset); $data['table'] = view_stats_table($limit, $offset);
$data['tabletitle'] = get_string('viewstatstabletitle', 'admin');
$smarty = smarty_core(); $smarty = smarty_core();
$maxblocktypes = 5; $maxblocktypes = 5;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<tr class="{cycle values='r0,r1'}"> <tr class="{cycle values='r0,r1'}">
<td>{$offset + $dwoo.foreach.default.iteration}</td> <td>{$offset + $dwoo.foreach.default.iteration}</td>
<td><a href="{$WWWROOT}group/view.php?id={$item->id}">{$item->name}</a></td> <td><a href="{$WWWROOT}group/view.php?id={$item->id}">{$item->name}</a></td>
<td>{$item->members}</td> <td class="center">{$item->members}</td>
<td>{$item->views}</td> <td class="center">{$item->views}</td>
<td>{$item->forums}</td> <td class="center">{$item->forums}</td>
<td>{$item->posts}</td> <td class="center">{$item->posts}</td>
</tr> </tr>
{/foreach} {/foreach}
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
{$subpagedata.summary} {$subpagedata.summary}
</div> </div>
<div id="statistics_table_container" class="statistics-subpage-right-column fr"> <div id="statistics_table_container" class="statistics-subpage-right-column fr">
<h3>{$subpagedata.tabletitle}</h3>
<table id="statistics_table" class="fullwidth"> <table id="statistics_table" class="fullwidth">
<thead> <thead>
<tr> <tr>
{foreach from=$subpagedata.tableheadings item=heading} {foreach from=$subpagedata.tableheadings item=heading}
<th>{$heading|escape}</th> <th{if $heading.class} class="{$heading.class}"{/if}>{$heading.name|escape}</th>
{/foreach} {/foreach}
<tr> <tr>
</thead> </thead>
......
{foreach from=$data item=item} {foreach from=$data item=item}
<tr class="{cycle values='r0,r1'}"> <tr class="{cycle values='r0,r1'}">
<td>{$item.date}</td> <td>{$item.date}</td>
<td>{$item.loggedin}</td> <td class="center">{$item.loggedin}</td>
<td>{$item.created}</td> <td class="center">{$item.created}</td>
<td>{$item.total}</td> <td class="center">{$item.total}</td>
</tr> </tr>
{/foreach} {/foreach}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<td>{$offset + $dwoo.foreach.default.iteration}</td> <td>{$offset + $dwoo.foreach.default.iteration}</td>
<td><a href="{$WWWROOT}view/view.php?id={$item->id}">{$item->title}</a></td> <td><a href="{$WWWROOT}view/view.php?id={$item->id}">{$item->title}</a></td>
<td>{$item->author}</td> <td>{$item->author}</td>
<td>{$item->visits}</td> <td class="center">{$item->visits}</td>
<td>{$item->comments}</td> <td class="center">{$item->comments}</td>
</tr> </tr>
{/foreach} {/foreach}
Markdown is supported
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