Skip to content

Commit

Permalink
rss MDL-23588 refactored rss block to use html_writer
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Aug 2, 2010
1 parent f49c536 commit cdb4a88
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions blocks/rss_client/block_rss_client.php
Expand Up @@ -240,24 +240,23 @@ function get_item_html($item){
$link = $item->get_id();
}

$r = "<li>\n";
$r.= '<div class="link"><a href="'.urldecode($link).'" onclick="this.target=\'_blank\'" >'."\n";
$r.= s($title);
$r.= "</a></div>\n";
$r = html_writer::start_tag('li');
$r.= html_writer::start_tag('div',array('class'=>'link'));
$r.= html_writer::link(urldecode($link), s($title), array('onclick'=>'this.target="_blank"'));
$r.= html_writer::end_tag('div');

if($this->config->display_description && !empty($description)){
if($this->config->display_description && !empty($description)){

$description = break_up_long_words($description, 30);
$description = break_up_long_words($description, 30);

$formatoptions = new object;
$formatoptions->para = false;
$formatoptions = new object;
$formatoptions->para = false;

$r.= '<div class="description">';
$r.= format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);
$r.= '</div>';
}

$r.= '</li>';
$r.= html_writer::start_tag('div',array('class'=>'description'));
$r.= format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);
$r.= html_writer::end_tag('div');
}
$r.= html_writer::end_tag('li');

return $r;
}
Expand Down

0 comments on commit cdb4a88

Please sign in to comment.