From 4d0ccfa7de544ddd3cd9bf22346b25dcb726777c Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 23 Mar 2007 08:01:01 +0000 Subject: [PATCH] MDL-8922 More work on fixing RSS block XHTML --- 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 618f5afc1f..982098f98c 100644 --- a/blocks/rss_client/config_instance.html +++ b/blocks/rss_client/config_instance.html @@ -22,10 +22,10 @@ print_box_start(); ?> - - - - - - + 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 @@ print_box_start();
+ + - + + config) && isset($this->config->rssid)) { @@ -87,9 +87,9 @@ print_box_start(); } $checked = ''; if (in_array($rssfeed->id, $selectedarray)) { - $checked = 'checked'; + $checked = 'checked="checked"'; } - $checkbox = ''; + $checkbox = ''; print $checkbox . $feedtitle .'
'."\n"; } } else { @@ -112,20 +112,20 @@ print_box_start();
+
+ config) && isset($this->config->block_rss_client_show_channel_link)) { $selected = $this->config->block_rss_client_show_channel_link; @@ -141,8 +141,8 @@ print_box_start();
+ config) && isset($this->config->block_rss_client_show_channel_image)) { $selected = $this->config->block_rss_client_show_channel_image; @@ -158,23 +158,23 @@ print_box_start();
+
\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 0cca837c3e..e083d82ae6 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -495,7 +495,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 58e982347e..5327960057 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 @@ onClick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementId('bl $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 70ffc7280a..c59dc3d9cd 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."