2004-12-14 18:09:20 +00:00
|
|
|
<table cellpadding="9" cellspacing="0">
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right">
|
2005-02-08 18:33:08 +00:00
|
|
|
<?php print_string('block_rss_display_description_label', 'block_rss_client') ?>
|
2004-12-14 18:09:20 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
if(! isset($CFG->block_rss_client_display_description) ) {
|
|
|
|
$CFG->block_rss_client_display_description = '0';
|
|
|
|
}
|
|
|
|
$selected = $CFG->block_rss_client_display_description;
|
|
|
|
if (isset($this->config) && isset($this->config->display_description)) {
|
|
|
|
$selected = $this->config->display_description;
|
|
|
|
}
|
|
|
|
$options[0] = get_string('no');
|
|
|
|
$options[1] = get_string('yes');
|
|
|
|
choose_from_menu ($options, 'display_description', $selected);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right">
|
2005-02-08 18:33:08 +00:00
|
|
|
<?php print_string('block_rss_shownumentries_label', 'block_rss_client') ?>
|
2004-12-14 18:09:20 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<input name="shownumentries" type="text" size="5" value="<?php
|
|
|
|
if(! isset($CFG->block_rss_client_num_entries) ) {
|
|
|
|
$CFG->block_rss_client_num_entries = '5';
|
|
|
|
}
|
|
|
|
$numentries = $CFG->block_rss_client_num_entries;
|
|
|
|
if (isset($this->config) && isset($this->config->shownumentries)) {
|
|
|
|
$numentries = intval($this->config->shownumentries);
|
|
|
|
}
|
|
|
|
|
|
|
|
p($numentries);
|
|
|
|
?>" />
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
2005-01-27 22:47:13 +00:00
|
|
|
<td align="right">
|
2005-02-08 18:33:08 +00:00
|
|
|
<?php print_string('block_rss_choose_feed_label', 'block_rss_client') ?>
|
2004-12-14 18:09:20 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
2004-12-31 02:22:30 +00:00
|
|
|
$selectedarray = array();
|
2004-12-14 18:09:20 +00:00
|
|
|
if (isset($this->config) && isset($this->config->rssid)) {
|
2004-12-31 02:22:30 +00:00
|
|
|
if (is_array($this->config->rssid)) {
|
2004-12-30 18:08:38 +00:00
|
|
|
// rssid is an array of rssids
|
|
|
|
$selectedarray = $this->config->rssid;
|
|
|
|
} else {
|
|
|
|
// rssid is a single rssid
|
|
|
|
$selectedarray = array($this->config->rssid);
|
|
|
|
}
|
2004-12-14 18:09:20 +00:00
|
|
|
}
|
|
|
|
if ($rssfeeds = get_records('block_rss_client')) {
|
|
|
|
foreach($rssfeeds as $rssfeed){
|
2005-01-28 01:21:08 +00:00
|
|
|
if (!empty($rssfeed->preferredtitle)) {
|
2005-01-29 03:01:18 +00:00
|
|
|
$feedtitle = stripslashes_safe($rssfeed->preferredtitle);
|
2005-01-28 01:21:08 +00:00
|
|
|
} else {
|
2005-01-29 03:01:18 +00:00
|
|
|
$feedtitle = stripslashes_safe($rssfeed->title);
|
2005-01-28 01:21:08 +00:00
|
|
|
}
|
|
|
|
$feedoptions[$rssfeed->id] = $feedtitle;
|
2004-12-14 18:09:20 +00:00
|
|
|
}
|
2004-12-30 18:08:38 +00:00
|
|
|
$dropdownmenustring = choose_from_menu($feedoptions, 'rssid[]', '', '', '', '0', true);
|
|
|
|
|
|
|
|
//Daryl Hawes note:
|
|
|
|
// moodle's choose_from_menu() function does not support
|
|
|
|
// the "multiple" or "size" options, so before printing out the
|
|
|
|
// calculated drop down menu we insert the keyword "multiple"
|
|
|
|
$dropdownmenustring = preg_replace("|\"rssid\[\]\" >*|","\"rssid[]\" multiple>", $dropdownmenustring);
|
|
|
|
|
|
|
|
// since there may be multiple rssids to select
|
|
|
|
// we need to check for each
|
2004-12-31 02:22:30 +00:00
|
|
|
if (!empty($selectedarray)) {
|
|
|
|
foreach ($selectedarray as $selected) {
|
|
|
|
$selected = intval($selected);
|
|
|
|
$dropdownmenustring = preg_replace("|\"$selected\">*|","\"$selected\" selected>", $dropdownmenustring);
|
|
|
|
}
|
2004-12-30 18:08:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print $dropdownmenustring;
|
|
|
|
|
2004-12-14 18:09:20 +00:00
|
|
|
} else {
|
|
|
|
print_string('block_rss_no_feeds', 'block_rss_client');
|
|
|
|
if ( isadmin() ){
|
|
|
|
print ' <a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php"> '. get_string('block_rss_edit_news_feeds', 'block_rss_client') .'</a><br />';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
2005-02-08 18:33:08 +00:00
|
|
|
<td align="right"><?php print_string('uploadlabel'); ?></td>
|
2004-12-30 18:08:38 +00:00
|
|
|
<?php
|
|
|
|
$title = '';
|
|
|
|
if (!empty($this->config) && !empty($this->config->title)) {
|
|
|
|
$title = $this->config->title;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<td><input type="text" name="title" size="30" value="<?php echo $title; ?>" />
|
2004-12-14 18:09:20 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2005-01-27 22:47:13 +00:00
|
|
|
<tr valign="top">
|
2005-02-08 18:33:08 +00:00
|
|
|
<td align="right"><?php print_string('block_rss_client_show_channel_link_label', 'block_rss_client'); ?></td>
|
2005-01-27 22:47:13 +00:00
|
|
|
<td>
|
2005-01-29 03:01:18 +00:00
|
|
|
<?php
|
|
|
|
if (isset($this->config) && isset($this->config->block_rss_client_show_channel_link)) {
|
|
|
|
$selected = $this->config->block_rss_client_show_channel_link;
|
2005-01-27 22:47:13 +00:00
|
|
|
} else {
|
|
|
|
$selected = '0';
|
|
|
|
}
|
|
|
|
$options = array ( '0' => get_string('no'),
|
|
|
|
'1' => get_string('yes') );
|
|
|
|
|
|
|
|
choose_from_menu ($options, 'block_rss_client_show_channel_link', $selected);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2005-01-29 03:01:18 +00:00
|
|
|
<tr valign="top">
|
2005-02-08 18:33:08 +00:00
|
|
|
<td align="right"><?php print_string('block_rss_client_show_image_label', 'block_rss_client'); ?></td>
|
2005-01-29 03:01:18 +00:00
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
if (isset($this->config) && isset($this->config->block_rss_client_show_channel_image)) {
|
|
|
|
$selected = $this->config->block_rss_client_show_channel_image;
|
|
|
|
} else {
|
|
|
|
$selected = '0';
|
|
|
|
}
|
|
|
|
$options = array ( '0' => get_string('no'),
|
|
|
|
'1' => get_string('yes') );
|
|
|
|
|
|
|
|
choose_from_menu ($options, 'block_rss_client_show_channel_image', $selected);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2004-12-14 18:09:20 +00:00
|
|
|
<tr>
|
|
|
|
<td colspan="2" align="center">
|
|
|
|
<input type="submit" value="<?php print_string('savechanges') ?>">
|
|
|
|
</td>
|
|
|
|
</tr>
|
2005-02-08 18:33:08 +00:00
|
|
|
</table>
|