]> git.mjollnir.org Git - moodle.git/commitdiff
added rsstitle, merged
authortoyomoyo <toyomoyo>
Wed, 24 May 2006 07:03:14 +0000 (07:03 +0000)
committertoyomoyo <toyomoyo>
Wed, 24 May 2006 07:03:14 +0000 (07:03 +0000)
mod/data/rsslib.php
mod/data/templates.php

index cb82a1b42ff31dbda4941f564807563dc59e8053..9a94dac74e9a6c29fc2d1061d8bb9e3dda446490 100644 (file)
                             array_push($recordarray, $record);
 
                             $item = null;
-                            $item->title   = strip_tags(get_field('data_content', 'content', 
+                            
+                            // guess title or not
+                            if ($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',
                                                                   'fieldid', $firstfield->id, 'recordid', $record->id));
-                            $item->description = data_print_template($recordarray, $data, '', 'rsstemplate', false, 
-                                                                     0, 0, 'timecreated DESC', '', true);
+                            }
+                            $item->description = data_print_template('rsstemplate', $recordarray, $data, '', 0, true);
                             $item->pubdate = $record->timecreated;
                             $item->link = $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id;
                             
                             array_push($items, $item);
                         }
-
                         $course = get_record('course', 'id', $data->course);
                         
                         // First all rss feeds common headers.
index 4f2d153255dba9dcb4b88a1e22d268155b2d1be7..bc8ffe51a0352b12b3f6059fb9ee1607a9cb1a62 100755 (executable)
             if (isset($mytemplate->listtemplatefooter)){
                 $newtemplate->listtemplatefooter = $mytemplate->listtemplatefooter;
             }
-        
+            if (isset($mytemplate->rsstitletemplate)){
+                $newtemplate->rsstitletemplate = $mytemplate->rsstitletemplate;
+            }
+
             // Check for multiple tags, only need to check for add template.
             if ($mode != 'addtemplate' or data_tags_check($data->id, $newtemplate->{$mode})) {
                 if (update_record('data', $newtemplate)) {
         print_textarea($usehtmleditor, 10, 72, 0, 0, 'listtemplatefooter', $data->listtemplatefooter);
         echo '</td>';
         echo '</tr>';
+    } else if ($mode == 'rsstemplate') {
+        echo '<tr>';
+        echo '<td>&nbsp;</td>';
+        echo '<td>';
+        echo '<div align="center">'.get_string('rsstitletemplate','data').'</div>';
+        print_textarea($usehtmleditor, 10, 72, 0, 0, 'rsstitletemplate', $data->rsstitletemplate);
+        echo '</td>';
+        echo '</tr>';
     }
 
     echo '<tr><td align="center" colspan="2">';
         if ($mode == 'listtemplate'){
             use_html_editor('listtemplateheader');
             use_html_editor('listtemplatefooter');
+        } else if ($mode == 'rsstemplate'){
+            use_html_editor('rsstitletemplate');
         }
     }