mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
if there are multiple feeds within a single block the title of each feed is shown with a horizontal rule between feeds
This commit is contained in:
parent
19c6481869
commit
d6501ee371
1 changed files with 12 additions and 3 deletions
|
@ -82,9 +82,15 @@ class block_rss_client extends block_base {
|
||||||
// Daryl Hawes note: if count of rssidarray is greater than 1
|
// Daryl Hawes note: if count of rssidarray is greater than 1
|
||||||
// we should possibly display a drop down menu of selected feed titles
|
// we should possibly display a drop down menu of selected feed titles
|
||||||
// so user can select a single feed to view (similar to RSSFeed)
|
// so user can select a single feed to view (similar to RSSFeed)
|
||||||
|
$numids = count($rssidarray);
|
||||||
|
$count = 0;
|
||||||
if (!empty($rssidarray)) {
|
if (!empty($rssidarray)) {
|
||||||
foreach ($rssidarray as $rssid) {
|
foreach ($rssidarray as $rssid) {
|
||||||
$output .= $this->get_rss_by_id($rssid, $display_description, $shownumentries);
|
$output .= $this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false);
|
||||||
|
if ($numids > 1 && $count != $numids -1) {
|
||||||
|
$output .= '<hr width="80%" />';
|
||||||
|
}
|
||||||
|
$count ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +113,7 @@ class block_rss_client extends block_base {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function get_rss_by_id($rssid, $display_description, $shownumentries) {
|
function get_rss_by_id($rssid, $display_description, $shownumentries, $showtitle=false) {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
$returnstring = '';
|
$returnstring = '';
|
||||||
$rss_record = get_record('block_rss_client', 'id', $rssid);
|
$rss_record = get_record('block_rss_client', 'id', $rssid);
|
||||||
|
@ -122,6 +128,9 @@ class block_rss_client extends block_base {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($showtitle) {
|
||||||
|
$returnstring .= '<p><div class="rssclienttitle">'. $rss_record->title .'</div></p>';
|
||||||
|
}
|
||||||
if ($shownumentries > 0 && $shownumentries < count($rss->items) ) {
|
if ($shownumentries > 0 && $shownumentries < count($rss->items) ) {
|
||||||
$count_to = $shownumentries;
|
$count_to = $shownumentries;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue