From fd9576fb1b4a44920e55cae25bc31f96bbf3ed8e Mon Sep 17 00:00:00 2001 From: dhawes Date: Thu, 11 Aug 2005 12:45:38 +0000 Subject: [PATCH] spacing tidy up --- blocks/rss_client/block_rss_client.php | 21 +++++++-------- blocks/rss_client/block_rss_client_action.php | 14 +++++----- blocks/rss_client/block_rss_client_error.php | 18 ++++++------- blocks/rss_client/config_global.html | 6 ++--- blocks/rss_client/config_instance.html | 12 ++++++--- blocks/rss_client/config_instance_tabs.php | 26 +++++++++---------- 6 files changed, 51 insertions(+), 46 deletions(-) diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 7057b1399e2..218564d0879 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -40,7 +40,7 @@ class block_rss_client extends block_base { $this->title = get_string('remotenewsfeed', 'block_rss_client'); } } - + function get_content() { global $CFG, $editing; @@ -128,11 +128,11 @@ class block_rss_client extends block_base { $count ++; } } - + $this->content->text = $output; return $this->content; } - + function instance_allow_multiple() { return true; } @@ -144,7 +144,7 @@ class block_rss_client extends block_base { function instance_allow_config() { return true; } - + /** * @param int $rssid The feed to be displayed * @param bool $display_description Should the description information from the feed be displayed or simply the title? @@ -161,7 +161,7 @@ class block_rss_client extends block_base { if (!defined('MAGPIE_OUTPUT_ENCODING')) { define('MAGPIE_OUTPUT_ENCODING', get_string('thischarset')); // see bug 3107 } - + // Check if there is a cached string which has not timed out. if (BLOCK_RSS_SECONDARY_CACHE_ENABLED && isset($this->config->{'rssid'. $rssid}) && @@ -181,7 +181,7 @@ class block_rss_client extends block_base { $rss = fetch_rss($rss_record->url); $rsserror = ob_get_contents(); ob_end_clean(); - + if ($rss === false) { if ($CFG->debug && !empty($rsserror)) { // There was a failure in loading the rss feed, print link to full error text @@ -217,7 +217,7 @@ class block_rss_client extends block_base { if (empty($rss) || empty($rss->items)) { return ''; } - + foreach ($rss->items as $item) { $item['title'] = stripslashes_safe(rss_unhtmlentities($item['title'])); $item['description'] = stripslashes_safe(rss_unhtmlentities($item['description'])); @@ -227,7 +227,7 @@ class block_rss_client extends block_base { } else { $item['title'] = break_up_long_words($item['title'], 30); } - + if ($item['link'] == '') { $item['link'] = $item['guid']; } @@ -236,7 +236,6 @@ class block_rss_client extends block_base { $returnstring .= '' ."\n"; - if ($display_description && !empty($item['description'])) { $item['description'] = break_up_long_words($item['description'], 30); $returnstring .= '
'. @@ -263,7 +262,7 @@ class block_rss_client extends block_base { $this->title = $feedtitle; } } - + // store config setting for this rssid so we do not need to read from file each time $this->config->{'rssid'. $rssid} = addslashes($returnstring); $this->config->{'rssid'. $rssid .'timestamp'} = $now; @@ -271,4 +270,4 @@ class block_rss_client extends block_base { return $returnstring; } } -?> +?> \ No newline at end of file diff --git a/blocks/rss_client/block_rss_client_action.php b/blocks/rss_client/block_rss_client_action.php index 37b1653ff1b..0d68ceee269 100644 --- a/blocks/rss_client/block_rss_client_action.php +++ b/blocks/rss_client/block_rss_client_action.php @@ -54,7 +54,7 @@ } else { $navigation = $straddedit; } - + print_header(get_string('feedsaddedit', 'block_rss_client'), get_string('feedsaddedit', 'block_rss_client'), $navigation ); @@ -84,7 +84,7 @@ if (empty($url)) { error( 'url not defined for rss feed' ); } - + // By capturing the output from fetch_rss this way // error messages do not display and clutter up the moodle interface // however, we do lose out on seeing helpful messages like "cache hit", etc. @@ -95,7 +95,7 @@ $message .= ob_get_contents(); } ob_end_clean(); - + $dataobject->id = $rssid; if ($rss === false) { $dataobject->description = ''; @@ -141,7 +141,7 @@ $message .= ob_get_contents(); } ob_end_clean(); - + if ($rss === false) { $message .= '

There was an error loading this rss feed. You may want to verify the url you have specified before using it.'; //Daryl Hawes note: localize this line } else { @@ -174,7 +174,7 @@ rss_print_form($act, $url, $rssid, $preferredtitle, $id); } else if ($act == 'delfeed') { - + $file = $CFG->dataroot .'/cache/rsscache/'. $rssid .'.xml'; if (file_exists($file)) { unlink($file); @@ -199,7 +199,7 @@ ob_start(); $rss = fetch_rss($rss_record->url); ob_end_clean(); - + if (empty($rss_record->preferredtitle)) { $feedtitle = stripslashes_safe($rss_record->preferredtitle); } else { @@ -242,4 +242,4 @@ } print_footer(); -?> +?> \ No newline at end of file diff --git a/blocks/rss_client/block_rss_client_error.php b/blocks/rss_client/block_rss_client_error.php index 81be20ba958..11ef4aa9127 100644 --- a/blocks/rss_client/block_rss_client_error.php +++ b/blocks/rss_client/block_rss_client_error.php @@ -1,14 +1,14 @@ +print_footer(); +?> \ No newline at end of file diff --git a/blocks/rss_client/config_global.html b/blocks/rss_client/config_global.html index 824192c15ba..b218e536725 100644 --- a/blocks/rss_client/config_global.html +++ b/blocks/rss_client/config_global.html @@ -17,6 +17,7 @@ + block_rss_timeout: @@ -31,6 +32,7 @@ + block_rss_client_submitters: @@ -56,13 +58,11 @@ - -

- + \ No newline at end of file diff --git a/blocks/rss_client/config_instance.html b/blocks/rss_client/config_instance.html index 9372b68b9c8..f420f1744ea 100644 --- a/blocks/rss_client/config_instance.html +++ b/blocks/rss_client/config_instance.html @@ -1,4 +1,4 @@ -libdir .'/rsslib.php'); $id = optional_param('id', SITEID, PARAM_INT); @@ -7,7 +7,7 @@ $id = optional_param('id', SITEID, PARAM_INT); $page = page_create_object($this->instance->pagetype, $this->instance->pageid); /// Print tabs at top -$currentaction = optional_param( 'currentaction','',PARAM_ALPHA ); +$currentaction = optional_param('currentaction', '', PARAM_ALPHA); if (empty($currentaction) || $currentaction == 'configblock') { $currentaction = 'configblock'; } else { @@ -38,6 +38,7 @@ if ($currentaction == 'configblock') { ?> + @@ -56,6 +57,7 @@ if ($currentaction == 'configblock') { ?>" /> + @@ -95,6 +97,7 @@ if ($currentaction == 'configblock') { ?> + + @@ -122,6 +126,7 @@ if ($currentaction == 'configblock') { ?> + @@ -138,6 +143,7 @@ if ($currentaction == 'configblock') { ?> + @@ -153,4 +159,4 @@ if ($currentaction == 'configblock') { print ''; //not sure that this is needed rss_print_form($act, $url, $rssid, $preferredtitle, $id); print ''; -} ?> +} ?> \ No newline at end of file diff --git a/blocks/rss_client/config_instance_tabs.php b/blocks/rss_client/config_instance_tabs.php index 51d3199a671..56ab387eeea 100644 --- a/blocks/rss_client/config_instance_tabs.php +++ b/blocks/rss_client/config_instance_tabs.php @@ -2,21 +2,21 @@ /// This file to be included so we can assume config.php has already been included. /// We also assume that $inactive, $activetab and $currentaction have been set - global $USER; - $tabs = $row = array(); +global $USER; +$tabs = $row = array(); - $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id)); - $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' => 'configblock', 'id' => $id)); +$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)); - $row[] = new tabobject('managefeeds', $script, - get_string('managefeeds', 'block_rss_client')); +$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id)); +$row[] = new tabobject('managefeeds', $script, + get_string('managefeeds', 'block_rss_client')); - $tabs[] = $row; +$tabs[] = $row; - /// Print out the tabs and continue! - print '
'; - print_tabs($tabs, $currentaction); - print '
'; +/// Print out the tabs and continue! +print '
'; +print_tabs($tabs, $currentaction); +print '
'; ?> \ No newline at end of file