groupfiles.php 1.71 KB
Newer Older
1
2
3
4
5
6
<?php
/**
 *
 * @package    mahara
 * @subpackage artefact-file
 * @author     Catalyst IT Ltd
7
8
 * @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.
9
10
11
12
 *
 */

define('INTERNAL', 1);
13
define('MENUITEM', 'groups/files');
14
15
16
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'groupfiles');
17
18

require(dirname(dirname(dirname(__FILE__))) . '/init.php');
19
require_once(get_config('libroot') . 'group.php');
20
21
safe_require('artefact', 'file');

22
define('GROUP', param_integer('group'));
23
24
$group = group_current_group();

25
if (!$role = group_user_access($group->id) || !group_within_edit_window($group)) {
26
27
    throw new AccessDeniedException();
}
28
define('TITLE', $group->name . ' - ' . get_string('groupfiles', 'artefact.file'));
29
30
31

require_once(get_config('docroot') . 'interaction/lib.php');

32
$pagebase = get_config('wwwroot') . 'artefact/file/groupfiles.php?group=' . $group->id;
33
$form = pieform(ArtefactTypeFileBase::files_form($pagebase, $group->id));
34
$js = ArtefactTypeFileBase::files_js();
35

Hugh Davenport's avatar
Hugh Davenport committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$smarty = smarty(
    array(),
    array(),
    array(),
    array(
        'sideblocks' => array(
            array(
                'name'   => 'groupquota',
                'weight' => -10,
                'data'   => array(),
            ),
        ),
    )
);
50
$smarty->assign('heading', $group->name);
51
$smarty->assign('subsectionheading', get_string('Files', 'artefact.file'));
52
$smarty->assign('headingclass', 'page-header');
53
54
$smarty->assign('form', $form);
$smarty->assign('INLINEJAVASCRIPT', $js);
55
$smarty->assign('group', $group->name);
56
$smarty->display('artefact:file:files.tpl');