]> git.mjollnir.org Git - moodle.git/commitdiff
Now RSS links are displayed ok in SITEID course.
authorstronk7 <stronk7>
Mon, 4 Oct 2004 22:21:30 +0000 (22:21 +0000)
committerstronk7 <stronk7>
Mon, 4 Oct 2004 22:21:30 +0000 (22:21 +0000)
Bug 2048.
(http://moodle.org/bugs/bug.php?op=show&bugid=2048)

Merged from MOODLE_14_STABLE

mod/forum/index.php
mod/glossary/index.php
mod/glossary/view.php
rss/rsslib.php

index 65b5621848dce87dc7b729cadb1d9c10b9e5452a..c194b43a0bb5857f893d22b183045f9363e7a7ee 100644 (file)
@@ -45,7 +45,7 @@
     $generaltable->head  = array ($strforum, $strdescription, $strdiscussions);
     $generaltable->align = array ("left", "left", "center");
 
-    if ($can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin())) {
+    if ($can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin() or $course->id == SITEID)) {
         $generaltable->head[] = $strsubscribed;
         $generaltable->align[] = "center";
     }
     $learningtable->head  = array ($strforum, $strdescription, $strdiscussions);
     $learningtable->align = array ("left", "left", "center");
 
-    if ($can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin())) {
+    if ($can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin() or $course->id == SITEID)) {
         $learningtable->head[] = $strsubscribed;
         $learningtable->align[] = "center";
     }
index a9a2dc9cd22675d508a01bab714b32556b72da14..bc0a32d7e0d539451904d3dce1fecfb9ec932297 100644 (file)
@@ -55,7 +55,7 @@
         $table->align = array ("LEFT", "CENTER");
     }
 
-    $can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin());
+    $can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin() or $course->id == SITEID);
 
     if ($show_rss = ($can_subscribe && isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
                      $CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds)) {
index 64735ca2a9d4aa69d7fabd62c24d4d999a83c4b4..d1b1c72eca5d5818f14191f614ab3ded2f3ea8ab 100644 (file)
 
     //If rss are activated at site and glossary level and this glossary has rss defined, show link
         if (isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
-            $CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds && $glossary->rsstype and $glossary->rssarticles) {
+            $CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds && $glossary->rsstype && $glossary->rssarticles) {
             echo '<table width="100%" border="0" cellpadding="3" cellspacing="0"><tr valign="top"><td align="right">';
             $tooltiptext = get_string("rsssubscriberss","glossary",$glossary->name);
-            if (isset($USER->id)) {
-                rss_print_link($course->id, $USER->id, "glossary", $glossary->id, $tooltiptext);
-            }
+            rss_print_link($course->id, $USER->id, "glossary", $glossary->id, $tooltiptext);
             echo '</td></tr></table>';
         }
     
index 83393955b4919cbd46bb5228387b392e829c28cc..1cb69e068ab4583ca1ab6acf6d88cf4330606409 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP  // $Id$
+<?php  // $Id$
        // This file contains all the common stuff to be used in RSS System
 
 //This function returns the icon (from theme) with the link to rss/file.php
@@ -9,6 +9,12 @@ function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext="") {
     static $pixpath = '';
     static $rsspath = '';
 
+    //In site course, if no logged (userid), use admin->id. Bug 2048.
+    if ($courseid == SITEID and empty($userid)) {
+        $admin = get_admin();
+        $userid = $admin->id;
+    }
+
     if ($CFG->slasharguments) {
         $rsspath = "$CFG->wwwroot/rss/file.php/$courseid/$userid/$modulename/$id/rss.xml";
     } else {