]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7945 Database learning activity does not use user defined RSS template, but conti...
authorskodak <skodak>
Sun, 17 Dec 2006 21:48:51 +0000 (21:48 +0000)
committerskodak <skodak>
Sun, 17 Dec 2006 21:48:51 +0000 (21:48 +0000)
mod/data/lib.php
mod/data/rsslib.php

index 4658352f93b87ea7a45e7d4673b0317f1076070b..cf03d84368bbeb95f20ab5b1a6c9bca1c1fd6262 100755 (executable)
@@ -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);
+            }
         }
-
     }
 }
 
index 9ed28ca95cae9a2f971264fd7c92a39a189c3d0e..b39117bfcdcd8301dfb5eff4f15ac5260a96ac11 100644 (file)
@@ -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',