Skip to content

Commit

Permalink
Sticky blocks support
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Feb 22, 2009
1 parent 4383fd7 commit f6891a4
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions block_course_contents.php
Expand Up @@ -17,19 +17,8 @@ function init() {
$this->version = 2009021700;
}

/*
function instance_config($instance) {
parent::instance_config($instance);
}
*/

function applicable_formats() {
return (array(
'course-view-weeks' => true,
'course-view-topics' => true,
'course-edit-weeks' => true,
'course-edit-topics' => true,
));
return array('course' => true);
}

function get_content() {
Expand All @@ -45,6 +34,12 @@ function get_content() {
$this->content->footer = '';
$this->content->text = '';

if (empty($this->instance->pageid)) { // sticky
if (!empty($COURSE)) {
$this->instance->pageid = $COURSE->id;
}
}

if (empty($this->instance)) {
return $this->content;
}
Expand Down

0 comments on commit f6891a4

Please sign in to comment.