From 2e177ee4bc423ac03be7a10b5f81d5db1c7b0037 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 23 Mar 2007 07:58:25 +0000 Subject: [PATCH] MDL-8922 : More work on cleaning up RSS block, but not quite there yet. --- blocks/rss_client/config_instance.html | 46 +++++++++++------------ lib/blocklib.php | 2 +- lib/rsslib.php | 26 +++++++++---- lib/weblib.php | 51 +++++++++++++++++--------- 4 files changed, 76 insertions(+), 49 deletions(-) diff --git a/blocks/rss_client/config_instance.html b/blocks/rss_client/config_instance.html index 618f5afc1fc61..982098f98c903 100644 --- a/blocks/rss_client/config_instance.html +++ b/blocks/rss_client/config_instance.html @@ -22,10 +22,10 @@ ?> - - - - - - + config) && !empty($this->config->title)) { $title = $this->config->title; } ?> - - - + - - + -
+ + block_rss_client_display_description) ) { $CFG->block_rss_client_display_description = '0'; @@ -42,10 +42,10 @@
+ + - + + config) && isset($this->config->rssid)) { @@ -87,9 +87,9 @@ } $checked = ''; if (in_array($rssfeed->id, $selectedarray)) { - $checked = 'checked'; + $checked = 'checked="checked"'; } - $checkbox = ''; + $checkbox = ''; print $checkbox . $feedtitle .'
'."\n"; } } else { @@ -112,20 +112,20 @@
+
+ config) && isset($this->config->block_rss_client_show_channel_link)) { $selected = $this->config->block_rss_client_show_channel_link; @@ -141,8 +141,8 @@
+ config) && isset($this->config->block_rss_client_show_channel_image)) { $selected = $this->config->block_rss_client_show_channel_image; @@ -158,23 +158,23 @@
+
\n"; } else { - global $act, $url, $rssid, $preferredtitle, $shared; + global $act, $url, $rssid, $preferredtitle, $shared; + print ''; // Closes off page form - print ''; // Closes off page form + $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id); - $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id); - - print_box_start(); - rss_display_feeds($id, $USER->id, '', $context); - rss_print_form($act, $url, $rssid, $preferredtitle, $shared, $id, $context); - print_box_end(); + print_box_start(); + rss_display_feeds($id, $USER->id, '', $context); + rss_print_form($act, $url, $rssid, $preferredtitle, $shared, $id, $context); + print_box_end(); } ?> diff --git a/lib/blocklib.php b/lib/blocklib.php index 729a86fb9d0cc..341f18162b789 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -496,7 +496,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid, $page->print_header(get_string('pageheaderconfigablock', 'moodle'), array($strheading => '')); echo '
'; /// Make CSS easier - + print_heading($strheading); echo '
'; echo '

'; diff --git a/lib/rsslib.php b/lib/rsslib.php index 58e982347e7f7..532796005793d 100644 --- a/lib/rsslib.php +++ b/lib/rsslib.php @@ -419,7 +419,15 @@ function rss_display_feeds($courseid, $userid, $rssid='', $context) { $feedicons = ''; } - $feedinfo = '

'.$feed->description.'
'; + $feedinfo = ' + + +
'.$feed->description.'
'; $table->add_data(array($feedinfo, $feedicons)); } @@ -455,10 +463,12 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar $stradd = get_string('add'); $strupdatefeed = get_string('updatefeed', 'block_rss_client'); $straddfeed = get_string('addfeed', 'block_rss_client'); - - $returnstring = '
'."\n"; - $returnstring .= ''."\n"; + + $returnstring = ''; + $returnstring .= ''."\n"; + print_location_comment(__FILE__,__LINE__); + $returnstring .= '
'."\n"; if ($act == 'rssedit') { $returnstring .= $strupdatefeed; } else { @@ -508,7 +518,7 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar $returnstring .= ''."\n"; $returnstring .= '
". get_string('validatefeed', 'block_rss_client').""; +onclick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementId('block_rss').elements['url'].value,'validate','width=640,height=480,scrollbars=yes,status=yes,resizable=yes');return true;\">". get_string('validatefeed', 'block_rss_client').""; if ($act == 'rssedit') { $returnstring .= $stredit; @@ -516,9 +526,9 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar $returnstring .= $stradd; } - $returnstring .= '" /> '. $validatestring .''."\n"; - $returnstring .= '
'."\n"; - return $returnstring; + $returnstring .= '" /> '. $validatestring ."\n"; + // $returnstring .= '
'."\n"; // Avoiding nested forms... Ugly temporary hack #8922 + return $returnstring . print_location_comment(__FILE__, __LINE__, true); } diff --git a/lib/weblib.php b/lib/weblib.php index 0c0d19ea8ee96..a98d1a0704381 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2879,10 +2879,10 @@ function print_navigation ($navigation, $separator=0, $return=false) { $nav_text = get_string('youarehere','access'); $output .= '

'.$nav_text."