-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock_ilp_qual_unit.php
34 lines (24 loc) · 985 Bytes
/
block_ilp_qual_unit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
class block_ilp_qual_unit extends block_base {
function init() {
$this->title = get_string('title', 'block_ilp_qual_unit');
$this->version = 2007101509;
}
function get_content() {
global $CFG, $USER, $COURSE;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->footer = '';
$context = get_context_instance(CONTEXT_COURSE, $COURSE->id);
$doanything = has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM));
if (has_capability('block/ilp_qual_unit:editunits', $context)) {
$this->content->text = "<a href='{$CFG->wwwroot}/blocks/ilp_qual_unit/actions/edit_units.php?course_id={$COURSE->id}' >".get_string('editilpunits','block_ilp_qual_unit')."</a>";
} else {
$this->content->text = get_string('notauthorised','block_ilp_qual_unit');
}
return $this->content;
}
}
?>