title = get_string('administration');
$this->version = 2004081200;
}
function get_content() {
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
if (empty($this->instance)) {
$this->content = '';
} else if ($this->instance->pageid == SITEID) {
$this->load_content_for_site();
} else {
$this->load_content_for_course();
}
return $this->content;
}
function load_content_for_site() {
global $CFG, $USER;
if (isadmin()) {
$this->content->items[] = ''.get_string('configuration').'';
$this->content->icons[] = '
';
$this->content->items[] = ''.get_string('users').'';
$this->content->icons[] = '
';
$this->content->items[]=''.get_string('backup').'';
$this->content->icons[]='
';
$this->content->items[]=''.get_string('restore').'';
$this->content->icons[]='
';
}
if (iscreator()) {
$this->content->items[] = ''.get_string('courses').'';
$this->content->icons[] = '
';
}
if (isadmin()) {
$this->content->items[] = ''.get_string('logs').'';
$this->content->icons[] = '
';
if (!empty($CFG->enablestats)) {
$this->content->items[] = ''.get_string('stats').'';
$this->content->icons[] = '
';
}
$this->content->items[] = ''.get_string('sitefiles').'';
$this->content->icons[] = '
';
if (file_exists($CFG->dirroot.'/'.$CFG->admin.'/'.$CFG->dbtype)) {
$this->content->items[] = ''.get_string('managedatabase').'';
$this->content->icons[] = '
';
}
if ($CFG->enrol == 'authorize') {
require_once $CFG->dirroot.'/enrol/authorize/const.php';
$paymenturl = ''.get_string('payments').' ';
if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH)) {
$paymenturl .= ''.get_string('paymentpending', 'moodle', $cnt).'';
}
$this->content->items[] = $paymenturl;
$this->content->icons[] = '
';
}
$this->content->footer = ''.get_string('admin').'...';
}
}
function load_content_for_course() {
global $CFG, $USER;
require_once($CFG->dirroot.'/mod/forum/lib.php');
if (isguest()) {
return $this->content;
}
$course = get_record('course', 'id', $this->instance->pageid);
if (isteacher($this->instance->pageid)) {
$isteacheredit = isteacheredit($this->instance->pageid);
if ($isteacheredit) {
$this->content->icons[]='
';
if (isediting($this->instance->pageid)) {
$this->content->items[]=''.get_string('turneditingoff').'';
} else {
$this->content->items[]=''.get_string('turneditingon').'';
}
$this->content->items[]=''.get_string('settings').'';
$this->content->icons[]='
';
$fullname = fullname($USER, true);
$editmyprofile = ''.get_string('editmyprofile').'';
if (empty($USER->description)) {
//Accessibility: replace non-standard