コード例 #1
0
if (!in_array($type, $subpages)) {
    $type = 'users';
}
if ($type == 'historical') {
    $field = isset($extradata->field) ? $extradata->field : 'count_usr';
}
if ($type == 'institutions') {
    $sort = isset($extradata->sort) ? $extradata->sort : 'displayname';
    $sortdesc = isset($extradata->sortdesc) ? $extradata->sortdesc : false;
}
switch ($type) {
    case 'institutions':
        $data = institution_comparison_stats_table($limit, $offset, $sort, $sortdesc);
        break;
    case 'historical':
        $data = historical_stats_table($limit, $offset, $field);
        break;
    case 'content':
        $data = content_stats_table($limit, $offset);
        break;
    case 'groups':
        $data = group_stats_table($limit, $offset);
        break;
    case 'views':
        $data = view_stats_table($limit, $offset);
        break;
    case 'users':
    default:
        $data = user_stats_table($limit, $offset);
}
json_reply(false, (object) array('message' => false, 'data' => $data));
コード例 #2
0
ファイル: registration.php プロジェクト: kienv/mahara
function content_statistics($limit, $offset)
{
    $data = array();
    $data['tableheadings'] = array(array('name' => '#'), array('name' => get_string('name')), array('name' => get_string('modified')), array('name' => get_string('Total'), 'class' => 'center'));
    $data['table'] = content_stats_table($limit, $offset);
    $data['tabletitle'] = get_string('contentstatstabletitle', 'admin');
    $data['summary'] = $data['table']['count'] == 0 ? get_string('nostats', 'admin') : null;
    return $data;
}