Skip to content

Commit

Permalink
MDL-33627 - feedback block now show all feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
grabs committed Jun 25, 2012
1 parent 6be7840 commit 131e1d4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions blocks/feedback/block_feedback.php
Expand Up @@ -4,7 +4,7 @@
define('FEEDBACK_BLOCK_LIB_IS_OK', true); define('FEEDBACK_BLOCK_LIB_IS_OK', true);
} }


class block_feedback extends block_base { class block_feedback extends block_list {


function init() { function init() {
$this->title = get_string('feedback', 'block_feedback'); $this->title = get_string('feedback', 'block_feedback');
Expand All @@ -21,10 +21,13 @@ function get_content() {
return $this->content; return $this->content;
} }


$this->content = new stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';

if (!defined('FEEDBACK_BLOCK_LIB_IS_OK')) { if (!defined('FEEDBACK_BLOCK_LIB_IS_OK')) {
$this->content = new stdClass; $this->content->items = array(get_string('missing_feedback_module', 'block_feedback'));
$this->content->text = get_string('missing_feedback_module', 'block_feedback');
$this->content->footer = '';
return $this->content; return $this->content;
} }


Expand All @@ -33,9 +36,7 @@ function get_content() {
$courseid = SITEID; $courseid = SITEID;
} }


$this->content = new stdClass; $icon = '<img src="'.$OUTPUT->pix_url('icon', 'feedback') . '" class="icon" alt="" />';
$this->content->text = '';
$this->content->footer = '';




if (empty($this->instance->pageid)) { if (empty($this->instance->pageid)) {
Expand All @@ -47,8 +48,7 @@ function get_content() {
foreach ($feedbacks as $feedback) { foreach ($feedbacks as $feedback) {
$url = new moodle_url($baseurl); $url = new moodle_url($baseurl);
$url->params(array('id'=>$feedback->cmid, 'courseid'=>$courseid)); $url->params(array('id'=>$feedback->cmid, 'courseid'=>$courseid));
$icon = '<img src="'.$OUTPUT->pix_url('icon', 'feedback') . '" class="icon" alt="" />&nbsp;'; $this->content->items[] = '<a href="'.$url->out().'">'.$icon.$feedback->name.'</a>';
$this->content->text = ' <a href="'.$url->out().'">'.$icon.$feedback->name.'</a>';
} }
} }


Expand Down

0 comments on commit 131e1d4

Please sign in to comment.