1
<?PHP //$Id: block_admin.php,v 1.2 2004/04/26 09:03:40 defacer Exp $
1
<?PHP //$Id: block_admin.php,v 1.8.2.3 2004/10/09 13:11:49 stronk7 Exp $
3
3
class CourseBlock_admin extends MoodleBlock {
4
4
function CourseBlock_admin($course) {
5
5
$this->title = get_string('administration');
6
6
$this->content_type = BLOCK_TYPE_LIST;
7
7
$this->course = $course;
8
$this->version = 2004041000;
8
$this->version = 2004081200;
10
11
function get_content() {
11
global $USER, $CFG, $THEME;
13
require_once($CFG->dirroot.'/mod/forum/lib.php');
15
13
if($this->content !== NULL) {
16
14
return $this->content;
21
19
$this->content->icons = array();
22
20
$this->content->footer = '';
22
if (empty($this->course)) {
24
} else if ($this->course->id == SITEID) {
25
$this->load_content_for_site();
27
$this->load_content_for_course();
30
return $this->content;
34
function load_content_for_site() {
38
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/configure.php">'.get_string('configuration').'</a>...';
39
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/admin.gif" height="16" width="16" alt="" />';
41
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/users.php">'.get_string('users').'</a>...';
42
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="" />';
44
$this->content->items[]='<a href="'.$CFG->wwwroot.'/backup/backup.php?id='.SITEID.'">'.get_string('backup').'...</a>';
45
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/backup.gif" height="16" width="16" alt="">';
47
$this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.SITEID.'&wdir=/backupdata">'.get_string('restore').'...</a>';
48
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" height="16" width="16" alt="">';
52
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/index.php?edit=on&sesskey='.$USER->sesskey.'">'.get_string('courses').'</a>';
53
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/course.gif" height="16" width="16" alt="" />';
57
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/log.php?id='.SITEID.'">'.get_string('logs').'</a>';
58
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/log.gif" height="16" width="16" alt="" />';
60
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/files/index.php?id='.SITEID.'">'.get_string('sitefiles').'</a>';
61
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/files.gif" height="16" width="16" alt="" />';
63
if (file_exists($CFG->dirroot.'/'.$CFG->admin.'/'.$CFG->dbtype)) {
64
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/'.$CFG->dbtype.'/frame.php">'.get_string('managedatabase').'</a>';
65
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/db.gif" height="16" width="16" alt="" />';
67
$this->content->footer = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/">'.get_string('admin').'</a>...';
71
function load_content_for_course() {
74
require_once($CFG->dirroot.'/mod/forum/lib.php');
25
77
return $this->content;
84
136
} else if (!isguest()) { // Students menu
85
138
if ($this->course->showgrades) {
86
139
$this->content->items[]='<a href="grade.php?id='.$this->course->id.'">'.get_string('grades').'...</a>';
87
140
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" height="16" width="16" alt="">';