mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
should be fix for bug 3478
This commit is contained in:
parent
6bcfd67887
commit
d396889452
6 changed files with 61 additions and 45 deletions
|
@ -3,6 +3,7 @@
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* This file contains one class which...
|
* This file contains one class which...
|
||||||
*
|
*
|
||||||
|
* @todo Finish documenting this file
|
||||||
* @author Daryl Hawes
|
* @author Daryl Hawes
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is for a block which....
|
* This class is for a block which....
|
||||||
|
* @todo Finish documenting this class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Developer's debug assistant - if true then the display string will not cache, only
|
// Developer's debug assistant - if true then the display string will not cache, only
|
||||||
|
@ -103,11 +105,11 @@ class block_rss_client extends block_base {
|
||||||
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
||||||
if (isset($this->config)) {
|
if (isset($this->config)) {
|
||||||
// this instance is configured - show Add/Edit feeds link
|
// this instance is configured - show Add/Edit feeds link
|
||||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds'));
|
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $this->courseid));
|
||||||
$output .= '<div align="center"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
|
$output .= '<div align="center"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
// this instance has not been configured yet - show configure link
|
// this instance has not been configured yet - show configure link
|
||||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock'));
|
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $this->courseid));
|
||||||
$output .= '<div align="center"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
|
$output .= '<div align="center"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
$act = optional_param('act', 'none' );
|
$act = optional_param('act', 'none' );
|
||||||
$rssid = optional_param('rssid', 'none' );
|
$rssid = optional_param('rssid', 'none' );
|
||||||
$courseid = optional_param('courseid', SITEID, PARAM_INT);
|
$id = optional_param('id', SITEID, PARAM_INT);
|
||||||
$url = optional_param('url');
|
$url = optional_param('url');
|
||||||
$preferredtitle = optional_param('preferredtitle', '');
|
$preferredtitle = optional_param('preferredtitle', '');
|
||||||
$item = optional_param('item');
|
$item = optional_param('item');
|
||||||
|
@ -37,8 +37,10 @@
|
||||||
define('MAGPIE_OUTPUT_ENCODING', get_string('thischarset')); // see bug 3107
|
define('MAGPIE_OUTPUT_ENCODING', get_string('thischarset')); // see bug 3107
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($courseid)) {
|
if (!empty($id)) {
|
||||||
$course = get_record('course', 'id', $courseid, '', '', '', '', 'shortname');
|
// we get the complete $course object here because print_header assumes this is
|
||||||
|
// a complete object (needed for proper course theme settings)
|
||||||
|
$course = get_record('course', 'id', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$straddedit = get_string('feedsaddedit', 'block_rss_client');
|
$straddedit = get_string('feedsaddedit', 'block_rss_client');
|
||||||
|
@ -48,7 +50,7 @@
|
||||||
$navigation = "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradmin</a> -> ".
|
$navigation = "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradmin</a> -> ".
|
||||||
"<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">$strconfiguration</a> -> $straddedit";
|
"<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">$strconfiguration</a> -> $straddedit";
|
||||||
} else if (!empty($course)) {
|
} else if (!empty($course)) {
|
||||||
$navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> -> $straddedit";
|
$navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$id\">$course->shortname</a> -> $straddedit";
|
||||||
} else {
|
} else {
|
||||||
$navigation = $straddedit;
|
$navigation = $straddedit;
|
||||||
}
|
}
|
||||||
|
@ -61,18 +63,22 @@
|
||||||
$submitters = $CFG->block_rss_client_submitters;
|
$submitters = $CFG->block_rss_client_submitters;
|
||||||
$isteacher = false;
|
$isteacher = false;
|
||||||
if (!empty($course)) {
|
if (!empty($course)) {
|
||||||
$isteacher = isteacher($course->id);
|
$isteacher = isteacher($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rss_record = get_record('block_rss_client', 'id', $rssid);
|
||||||
|
|
||||||
//if the user is an admin or course teacher then allow the user to
|
//if the user is an admin or course teacher then allow the user to
|
||||||
//assign categories to other uses than personal
|
//assign categories to other uses than personal
|
||||||
if (!( isadmin() || $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS || ($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher) ) ) {
|
if (!( isadmin() || $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS ||
|
||||||
|
($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher) ||
|
||||||
|
( ($act == 'rss_edit' || $act == 'delfeed') && $USER->id == $rss_record->userid) ) ) {
|
||||||
error(get_string('noguestpost', 'forum').' You are not allowed to make modifications to this RSS feed at this time.', $referrer);
|
error(get_string('noguestpost', 'forum').' You are not allowed to make modifications to this RSS feed at this time.', $referrer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($act == 'none') {
|
if ($act == 'none') {
|
||||||
rss_display_feeds();
|
rss_display_feeds($id);
|
||||||
rss_get_form($act, $url, $rssid, $preferredtitle, $courseid);
|
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
|
||||||
|
|
||||||
} else if ($act == 'updfeed') {
|
} else if ($act == 'updfeed') {
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
|
@ -154,19 +160,18 @@
|
||||||
}
|
}
|
||||||
redirect($referrer, $message);
|
redirect($referrer, $message);
|
||||||
/*
|
/*
|
||||||
rss_display_feeds();
|
rss_display_feeds($id);
|
||||||
rss_get_form($act, $dataobject->url, $dataobject->id, $dataobject->preferredtitle, $courseid);
|
rss_print_form($act, $dataobject->url, $dataobject->id, $dataobject->preferredtitle, $id);
|
||||||
*/
|
*/
|
||||||
} else if ( $act == 'rss_edit') {
|
} else if ( $act == 'rss_edit') {
|
||||||
|
|
||||||
$rss_record = get_record('block_rss_client', 'id', $rssid);
|
|
||||||
$preferredtitle = stripslashes_safe($rss_record->preferredtitle);
|
$preferredtitle = stripslashes_safe($rss_record->preferredtitle);
|
||||||
if (empty($preferredtitle)) {
|
if (empty($preferredtitle)) {
|
||||||
$preferredtitle = stripslashes_safe($rss_record->title);
|
$preferredtitle = stripslashes_safe($rss_record->title);
|
||||||
}
|
}
|
||||||
$url = stripslashes_safe($rss_record->url);
|
$url = stripslashes_safe($rss_record->url);
|
||||||
rss_display_feeds('', $rssid);
|
rss_display_feeds($id, '', $rssid);
|
||||||
rss_get_form($act, $url, $rssid, $preferredtitle, $courseid);
|
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
|
||||||
|
|
||||||
} else if ($act == 'delfeed') {
|
} else if ($act == 'delfeed') {
|
||||||
|
|
||||||
|
@ -185,7 +190,6 @@
|
||||||
} else if ($act == 'view') {
|
} else if ($act == 'view') {
|
||||||
// echo $sql; //debug
|
// echo $sql; //debug
|
||||||
// print_object($res); //debug
|
// print_object($res); //debug
|
||||||
$rss_record = get_record('block_rss_client', 'id', $rssid);
|
|
||||||
if (!$rss_record->id) {
|
if (!$rss_record->id) {
|
||||||
print '<strong>'. get_string('couldnotfindfeed', 'block_rss_client') .': '. $rssid .'</strong>';
|
print '<strong>'. get_string('couldnotfindfeed', 'block_rss_client') .': '. $rssid .'</strong>';
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,8 +237,8 @@
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rss_display_feeds();
|
rss_display_feeds($id);
|
||||||
rss_get_form($act, $url, $rssid, $preferredtitle, $courseid);
|
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_footer();
|
print_footer();
|
||||||
|
|
|
@ -63,11 +63,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td colspan="3" align="center"><a href=" <?php echo $CFG->wwwroot; ?>/blocks/rss_client/block_rss_client_action.php?courseid=<?php
|
<td colspan="3" align="center"><a href=" <?php echo $CFG->wwwroot; ?>/blocks/rss_client/block_rss_client_action.php?id=<?php
|
||||||
if (!isset($courseid)) {
|
if (!isset($id)) {
|
||||||
$courseid = '';
|
$id = '';
|
||||||
}
|
}
|
||||||
echo $courseid; ?>"><?php print_string('feedsaddedit', 'block_rss_client')?></a></center><br /><br />
|
echo $id; ?>"><?php print_string('feedsaddedit', 'block_rss_client')?></a></center><br /><br />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once($CFG->libdir .'/rsslib.php');
|
require_once($CFG->libdir .'/rsslib.php');
|
||||||
|
|
||||||
$courseid = optional_param('courseid', SITEID, PARAM_INT);
|
$id = optional_param('id', SITEID, PARAM_INT);
|
||||||
|
|
||||||
//create a page object for url_get_full()
|
//create a page object for url_get_full()
|
||||||
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
||||||
|
@ -89,7 +89,7 @@ if ($currentaction == 'configblock') {
|
||||||
} else {
|
} else {
|
||||||
print_string('nofeeds', 'block_rss_client');
|
print_string('nofeeds', 'block_rss_client');
|
||||||
if ( isadmin() ) {
|
if ( isadmin() ) {
|
||||||
print ' <a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?courseid='. $courseid .'"> '. get_string('editnewsfeeds', 'block_rss_client') .'</a><br />';
|
print ' <a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $id .'"> '. get_string('editnewsfeeds', 'block_rss_client') .'</a><br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -149,8 +149,8 @@ if ($currentaction == 'configblock') {
|
||||||
global $act, $url, $rssid, $preferredtitle;
|
global $act, $url, $rssid, $preferredtitle;
|
||||||
print '<table cellpadding="9" cellspacing="0" class="blockconfigtable">';
|
print '<table cellpadding="9" cellspacing="0" class="blockconfigtable">';
|
||||||
print '<tr valign="top"><td>';
|
print '<tr valign="top"><td>';
|
||||||
rss_display_feeds();
|
rss_display_feeds($id);
|
||||||
print '</form>'; //not sure that this is needed
|
print '</form>'; //not sure that this is needed
|
||||||
rss_get_form($act, $url, $rssid, $preferredtitle, $courseid);
|
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
} ?>
|
} ?>
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
global $USER;
|
global $USER;
|
||||||
$tabs = $row = array();
|
$tabs = $row = array();
|
||||||
|
|
||||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock'));
|
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id));
|
||||||
$row[] = new tabobject('configblock', $script,
|
$row[] = new tabobject('configblock', $script,
|
||||||
get_string('configblock', 'block_rss_client'));
|
get_string('configblock', 'block_rss_client'));
|
||||||
|
|
||||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds'));
|
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id));
|
||||||
$row[] = new tabobject('managefeeds', $script,
|
$row[] = new tabobject('managefeeds', $script,
|
||||||
get_string('managefeeds', 'block_rss_client'));
|
get_string('managefeeds', 'block_rss_client'));
|
||||||
|
|
||||||
|
|
|
@ -344,10 +344,11 @@ define('SUBMITTERS_ADMIN_ONLY', 1);
|
||||||
define('SUBMITTERS_ADMIN_AND_TEACHER', 2);
|
define('SUBMITTERS_ADMIN_AND_TEACHER', 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param int $courseid The id of the course the user is currently viewing
|
||||||
* @param int $userid If present only entries added by this userid will be displayed
|
* @param int $userid If present only entries added by this userid will be displayed
|
||||||
* @param int $rssid If present the rss entry matching this id alone will be displayed
|
* @param int $rssid If present the rss entry matching this id alone will be displayed
|
||||||
*/
|
*/
|
||||||
function rss_display_feeds($userid='', $rssid='') {
|
function rss_display_feeds($courseid='', $userid='', $rssid='') {
|
||||||
global $db, $USER, $CFG;
|
global $db, $USER, $CFG;
|
||||||
global $blogid; //hackish, but if there is a blogid it would be good to preserve it
|
global $blogid; //hackish, but if there is a blogid it would be good to preserve it
|
||||||
|
|
||||||
|
@ -392,17 +393,18 @@ function rss_display_feeds($userid='', $rssid='') {
|
||||||
|
|
||||||
if ($feed->userid == $USER->id || isadmin()) {
|
if ($feed->userid == $USER->id || isadmin()) {
|
||||||
|
|
||||||
$feedicons = '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?act=rss_edit&rssid='. $feed->id .'&blogid='. $blogid .'">'.
|
$feedicons = '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&act=rss_edit&rssid='. $feed->id .'&blogid='. $blogid .'">'.
|
||||||
'<img src="'. $CFG->pixpath .'/t/edit.gif" alt="'. get_string('edit').'" title="'. get_string('edit') .'" /></a> '.
|
'<img src="'. $CFG->pixpath .'/t/edit.gif" alt="'. get_string('edit').'" title="'. get_string('edit') .'" /></a> '.
|
||||||
|
|
||||||
'<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?act=delfeed&rssid='. $feed->id.'&blogid='. $blogid .'" onclick="return confirm(\''. get_string('deletefeedconfirm', 'block_rss_client') .'\');">'.
|
'<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&act=delfeed&rssid='. $feed->id.'&blogid='. $blogid .'"
|
||||||
|
onclick="return confirm(\''. get_string('deletefeedconfirm', 'block_rss_client') .'\');">'.
|
||||||
'<img src="'. $CFG->pixpath .'/t/delete.gif" alt="'. get_string('delete').'" title="'. get_string('delete') .'" /></a>';
|
'<img src="'. $CFG->pixpath .'/t/delete.gif" alt="'. get_string('delete').'" title="'. get_string('delete') .'" /></a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$feedicons = '';
|
$feedicons = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$feedinfo = '<div class="title"><a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?act=view&rssid='.$feed->id .'&blogid='. $blogid .'">'
|
$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>';
|
.$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));
|
$table->add_data(array($feedinfo, $feedicons));
|
||||||
|
@ -425,16 +427,20 @@ function rss_unhtmlentities($string) {
|
||||||
return strtr ($string, $trans_tbl);
|
return strtr ($string, $trans_tbl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
function rss_print_form($act='none', $url='', $rssid='', $preferredtitle='', $courseid='') {
|
||||||
|
print rss_get_form($act, $url, $rssid, $preferredtitle, $courseid);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Prints or returns a form for managing rss feed entries.
|
* Prints or returns a form for managing rss feed entries.
|
||||||
* @param string $act The current action. If "rss_edit" then and "update" button is used, otherwise "add" is used.
|
* @param string $act The current action. If "rss_edit" then and "update" button is used, otherwise "add" is used.
|
||||||
* @param string $url The url of the feed that is being updated or NULL
|
* @param string $url The url of the feed that is being updated or NULL
|
||||||
* @param int $rssid The dataabse id of the feed that is being updated or NULL
|
* @param int $rssid The dataabse id of the feed that is being updated or NULL
|
||||||
* @param bool $printnow True if the generated form should be printed out, false if the string should be returned from this function quietly
|
* @param int $id The id of the course that is currently being viewed if applicable
|
||||||
* @param int $courseid The course that is currently being viewed if applicable
|
|
||||||
* @return string Either the form is printed directly and nothing is returned or the form is returned as a string
|
* @return string Either the form is printed directly and nothing is returned or the form is returned as a string
|
||||||
*/
|
*/
|
||||||
function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $printnow=true, $courseid=SITEID) {
|
function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $courseid='') {
|
||||||
global $USER, $CFG, $_SERVER, $blockid, $blockaction;
|
global $USER, $CFG, $_SERVER, $blockid, $blockaction;
|
||||||
global $blogid; //hackish, but if there is a blogid it would be good to preserve it
|
global $blogid; //hackish, but if there is a blogid it would be good to preserve it
|
||||||
$stredit = get_string('edit');
|
$stredit = get_string('edit');
|
||||||
|
@ -443,52 +449,56 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $prin
|
||||||
$straddfeed = get_string('addfeed', 'block_rss_client');
|
$straddfeed = get_string('addfeed', 'block_rss_client');
|
||||||
|
|
||||||
$returnstring = '<table align="center"><tbody><tr><td>'."\n";
|
$returnstring = '<table align="center"><tbody><tr><td>'."\n";
|
||||||
|
|
||||||
$returnstring .= '<form action="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php" method="POST" name="block_rss">'."\n";
|
$returnstring .= '<form action="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php" method="POST" name="block_rss">'."\n";
|
||||||
|
|
||||||
if ($act == 'rss_edit') {
|
if ($act == 'rss_edit') {
|
||||||
$returnstring .= $strupdatefeed;
|
$returnstring .= $strupdatefeed;
|
||||||
} else {
|
} else {
|
||||||
$returnstring .= $straddfeed;
|
$returnstring .= $straddfeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
$returnstring .= "\n".'<br /><input type="text" size="60" maxlength="256" name="url" value="';
|
$returnstring .= "\n".'<br /><input type="text" size="60" maxlength="256" name="url" value="';
|
||||||
if ($act == 'rss_edit') {
|
if ($act == 'rss_edit') {
|
||||||
$returnstring .= $url;
|
$returnstring .= $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
$returnstring .= '" />'."\n";
|
$returnstring .= '" />'."\n";
|
||||||
$returnstring .= '<br />'. get_string('customtitlelabel', 'block_rss_client');
|
$returnstring .= '<br />'. get_string('customtitlelabel', 'block_rss_client');
|
||||||
$returnstring .= '<br /><input type="text" size="60" maxlength="64" name="preferredtitle" value="';
|
$returnstring .= '<br /><input type="text" size="60" maxlength="64" name="preferredtitle" value="';
|
||||||
|
|
||||||
if ($act == 'rss_edit') {
|
if ($act == 'rss_edit') {
|
||||||
$returnstring .= $preferredtitle;
|
$returnstring .= $preferredtitle;
|
||||||
}
|
}
|
||||||
$returnstring .= '" />'."\n";
|
|
||||||
|
|
||||||
|
$returnstring .= '" />'."\n";
|
||||||
$returnstring .= '<input type="hidden" name="act" value="';
|
$returnstring .= '<input type="hidden" name="act" value="';
|
||||||
|
|
||||||
if ($act == 'rss_edit') {
|
if ($act == 'rss_edit') {
|
||||||
$returnstring .= 'updfeed';
|
$returnstring .= 'updfeed';
|
||||||
} else {
|
} else {
|
||||||
$returnstring .= 'addfeed';
|
$returnstring .= 'addfeed';
|
||||||
}
|
}
|
||||||
|
|
||||||
$returnstring .= '" />'."\n";
|
$returnstring .= '" />'."\n";
|
||||||
if ($act == 'rss_edit') {
|
if ($act == 'rss_edit') {
|
||||||
$returnstring .= '<input type="hidden" name="rssid" value="'. $rssid .'" />'. "\n";
|
$returnstring .= '<input type="hidden" name="rssid" value="'. $rssid .'" />'. "\n";
|
||||||
}
|
}
|
||||||
$returnstring .= '<input type="hidden" name="courseid" value="'. $courseid .'" />'."\n";
|
|
||||||
|
$returnstring .= '<input type="hidden" name="id" value="'. $courseid .'" />'."\n";
|
||||||
$returnstring .= '<input type="hidden" name="blogid" value="'. $blogid .'" />'."\n";
|
$returnstring .= '<input type="hidden" name="blogid" value="'. $blogid .'" />'."\n";
|
||||||
$returnstring .= '<input type="hidden" name="user" value="'. $USER->id .'" />'."\n";
|
$returnstring .= '<input type="hidden" name="user" value="'. $USER->id .'" />'."\n";
|
||||||
$returnstring .= '<br /><input type="submit" value="';
|
$returnstring .= '<br /><input type="submit" value="';
|
||||||
$validatestring = "<a href=\"#\"
|
$validatestring = "<a href=\"#\"
|
||||||
onClick=\"window.open('http://feedvalidator.org/check.cgi?url='+document.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='+document.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 == 'rss_edit') {
|
if ($act == 'rss_edit') {
|
||||||
$returnstring .= $stredit;
|
$returnstring .= $stredit;
|
||||||
} else {
|
} else {
|
||||||
$returnstring .= $stradd;
|
$returnstring .= $stradd;
|
||||||
}
|
}
|
||||||
|
|
||||||
$returnstring .= '" /> '. $validatestring .'</form>'."\n";
|
$returnstring .= '" /> '. $validatestring .'</form>'."\n";
|
||||||
$returnstring .= '</td></tr></tbody></table>'."\n";
|
$returnstring .= '</td></tr></tbody></table>'."\n";
|
||||||
|
|
||||||
if ($printnow){
|
|
||||||
print $returnstring;
|
|
||||||
}
|
|
||||||
return $returnstring;
|
return $returnstring;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue