Cleaning some trailing spaces here and there.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
/**
|
||||
* This class is for a block which defines a block for display on
|
||||
* any Moodle page.
|
||||
* any Moodle page.
|
||||
*/
|
||||
class block_rss_client extends block_base {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
function get_content() {
|
||||
global $CFG, $editing, $COURSE, $USER;
|
||||
|
||||
|
||||
if (!empty($COURSE)) {
|
||||
$this->courseid = $COURSE->id;
|
||||
}
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
if (!empty($this->config)) {
|
||||
if (!empty($this->config->rssid)) {
|
||||
if (is_array($this->config->rssid)) {
|
||||
if (is_array($this->config->rssid)) {
|
||||
$rssidarray = $this->config->rssid;
|
||||
} else { // Make an array of the single value
|
||||
$rssidarray = array($this->config->rssid);
|
||||
@@ -87,9 +87,9 @@
|
||||
$shownumentries = intval($this->config->shownumentries);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
|
||||
|
||||
if (has_capability('block/rss_client:createsharedfeeds', $context)
|
||||
|| has_capability('block/rss_client:createprivatefeeds', $context)) {
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
return '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_error.php?error='. urlencode($rsserror) .'">Error loading a feed.</a><br />'; //Daryl Hawes note: localize this line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($shownumentries > 0 && $shownumentries < count($rss->items) ) {
|
||||
$rss->items = array_slice($rss->items, 0, $shownumentries);
|
||||
}
|
||||
@@ -198,8 +198,8 @@
|
||||
$feedtitle = $this->format_title($rss_record->preferredtitle);
|
||||
}
|
||||
// print_object($rss);
|
||||
if (isset($this->config) &&
|
||||
isset($this->config->block_rss_client_show_channel_image) &&
|
||||
if (isset($this->config) &&
|
||||
isset($this->config->block_rss_client_show_channel_image) &&
|
||||
$this->config->block_rss_client_show_channel_image &&
|
||||
isset($rss->image) && isset($rss->image['link']) && isset($rss->image['title']) && isset($rss->image['url']) ) {
|
||||
$returnstring .= "\n".'<div class="image" title="'. $rss->image['title'] .'"><a href="'. $rss->image['link'] .'"><img src="'. $rss->image['url'] .'" alt="'. $rss->image['title'] .'" /></a></div>';
|
||||
@@ -240,7 +240,7 @@
|
||||
if ($display_description && !empty($item['description'])) {
|
||||
$item['description'] = break_up_long_words($item['description'], 30);
|
||||
$returnstring .= '<div class="description">'.
|
||||
format_text($item['description'], FORMAT_MOODLE, $formatoptions, $this->courseid) .
|
||||
format_text($item['description'], FORMAT_MOODLE, $formatoptions, $this->courseid) .
|
||||
'</div>';
|
||||
}
|
||||
$returnstring .= "</li>\n";
|
||||
@@ -249,7 +249,7 @@
|
||||
|
||||
if (!empty($rss->channel['link'])) {
|
||||
$rss->channel['link'] = str_replace('&', '&', $rss->channel['link']);
|
||||
|
||||
|
||||
if (!empty($this->config) && isset($this->config->block_rss_client_show_channel_link) && $this->config->block_rss_client_show_channel_link) {
|
||||
$this->content->footer = '<a href="'. $rss->channel['link'] .'">'. get_string('clientchannellink', 'block_rss_client') .'</a>';
|
||||
}
|
||||
|
||||
@@ -97,14 +97,14 @@ if (isset($rss_record)) {
|
||||
|
||||
|
||||
if ($act == 'updfeed') {
|
||||
|
||||
|
||||
if (!$managefeeds) {
|
||||
error(get_string('noguestpost', 'forum').
|
||||
' You are not allowed to make modifications to this RSS feed at this time.',
|
||||
$referrer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (empty($url)) {
|
||||
error( 'URL not defined for rss feed' );
|
||||
}
|
||||
@@ -148,10 +148,10 @@ if ($act == 'updfeed') {
|
||||
redirect($referrer, $message);
|
||||
|
||||
} else if ($act == 'addfeed' ) {
|
||||
|
||||
|
||||
$canaddprivfeeds = has_capability('block/rss_client:createprivatefeeds', $context);
|
||||
$canaddsharedfeeds = has_capability('block/rss_client:createsharedfeeds', $context);
|
||||
|
||||
|
||||
if (!$canaddprivfeeds && !$canaddsharedfeeds) {
|
||||
error('You do not have the permission to add RSS feeds');
|
||||
}
|
||||
@@ -164,13 +164,13 @@ if ($act == 'updfeed') {
|
||||
$dataobject->title = '';
|
||||
$dataobject->url = addslashes($url);
|
||||
$dataobject->preferredtitle = addslashes($preferredtitle);
|
||||
|
||||
|
||||
if ($shared == 1 && $canaddsharedfeeds) {
|
||||
$dataobject->shared = 1;
|
||||
} else {
|
||||
$dataobject->shared = 0;
|
||||
}
|
||||
|
||||
|
||||
$rssid = insert_record('block_rss_client', $dataobject);
|
||||
if (!$rssid) {
|
||||
error('There was an error trying to add a new rss feed:'. $url);
|
||||
@@ -197,7 +197,7 @@ if ($act == 'updfeed') {
|
||||
}
|
||||
if (!empty($rss->channel['title'])) {
|
||||
$dataobject->title = addslashes($rss->channel['title']);
|
||||
}
|
||||
}
|
||||
if (!update_record('block_rss_client', $dataobject)) {
|
||||
error('There was an error trying to update rss feed with id:'. $rssid);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ if ($act == 'updfeed') {
|
||||
rss_print_form($act, $url, $rssid, $preferredtitle, $shared, $id, $context);
|
||||
|
||||
} else if ($act == 'delfeed') {
|
||||
|
||||
|
||||
if (!$managefeeds) {
|
||||
error(get_string('noguestpost', 'forum').
|
||||
' You are not allowed to make modifications to this RSS feed at this time.',
|
||||
@@ -273,10 +273,10 @@ if ($act == 'updfeed') {
|
||||
if (file_exists($CFG->dirroot .'/blog/lib.php')) {
|
||||
//Blog module is installed - provide "blog this" link
|
||||
print '<td align="right">'."\n";
|
||||
|
||||
|
||||
/// MDL-9291, blog this feature needs further discussion/implementation
|
||||
/// temporarily disabling for now.
|
||||
|
||||
|
||||
// print '<img src="'. $CFG->pixpath .'/blog/blog.gif" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
|
||||
//print '<a href="'. $CFG->wwwroot .'/blog/blogthis.php?userid='. $USER->id .'&act=use&item='. $y .'&rssid='. $rssid .'"><small><strong>'. get_string('blogthis', 'blog') .'</strong></small></a>'."\n";
|
||||
} else {
|
||||
|
||||
@@ -4,11 +4,11 @@ require_once('../../config.php');
|
||||
|
||||
$error = required_param('error', PARAM_CLEAN);
|
||||
|
||||
print_header(get_string('error'),
|
||||
get_string('error'),
|
||||
print_header(get_string('error'),
|
||||
get_string('error'),
|
||||
get_string('error') );
|
||||
|
||||
print clean_text(urldecode($error));
|
||||
|
||||
print_footer();
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<td align="right">block_rss_client_num_entries:</td>
|
||||
<td>
|
||||
<input name="block" type="hidden" value="<?php echo intval($_REQUEST['block']); ?>" />
|
||||
<input name="block_rss_client_num_entries" type="text" size="5" value="<?php
|
||||
<input name="block_rss_client_num_entries" type="text" size="5" value="<?php
|
||||
if(isset($CFG->block_rss_client_num_entries)) {
|
||||
p($CFG->block_rss_client_num_entries);
|
||||
} else {
|
||||
@@ -21,7 +21,7 @@
|
||||
<tr valign="top">
|
||||
<td align="right">block_rss_timeout:</td>
|
||||
<td>
|
||||
<input name="block_rss_timeout" type="text" size="5" value="<?php
|
||||
<input name="block_rss_timeout" type="text" size="5" value="<?php
|
||||
if(isset($CFG->block_rss_timeout)) {
|
||||
p($CFG->block_rss_timeout);
|
||||
} else {
|
||||
@@ -47,7 +47,7 @@
|
||||
// things are not quite working yet to allow this - revisit later
|
||||
// also 'everybody' should be 'site members' or something clearer since
|
||||
// it does not include guests
|
||||
$options = array (
|
||||
$options = array (
|
||||
SUBMITTERS_ALL_ACCOUNT_HOLDERS => get_string('everybody'),
|
||||
SUBMITTERS_ADMIN_ONLY => get_string('administrators'),
|
||||
SUBMITTERS_ADMIN_AND_TEACHER => get_string('administratorsandteachers') );
|
||||
@@ -65,7 +65,7 @@
|
||||
<input type="submit" value="<?php print_string('savechanges') ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="center"><a href=" <?php echo $CFG->wwwroot; ?>/blocks/rss_client/block_rss_client_action.php?id=<?php
|
||||
<td colspan="3" align="center"><a href=" <?php echo $CFG->wwwroot; ?>/blocks/rss_client/block_rss_client_action.php?id=<?php
|
||||
if (!isset($id)) {
|
||||
$id = '';
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ print_box_start();
|
||||
<?php print_string('displaydescriptionlabel', 'block_rss_client') ?>
|
||||
</td>
|
||||
<td class="value">
|
||||
<?php
|
||||
<?php
|
||||
if(! isset($CFG->block_rss_client_display_description) ) {
|
||||
$CFG->block_rss_client_display_description = '0';
|
||||
}
|
||||
@@ -65,7 +65,7 @@ print_box_start();
|
||||
<?php print_string('choosefeedlabel', 'block_rss_client') ?>
|
||||
</td>
|
||||
<td class="value">
|
||||
<?php
|
||||
<?php
|
||||
$selectedarray = array();
|
||||
if (isset($this->config) && isset($this->config->rssid)) {
|
||||
if (is_array($this->config->rssid)) {
|
||||
@@ -77,14 +77,14 @@ print_box_start();
|
||||
}
|
||||
}
|
||||
global $USER;
|
||||
|
||||
|
||||
if ($rssfeeds = get_records_select('block_rss_client', 'userid = '.$USER->id.' OR shared = 1')) {
|
||||
foreach($rssfeeds as $rssfeed) {
|
||||
if (!empty($rssfeed->preferredtitle)) {
|
||||
$feedtitle = stripslashes_safe($rssfeed->preferredtitle);
|
||||
} else {
|
||||
$feedtitle = stripslashes_safe($rssfeed->title);
|
||||
}
|
||||
}
|
||||
$checked = '';
|
||||
if (in_array($rssfeed->id, $selectedarray)) {
|
||||
$checked = 'checked="checked"';
|
||||
@@ -95,10 +95,10 @@ print_box_start();
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
print_string('nofeeds', 'block_rss_client');
|
||||
|
||||
|
||||
if (has_capability('block/rss_client:createprivatefeeds', $context)
|
||||
|| has_capability('block/rss_client:createsharedfeeds', $context)) {
|
||||
|
||||
|
||||
$addrsspage = $page->url_get_full(array('instanceid' => $this->instance->id,
|
||||
'sesskey' => $USER->sesskey,
|
||||
'blockaction' => 'config',
|
||||
@@ -113,7 +113,7 @@ print_box_start();
|
||||
|
||||
<tr valign="top">
|
||||
<td class="label"><?php print_string('uploadlabel'); ?></td>
|
||||
<?php
|
||||
<?php
|
||||
$title = '';
|
||||
if (!empty($this->config) && !empty($this->config->title)) {
|
||||
$title = $this->config->title;
|
||||
|
||||
@@ -10,12 +10,12 @@ $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
|
||||
if (has_capability('moodle/site:manageblocks', $context)) {
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss'));
|
||||
$row[] = new tabobject('configblock', $script,
|
||||
$row[] = new tabobject('configblock', $script,
|
||||
get_string('configblock', 'block_rss_client'));
|
||||
}
|
||||
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id, 'section' => 'rss'));
|
||||
$row[] = new tabobject('managefeeds', $script,
|
||||
$row[] = new tabobject('managefeeds', $script,
|
||||
get_string('managefeeds', 'block_rss_client'));
|
||||
|
||||
$tabs[] = $row;
|
||||
|
||||
Reference in New Issue
Block a user