adding some strings
[moodle-linuxchix.git] / blocks / course_summary / block_course_summary.php
blob02cc6800c2be150c670e72061f16539ec097a42e
1 <?PHP //$Id$
3 class block_course_summary extends block_base {
4 function init() {
5 $this->title = get_string('pagedescription', 'block_course_summary');
6 $this->version = 2004052600;
9 function specialization() {
10 global $COURSE;
11 if($this->instance->pagetype == PAGE_COURSE_VIEW && $COURSE->id != SITEID) {
12 $this->title = get_string('coursesummary', 'block_course_summary');
16 function get_content() {
17 global $CFG, $COURSE;
19 if($this->content !== NULL) {
20 return $this->content;
23 if (empty($this->instance)) {
24 return '';
27 $this->content = New stdClass;
28 $options->noclean = true; // Don't clean Javascripts etc
29 $this->content->text = format_text($COURSE->summary, FORMAT_HTML, $options);
30 if(isediting($COURSE->id)) {
31 if($COURSE->id == SITEID) {
32 $editpage = $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=frontpagesettings';
33 } else {
34 $editpage = $CFG->wwwroot.'/course/edit.php?id='.$COURSE->id;
36 $this->content->text .= "<div class=\"editbutton\"><a href=\"$editpage\"><img src=\"$CFG->pixpath/t/edit.gif\" alt=\"".get_string('edit')."\" /></a></div>";
38 $this->content->footer = '';
40 return $this->content;
43 function hide_header() {
44 return true;
47 function preferred_width() {
48 return 210;