From: skodak Date: Sun, 17 Dec 2006 21:48:51 +0000 (+0000) Subject: MDL-7945 Database learning activity does not use user defined RSS template, but conti... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=aa3b20e9dfe993371ce88e2269012403bdb0ee80;p=moodle.git MDL-7945 Database learning activity does not use user defined RSS template, but continues to use default template. --- diff --git a/mod/data/lib.php b/mod/data/lib.php index 4658352f93..cf03d84368 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -877,23 +877,27 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re $newtext = str_ireplace($patterns, $replacement, $data->{$template}); /// no more html formatting and filtering - see MDL-6635 - echo $newtext; - - /********************************** - * Printing Ratings Form * - *********************************/ - if ($template == 'singletemplate') { //prints ratings options - data_print_ratings($data, $record); - } - - /********************************** - * Printing Ratings Form * - *********************************/ - if (($template == 'singletemplate') && ($data->comments)) { //prints ratings options - - data_print_comments($data, $record, $page); + if ($return) { + return $newtext; + } else { + echo $newtext; + + // hack alert - return is always false in singletemplate anyway ;-) + /********************************** + * Printing Ratings Form * + *********************************/ + if ($template == 'singletemplate') { //prints ratings options + data_print_ratings($data, $record); + } + + /********************************** + * Printing Ratings Form * + *********************************/ + if (($template == 'singletemplate') && ($data->comments)) { //prints ratings options + + data_print_comments($data, $record, $page); + } } - } } diff --git a/mod/data/rsslib.php b/mod/data/rsslib.php index 9ed28ca95c..b39117bfcd 100644 --- a/mod/data/rsslib.php +++ b/mod/data/rsslib.php @@ -68,7 +68,7 @@ $item = null; // guess title or not - if ($data->rsstitletemplate) { + if (!empty($data->rsstitletemplate)) { $item->title = data_print_template('rsstitletemplate', $recordarray, $data, '', 0, true); } else { // else we guess $item->title = strip_tags(get_field('data_content', 'content',