mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
rss MDL-23391 made lib/rsslib.php more generic
This commit is contained in:
parent
e269084401
commit
43b92251be
9 changed files with 40 additions and 37 deletions
|
@ -83,7 +83,7 @@
|
|||
require_once("$CFG->libdir/rsslib.php");
|
||||
|
||||
$rsstitle = format_string($course->shortname) . ': %fullname%';
|
||||
rss_add_http_header($modcontext, 'forum', $forum, $rsstitle);
|
||||
rss_add_http_header($modcontext, 'mod_forum', $forum, $rsstitle);
|
||||
}
|
||||
|
||||
if ($forum->type == 'news') {
|
||||
|
|
|
@ -63,7 +63,7 @@ function forum_rss_get_feed($context, $args) {
|
|||
|
||||
$forum = $DB->get_record('forum', array('id' => $forumid), '*', MUST_EXIST);
|
||||
|
||||
if (!rss_enabled('forum', $forum)) {
|
||||
if (!rss_enabled_for_mod('forum', $forum)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ function forum_rss_get_feed($context, $args) {
|
|||
|
||||
//hash the sql to get the cache file name
|
||||
$filename = rss_get_file_name($forum, $sql);
|
||||
$cachedfilepath = rss_get_file_full_name('forum', $filename);
|
||||
$cachedfilepath = rss_get_file_full_name('mod_forum', $filename);
|
||||
|
||||
//Is the cache out of date?
|
||||
$cachedfilelastmodified = 0;
|
||||
|
@ -83,7 +83,7 @@ function forum_rss_get_feed($context, $args) {
|
|||
//need to regenerate the cached version
|
||||
$result = forum_rss_feed_contents($forum, $sql);
|
||||
if (!empty($result)) {
|
||||
$status = rss_save_file('forum',$filename,$result);
|
||||
$status = rss_save_file('mod_forum',$filename,$result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ function forum_rss_get_feed($context, $args) {
|
|||
* @return void
|
||||
*/
|
||||
function forum_rss_delete_file($forum) {
|
||||
rss_delete_file('forum', $forum);
|
||||
rss_delete_file('mod_forum', $forum);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
require_once("$CFG->libdir/rsslib.php");
|
||||
|
||||
$rsstitle = format_string($course->shortname) . ': %fullname%';
|
||||
rss_add_http_header($context, 'forum', $forum, $rsstitle);
|
||||
rss_add_http_header($context, 'mod_forum', $forum, $rsstitle);
|
||||
}
|
||||
|
||||
/// Print header.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue