title = get_string('administration'); $this->content_type = BLOCK_TYPE_LIST; $this->course = $course; $this->version = 2004041000; } function get_content() { global $USER, $CFG, $THEME; require_once($CFG->dirroot.'/mod/forum/lib.php'); if($this->content !== NULL) { return $this->content; } $this->content = New object; $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; if (isguest()) { return $this->content; } if (isteacher($this->course->id)) { $isteacheredit = isteacheredit($this->course->id); if ($isteacheredit) { $this->content->icons[]=''; if (isediting($this->course->id)) { $this->content->items[]=''.get_string('turneditingoff').''; } else { $this->content->items[]=''.get_string('turneditingon').''; } $this->content->items[]=''.get_string('settings').'...'; $this->content->icons[]=''; if (iscreator() or !empty($CFG->teacherassignteachers)) { if (!$this->course->teachers) { $this->course->teachers = get_string('defaultcourseteachers'); } $this->content->items[]=''.$this->course->teachers.'...'; $this->content->icons[]=''; } if (!$this->course->students) { $this->course->students = get_string('defaultcoursestudents'); } $this->content->items[]=''.$this->course->students.'...'; $this->content->icons[]=''; $this->content->items[]=''.get_string('backup').'...'; $this->content->icons[]=''; $this->content->items[]=''.get_string('restore').'...'; $this->content->icons[]=''; $this->content->items[]=''.get_string('scales').'...'; $this->content->icons[]=''; } $this->content->items[]=''.get_string('grades').'...'; $this->content->icons[]=''; $this->content->items[]=''.get_string('logs').'...'; $this->content->icons[]=''; if ($isteacheredit) { $this->content->items[]=''.get_string('files').'...'; $this->content->icons[]=''; } $this->content->items[]=''.get_string('help').'...'; $this->content->icons[]=''; if ($teacherforum = forum_get_course_forum($this->course->id, 'teacher')) { $this->content->items[]=''.get_string('nameteacher', 'forum').''; $this->content->icons[]=''; } } else if (!isguest()) { // Students menu if ($this->course->showgrades) { $this->content->items[]=''.get_string('grades').'...'; $this->content->icons[]=''; } if ($this->course->showreports) { $this->content->items[]=''.get_string('activityreport').'...'; $this->content->icons[]=''; } if (is_internal_auth()) { $this->content->items[]=''.get_string('changepassword').'...'; $this->content->icons[]=''; } else if ($CFG->changepassword) { $this->content->items[]=''.get_string('changepassword').'...'; $this->content->icons[]=''; } if ($CFG->allowunenroll) { $this->content->items[]=''.get_string('unenrolme', '', $this->course->shortname).'...'; $this->content->icons[]=''; } } return $this->content; } } ?>