Exemple #1
0
 protected static function get_data($groupid)
 {
     global $USER;
     if (!defined('GROUP')) {
         define('GROUP', $groupid);
     }
     // get the currently requested group
     $group = group_current_group();
     $group->ctime = format_date($group->ctime, 'strftimedate');
     // if the user isn't logged in an the group isn't public don't show anything
     if (!is_logged_in() && !$group->public) {
         throw new AccessDeniedException();
     }
     return group_get_groupinfo_data($group);
 }
<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('libroot') . 'group.php';
$id = param_integer('id');
$group = get_record('group', 'id', $id);
$group = group_get_groupinfo_data($group);
$smarty = smarty_core();
$smarty->assign('group', $group);
$html = $smarty->fetch('group/groupdata.tpl');
json_reply(false, array('message' => null, 'html' => $html));