I am using an some existing and trying to edit it. Basically, I need this code to create a block with a link in it. That link needs to be a specific URL plus the courseid number of the course that the block exists in.
For example, say I am in ACC 101 which is courseid number 47. I need the block to have a link in it that when clicked on goes to say
http://www.yahoo.com & courseid = 47.
I think I am close with the code below, but it isn't quite working. Can anyone see what I have wrong?
<?php
class block_test extends block_list {
function init() {
$this->title = get_string('blockname', 'block_test');
}
function get_content() {
global $THEME, $CFG, $USER;
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
}
{ $this->content->items[]="<a $linkcss title=\"" . "href=\"$CFG->www.yahoo.com?id=$course->id\"></a>";
}
}
?>