block_rss_client/rsslib MDL-1393 Clean up
- Remove obsolete magpie configuration - Remove block_rss_client_submitters which has not been used for some time - Remove some block_rss_client setup from rsslib.php
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
function init() {
|
||||
$this->title = get_string('feedstitle', 'block_rss_client');
|
||||
$this->version = 2009072900;
|
||||
$this->version = 2009072901;
|
||||
$this->cron = 300; /// Set min time between cron executions to 300 secs (5 mins)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,13 @@ function xmldb_block_rss_client_upgrade($oldversion) {
|
||||
upgrade_block_savepoint($result, 2007080100, 'rss_client');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2009072901) {
|
||||
// Remove config variable which is no longer used..
|
||||
$result = $result && $DB->delete_records('config', array('name' =>'block_rss_client_submitters'));
|
||||
upgrade_block_savepoint($result, 2009072901, 'rss_client');
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php //$Id$
|
||||
|
||||
require_once($CFG->libdir.'/rsslib.php');
|
||||
<?php
|
||||
|
||||
$settings->add(new admin_setting_configtext('block_rss_client_num_entries', get_string('numentries', 'block_rss_client'),
|
||||
get_string('clientnumentries', 'block_rss_client'), 5, PARAM_INT));
|
||||
@@ -8,11 +6,5 @@ $settings->add(new admin_setting_configtext('block_rss_client_num_entries', get_
|
||||
$settings->add(new admin_setting_configtext('block_rss_client_timeout', get_string('timeout2', 'block_rss_client'),
|
||||
get_string('timeout', 'block_rss_client'), 30, PARAM_INT));
|
||||
|
||||
$options = array (SUBMITTERS_ALL_ACCOUNT_HOLDERS => get_string('everybody'),
|
||||
SUBMITTERS_ADMIN_ONLY => get_string('administrators'),
|
||||
SUBMITTERS_ADMIN_AND_TEACHER => get_string('administratorsandteachers'));
|
||||
$settings->add(new admin_setting_configselect('block_rss_client_submitters', get_string('submitters2', 'block_rss_client'),
|
||||
get_string('submitters', 'block_rss_client'), SUBMITTERS_ADMIN_ONLY, $options));
|
||||
|
||||
$link ='<a href="'.$CFG->wwwroot.'/blocks/rss_client/managefeeds.php">'.get_string('feedsaddedit', 'block_rss_client').'</a>';
|
||||
$settings->add(new admin_setting_heading('block_rss_addheading', '', $link));
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
if (!defined('MAGPIE_OUTPUT_ENCODING')) {
|
||||
define('MAGPIE_OUTPUT_ENCODING', 'utf-8'); // see bug 3107
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns the icon (from theme) with the link to rss/file.php
|
||||
*
|
||||
@@ -382,32 +378,6 @@ function rss_full_tag($tag,$level=0,$endline=true,$content,$attributes=null) {
|
||||
return $st.$co.$et;
|
||||
}
|
||||
|
||||
//////////////////// LIBRARY FUNCTIONS FOR RSS_CLIENT BLOCK ////////////////
|
||||
|
||||
//initialize default config vars for rss_client block if needed
|
||||
if (!isset($CFG->block_rss_client_submitters) ) {
|
||||
$CFG->block_rss_client_submitters = 1; //default to admin only
|
||||
}
|
||||
if (empty($CFG->block_rss_client_num_entries) ) {
|
||||
$CFG->block_rss_client_num_entries = 5; //default to 5 entries per block
|
||||
}
|
||||
if (!isset($CFG->block_rss_client_timeout) ) {
|
||||
$CFG->block_rss_client_timeout = 30; //default to 30 mins
|
||||
}
|
||||
|
||||
// Defines for moodle's use of magpierss classes
|
||||
define('MAGPIE_DIR', $CFG->libdir.'/magpie/');
|
||||
define('MAGPIE_CACHE_DIR', $CFG->dataroot .'/cache/rsscache');
|
||||
define('MAGPIE_CACHE_ON', true); //might want to expose as an admin config option, but perhaps this is something that should truly just be on unless the code is tweaked
|
||||
define('MAGPIE_CACHE_FRESH_ONLY', false); //should be exposed as an admin config option
|
||||
define('MAGPIE_CACHE_AGE', $CFG->block_rss_client_timeout * 60);
|
||||
define('MAGPIE_DEBUG', $CFG->debug); // magpie, like moodle, takes an integer debug
|
||||
|
||||
// defines for config var block_rss_client_submitters
|
||||
define('SUBMITTERS_ALL_ACCOUNT_HOLDERS', 0);
|
||||
define('SUBMITTERS_ADMIN_ONLY', 1);
|
||||
define('SUBMITTERS_ADMIN_AND_TEACHER', 2);
|
||||
|
||||
/**
|
||||
* Adds RSS Media Enclosures for "podcasting" by examining links to media files,
|
||||
* and attachments which are media files. Please note that the RSS that is
|
||||
|
||||
Reference in New Issue
Block a user