Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 312... Línea 312...
312
 */
312
 */
Línea 313... Línea 313...
313
 
313
 
314
function forum_rss_feed_contents($forum, $sql, $params, $context) {
314
function forum_rss_feed_contents($forum, $sql, $params, $context) {
Línea 315... Línea -...
315
    global $CFG, $DB, $USER;
-
 
316
 
-
 
317
    $status = true;
315
    global $CFG, $DB, $USER;
Línea 318... Línea 316...
318
 
316
 
319
    $recs = $DB->get_recordset_sql($sql, $params, 0, $forum->rssarticles);
317
    $recs = $DB->get_recordset_sql($sql, $params, 0, $forum->rssarticles);
320
 
318
 
Línea 326... Línea 324...
326
 
324
 
327
    if (!$cm = get_coursemodule_from_instance('forum', $forum->id, $forum->course)) {
325
    if (!$cm = get_coursemodule_from_instance('forum', $forum->id, $forum->course)) {
328
        throw new \moodle_exception('invalidcoursemodule');
326
        throw new \moodle_exception('invalidcoursemodule');
Línea 329... Línea -...
329
    }
-
 
330
 
327
    }
331
    $formatoptions = new stdClass();
328
 
332
    $items = array();
329
    $items = array();
Línea 333... Línea 330...
333
    foreach ($recs as $rec) {
330
    foreach ($recs as $rec) {
Línea 375... Línea 372...
375
                    $item->title = format_string($forum->name.' '.userdate($rec->postcreated,get_string('strftimedatetimeshort', 'langconfig')));
372
                    $item->title = format_string($forum->name.' '.userdate($rec->postcreated,get_string('strftimedatetimeshort', 'langconfig')));
376
                }
373
                }
377
                $item->author = fullname($rec);
374
                $item->author = fullname($rec);
378
                $message = file_rewrite_pluginfile_urls($rec->postmessage, 'pluginfile.php', $context->id,
375
                $message = file_rewrite_pluginfile_urls($rec->postmessage, 'pluginfile.php', $context->id,
379
                        'mod_forum', 'post', $rec->postid);
376
                        'mod_forum', 'post', $rec->postid);
380
                $formatoptions->trusted = $rec->posttrust;
-
 
381
            }
377
            }
Línea 382... Línea 378...
382
 
378
 
383
            if ($isdiscussion) {
379
            if ($isdiscussion) {
384
                $item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid;
380
                $item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid;
385
            } else {
381
            } else {
386
                $item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid."&parent=".$rec->postid;
382
                $item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid."&parent=".$rec->postid;
Línea 387... Línea 383...
387
            }
383
            }
-
 
384
 
388
 
385
            $item->description = format_text($message, $rec->postformat, [
-
 
386
                'context' => $context,
Línea 389... Línea 387...
389
            $formatoptions->trusted = $rec->posttrust;
387
                'trusted' => $rec->posttrust,
390
            $item->description = format_text($message, $rec->postformat, $formatoptions, $forum->course);
388
            ]);
391
 
389
 
392
            //TODO: MDL-31129 implement post attachment handling
390
            //TODO: MDL-31129 implement post attachment handling