mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-8922 More work on fixing RSS block XHTML
This commit is contained in:
parent
e92751686f
commit
4d0ccfa7de
@ -22,10 +22,10 @@ print_box_start();
|
||||
?>
|
||||
<table cellpadding="9" cellspacing="0" class="blockconfigtable">
|
||||
<tr valign="top">
|
||||
<td align="right" width="50%">
|
||||
<td class="label">
|
||||
<?php print_string('displaydescriptionlabel', 'block_rss_client') ?>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<td class="value">
|
||||
<?php
|
||||
if(! isset($CFG->block_rss_client_display_description) ) {
|
||||
$CFG->block_rss_client_display_description = '0';
|
||||
@ -42,10 +42,10 @@ print_box_start();
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right" width="50%">
|
||||
<td class="label">
|
||||
<?php print_string('shownumentrieslabel', 'block_rss_client') ?>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<td class="value">
|
||||
<input name="shownumentries" type="text" size="5" value="<?php
|
||||
if(! isset($CFG->block_rss_client_num_entries) ) {
|
||||
$CFG->block_rss_client_num_entries = '5';
|
||||
@ -61,10 +61,10 @@ print_box_start();
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right" width="50%">
|
||||
<td class="label">
|
||||
<?php print_string('choosefeedlabel', 'block_rss_client') ?>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<td class="value">
|
||||
<?php
|
||||
$selectedarray = array();
|
||||
if (isset($this->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 = '<input type="checkbox" name="rssid[]" id="rssid[]" value="'. $rssfeed->id .'" '. $checked .' />';
|
||||
$checkbox = '<input type="checkbox" name="rssid[]" id="rssid" value="'. $rssfeed->id .'" '. $checked .' />';
|
||||
print $checkbox . $feedtitle .'<br />'."\n";
|
||||
}
|
||||
} else {
|
||||
@ -112,20 +112,20 @@ print_box_start();
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right" width="50%"><?php print_string('uploadlabel'); ?></td>
|
||||
<td class="label"><?php print_string('uploadlabel'); ?></td>
|
||||
<?php
|
||||
$title = '';
|
||||
if (!empty($this->config) && !empty($this->config->title)) {
|
||||
$title = $this->config->title;
|
||||
}
|
||||
?>
|
||||
<td width="50%"><input type="text" name="title" size="30" value="<?php echo $title; ?>" />
|
||||
<td class="value"><input type="text" name="title" size="30" value="<?php echo $title; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right" width="50%"><?php print_string('clientshowchannellinklabel', 'block_rss_client'); ?></td>
|
||||
<td width="50%">
|
||||
<td class="label"><?php print_string('clientshowchannellinklabel', 'block_rss_client'); ?></td>
|
||||
<td class="value">
|
||||
<?php
|
||||
if (isset($this->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();
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right" width="50%"><?php print_string('clientshowimagelabel', 'block_rss_client'); ?></td>
|
||||
<td width="50%">
|
||||
<td class="label"><?php print_string('clientshowimagelabel', 'block_rss_client'); ?></td>
|
||||
<td class="value">
|
||||
<?php
|
||||
if (isset($this->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();
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<td colspan="2" class="submit">
|
||||
<input type="submit" value="<?php print_string('savechanges') ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
print_box_end();
|
||||
print "<!-- code came from " . __FILE__ . " at line " . __LINE__ . ". -->\n";
|
||||
} else {
|
||||
global $act, $url, $rssid, $preferredtitle, $shared;
|
||||
global $act, $url, $rssid, $preferredtitle, $shared;
|
||||
print '</form>'; // Closes off page form
|
||||
|
||||
print '</form>'; // 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();
|
||||
}
|
||||
?>
|
||||
|
@ -495,7 +495,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid,
|
||||
$page->print_header(get_string('pageheaderconfigablock', 'moodle'), array($strheading => ''));
|
||||
|
||||
echo '<div class="block-config" id="'.$block->name.'">'; /// Make CSS easier
|
||||
|
||||
|
||||
print_heading($strheading);
|
||||
echo '<form method="post" action="'. $page->url_get_path() .'">';
|
||||
echo '<p>';
|
||||
|
@ -419,7 +419,15 @@ function rss_display_feeds($courseid, $userid, $rssid='', $context) {
|
||||
$feedicons = '';
|
||||
}
|
||||
|
||||
$feedinfo = '<div class="title"><a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&act=view&rssid='.$feed->id .'&blogid='. $blogid .'">'. $feedtitle .'</a></div><div class="url"><a href="'. $feed->url .'">'. $feed->url .'</a></div><div class="description">'.$feed->description.'</div>';
|
||||
$feedinfo = '
|
||||
<div class="title">
|
||||
<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&act=view&rssid='.$feed->id .'&blogid='. $blogid .'">
|
||||
'. $feedtitle .'</a>
|
||||
</div>
|
||||
<div class="url">
|
||||
<a href="'. $feed->url .'">'. $feed->url .'</a>
|
||||
</div>
|
||||
<div class="description">'.$feed->description.'</div>';
|
||||
|
||||
$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 = '<table align="center"><tbody><tr><td>'."\n";
|
||||
$returnstring .= '<form action="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php" method="post" id="block_rss">'."\n";
|
||||
|
||||
$returnstring = '';
|
||||
|
||||
$returnstring .= '<form action="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php" method="post" id="block_rss">'."\n";
|
||||
print_location_comment(__FILE__,__LINE__);
|
||||
$returnstring .= '<div id="rss_table">'."\n";
|
||||
if ($act == 'rssedit') {
|
||||
$returnstring .= $strupdatefeed;
|
||||
} else {
|
||||
@ -508,7 +518,7 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar
|
||||
$returnstring .= '<input type="hidden" name="user" value="'. $USER->id .'" />'."\n";
|
||||
$returnstring .= '<br /><input type="submit" value="';
|
||||
$validatestring = "<a href=\"#\"
|
||||
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')."</a>";
|
||||
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')."</a>";
|
||||
|
||||
if ($act == 'rssedit') {
|
||||
$returnstring .= $stredit;
|
||||
@ -516,9 +526,9 @@ onClick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementId('bl
|
||||
$returnstring .= $stradd;
|
||||
}
|
||||
|
||||
$returnstring .= '" /> '. $validatestring .'</form>'."\n";
|
||||
$returnstring .= '</td></tr></tbody></table>'."\n";
|
||||
return $returnstring;
|
||||
$returnstring .= '" /> '. $validatestring ."\n";
|
||||
// $returnstring .= '</div></form>'."\n"; // Avoiding nested forms... Ugly temporary hack #8922
|
||||
return $returnstring . print_location_comment(__FILE__, __LINE__, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2879,10 +2879,10 @@ function print_navigation ($navigation, $separator=0, $return=false) {
|
||||
$nav_text = get_string('youarehere','access');
|
||||
$output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
|
||||
|
||||
$output .= '<li class="first"><a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
|
||||
$output .= '<li class="first">'."\n".'<a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
|
||||
.$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
|
||||
&& !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
|
||||
? '/my' : '') .'/">'. format_string($site->shortname) ."</a></li>\n";
|
||||
? '/my' : '') .'/">'. format_string($site->shortname) ."</a>\n</li>\n";
|
||||
|
||||
|
||||
foreach ($navigation as $navitem) {
|
||||
@ -2892,8 +2892,8 @@ function print_navigation ($navigation, $separator=0, $return=false) {
|
||||
if (empty($url)) {
|
||||
$output .= '<li class="first">'."$separator $title</li>\n";
|
||||
} else {
|
||||
$output .= '<li class="first">'.$separator.' <a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
|
||||
.$url.'">'."$title</a></li>\n";
|
||||
$output .= '<li class="first">'."$separator\n<a ".$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
|
||||
.$url.'">'."$title</a>\n</li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -4354,31 +4354,31 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
|
||||
|
||||
if ($selectmod and has_capability('moodle/site:viewreports', $context)) {
|
||||
$logstext = get_string('alllogs');
|
||||
$logslink = '<li><a title="'.$logstext.'" '.$CFG->frametarget.' href="'.
|
||||
$logslink = '<li>'."\n".'<a title="'.$logstext.'" '.$CFG->frametarget.' href="'.
|
||||
$CFG->wwwroot.'/course/report/log/index.php?chooselog=1&user=0&date=0&id='.
|
||||
$course->id.'&modid='.$selectmod->cm.'">'.
|
||||
'<img class="icon log" src="'.$CFG->pixpath.'/i/log.gif" alt="'.$logstext.'" /></a></li>';
|
||||
'<img class="icon log" src="'.$CFG->pixpath.'/i/log.gif" alt="'.$logstext.'" /></a>'."\n".'</li>';
|
||||
|
||||
}
|
||||
if ($backmod) {
|
||||
$backtext= get_string('activityprev', 'access');
|
||||
$backmod = '<li><form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.$CFG->frametarget.'><div>'.
|
||||
'<input type="hidden" name="id" value="'.$backmod->cm.'" />'.
|
||||
'<button type="submit" title="'.$backtext.'">'.$THEME->larrow.
|
||||
'<span class="accesshide">'.$backtext.'</span></button></div></form></li>';
|
||||
$backmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.$CFG->frametarget.'>'."\n".'<div>'."\n".
|
||||
'<input type="hidden" name="id" value="'.$backmod->cm.'" />'."\n".
|
||||
'<button type="submit" title="'.$backtext.'">'.$THEME->larrow."\n".
|
||||
'<span class="accesshide">'.$backtext.'</span>'."\n".'</button>'."\n".'</div>'."\n".'</form>'."\n".'</li>'."\n";
|
||||
}
|
||||
if ($nextmod) {
|
||||
$nexttext= get_string('activitynext', 'access');
|
||||
$nextmod = '<li><form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php" '.$CFG->frametarget.'><div>'.
|
||||
'<input type="hidden" name="id" value="'.$nextmod->cm.'" />'.
|
||||
'<button type="submit" title="'.$nexttext.'">'.$THEME->rarrow.
|
||||
'<span class="accesshide">'.$nexttext.'</span></button></div></form></li>';
|
||||
$nextmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php" '.$CFG->frametarget.'>'."\n".'<div>'."\n".
|
||||
'<input type="hidden" name="id" value="'.$nextmod->cm.'" />'."\n".
|
||||
'<button type="submit" title="'.$nexttext.'">'.$THEME->rarrow."\n".
|
||||
'<span class="accesshide">'.$nexttext.'</span>'."\n".'</button>'."\n".'</div>'."\n".'</form>'."\n".'</li>'."\n";
|
||||
}
|
||||
|
||||
return '<div class="navigation"><ul>'.$logslink . $backmod .
|
||||
return '<div class="navigation">'."\n".'<ul>'.$logslink . $backmod .
|
||||
'<li>'.popup_form($CFG->wwwroot .'/mod/', $menu, 'navmenupopup', $selected, $strjumpto,
|
||||
'', '', true, $targetwindow).'</li>'.
|
||||
$nextmod . '</ul></div>';
|
||||
$nextmod . '</ul>'."\n".'</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5289,7 +5289,7 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
|
||||
else {
|
||||
$skip_text = get_string('skipa', 'access', strip_tags($title));
|
||||
}
|
||||
$skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'"><span class="accesshide">'.$skip_text.'</span></a>';
|
||||
$skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'">'."\n".'<span class="accesshide">'.$skip_text.'</span>'."\n".'</a>';
|
||||
$skip_dest = '<span id="sb-'.$block_id.'" class="skip-block-to"></span>';
|
||||
|
||||
if (! empty($heading)) {
|
||||
@ -5806,5 +5806,22 @@ function frametarget() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs a HTML comment to the browser. This is used for those hard-to-debug
|
||||
* pages that use bits from many different files in very confusing ways (e.g. blocks).
|
||||
* @usage print_location_comment(__FILE__, __LINE__);
|
||||
* @param string $file
|
||||
* @param integer $line
|
||||
* @param boolean $return Whether to return or print the comment
|
||||
* @return mixed Void unless true given as third parameter
|
||||
*/
|
||||
function print_location_comment($file, $line, $return = false)
|
||||
{
|
||||
if ($return) {
|
||||
return "<!-- $file at line $line -->\n";
|
||||
} else {
|
||||
echo "<!-- $file at line $line -->\n";
|
||||
}
|
||||
}
|
||||
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user