diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 1451c8ac6c1..cbfa9e26687 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -2091,7 +2091,7 @@ function remove_admin($userid) {
*/
function remove_course_contents($courseid, $showfeedback=true) {
- global $CFG, $THEME, $USER, $SESSION;
+ global $CFG, $USER, $SESSION;
$result = true;
@@ -2245,7 +2245,6 @@ function remove_course_contents($courseid, $showfeedback=true) {
/// of the course.
*
* @uses $USER
- * @uses $THEME
* @uses $SESSION
* @uses $CFG
* @param int $courseid The id of the course that is being viewed
@@ -2262,7 +2261,7 @@ function remove_course_userdata($courseid, $showfeedback=true,
$removestudents=true, $removeteachers=false, $removegroups=true,
$removeevents=true, $removelogs=false) {
- global $CFG, $THEME, $USER, $SESSION;
+ global $CFG, $USER, $SESSION;
$result = true;
diff --git a/lib/rsslib.php b/lib/rsslib.php
index 0ad5a7e861c..0b22b23310d 100644
--- a/lib/rsslib.php
+++ b/lib/rsslib.php
@@ -4,7 +4,7 @@
//This function returns the icon (from theme) with the link to rss/file.php
function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext='') {
- global $CFG, $THEME, $USER;
+ global $CFG, $USER;
static $pixpath = '';
static $rsspath = '';
@@ -21,15 +21,7 @@ function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext='') {
$rsspath = "$CFG->wwwroot/rss/file.php?file=/$courseid/$userid/$modulename/$id/rss.xml";
}
- if (empty($pixpath)) {
- if (empty($THEME->custompix)) {
- $pixpath = $CFG->wwwroot .'/pix';
- } else {
- $pixpath = $CFG->wwwroot .'/theme/'. $CFG->theme .'/pix';
- }
- }
-
- $rsspix = $pixpath .'/i/rss.gif';
+ $rsspix = $CFG->pixpath .'/i/rss.gif';
return '';
@@ -132,7 +124,7 @@ function rss_file_name($modname, $mod) {
//This function return all the common headers for every rss feed in the site
function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
- global $CFG, $THEME, $USER;
+ global $CFG, $USER;
static $pixpath = '';
@@ -178,15 +170,7 @@ function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
}
//write image info
- //Calculate the origin
- if (empty($pixpath)) {
- if (empty($THEME->custompix)) {
- $pixpath = "$CFG->wwwroot/pix";
- } else {
- $pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
- }
- }
- $rsspix = $pixpath."/i/rsssitelogo.gif";
+ $rsspix = $CFG->pixpath."/i/rsssitelogo.gif";
//write the info
$result .= rss_start_tag("image",2,true);
@@ -355,70 +339,53 @@ define('SUBMITTERS_ADMIN_AND_TEACHER', 2);
* @param int $rssid .
*/
function rss_display_feeds($rssid='none') {
- global $db, $USER, $CFG, $THEME;
+ global $db, $USER, $CFG;
global $blogid; //hackish, but if there is a blogid it would be good to preserve it
- static $pixpath = '';
- if (empty($pixpath)) {
- if (empty($THEME->custompix)) {
- $pixpath = $CFG->wwwroot .'/pix';
- } else {
- $pixpath = $CFG->wwwroot .'/theme/'. $CFG->theme .'/pix';
- }
- }
-
- $rsspix = $pixpath .'/i/rss.gif';
+ $rsspix = $CFG->pixpath .'/i/rss.gif';
$closeTable = false;
- //Daryl Hawes note: convert this sql statement to a moodle function call
if ($rssid != 'none'){
- $sql = 'SELECT * FROM '. $CFG->prefix .'block_rss_client WHERE id='. $rssid;
+ $feeds = get_records('block_rss_client', 'id', $rssid);
} else {
- $sql = 'SELECT * FROM '. $CFG->prefix .'block_rss_client';
+ $feeds = get_records('block_rss_client');
}
- $res = $db->Execute($sql);
-// print_object($res); //debug
-
- if ($res->fields){
+ if ($feeds){
$closeTable = true;
?>