fix for ugly url problem
This commit is contained in:
@@ -87,7 +87,7 @@ class block_rss_client extends block_base {
|
||||
}
|
||||
if ( $userisloggedin && (isadmin() || $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS || ($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher)) ) {
|
||||
|
||||
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
||||
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
||||
if (isset($this->config)) {
|
||||
// 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'));
|
||||
@@ -217,7 +217,7 @@ class block_rss_client extends block_base {
|
||||
$returnstring .= '<div class="link"><a href="'. $item['link'] .'" target="_new">'. $item['title'] . '</a></div>' ."\n";
|
||||
|
||||
|
||||
if ($display_description && !empty($item['description'])){
|
||||
if ($display_description && !empty($item['description'])) {
|
||||
$item['description'] = break_up_long_words($item['description'], 30);
|
||||
$returnstring .= '<div class="description">'.
|
||||
format_text($item['description'], FORMAT_MOODLE, $formatoptions, $this->courseid) .
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
global $USER;
|
||||
|
||||
//ensure that the logged in user is not using the guest account
|
||||
if (isset($_SERVER['HTTP_REFERER'])){
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
$referrer = $_SERVER['HTTP_REFERER'];
|
||||
} else {
|
||||
$referrer = $CFG->wwwroot;
|
||||
@@ -47,7 +47,7 @@
|
||||
//check to make sure that the user is allowed to post new feeds
|
||||
$submitters = $CFG->block_rss_client_submitters;
|
||||
$isteacher = false;
|
||||
if ($courseid != 'none'){
|
||||
if ($courseid != 'none') {
|
||||
$isteacher = isteacher($courseid);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
$dataobject->preferredtitle = addslashes($preferredtitle);
|
||||
|
||||
$rssid = insert_record('block_rss_client', $dataobject);
|
||||
if (!$rssid){
|
||||
if (!$rssid) {
|
||||
error('There was an error trying to add a new rss feed:'. $url);
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
// echo $sql; //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('block_rss_could_not_find_feed', 'block_rss_client') .': '. $rssid .'</strong>';
|
||||
} else {
|
||||
// By capturing the output from fetch_rss this way
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
require_once($CFG->libdir .'/rsslib.php');
|
||||
|
||||
//create a page object for url_get_full()
|
||||
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
|
||||
|
||||
/// Print tabs at top
|
||||
global $currentaction;
|
||||
if (empty($currentaction) || $currentaction == 'configblock') {
|
||||
@@ -7,6 +11,7 @@ if (empty($currentaction) || $currentaction == 'configblock') {
|
||||
} else {
|
||||
$currentaction = 'managefeeds';
|
||||
}
|
||||
|
||||
include('config_instance_tabs.php');
|
||||
|
||||
if ($currentaction == 'configblock') {
|
||||
@@ -66,7 +71,7 @@ if ($currentaction == 'configblock') {
|
||||
}
|
||||
}
|
||||
if ($rssfeeds = get_records('block_rss_client')) {
|
||||
foreach($rssfeeds as $rssfeed){
|
||||
foreach($rssfeeds as $rssfeed) {
|
||||
if (!empty($rssfeed->preferredtitle)) {
|
||||
$feedtitle = stripslashes_safe($rssfeed->preferredtitle);
|
||||
} else {
|
||||
@@ -95,7 +100,7 @@ if ($currentaction == 'configblock') {
|
||||
|
||||
} else {
|
||||
print_string('block_rss_no_feeds', 'block_rss_client');
|
||||
if ( isadmin() ){
|
||||
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 />';
|
||||
}
|
||||
}
|
||||
@@ -154,10 +159,10 @@ if ($currentaction == 'configblock') {
|
||||
<?php
|
||||
} else {
|
||||
global $act, $url, $rssid, $preferredtitle;
|
||||
echo '<table cellpadding="9" cellspacing="0" class="blockconfigtable">';
|
||||
echo '<tr valign="top"><td>';
|
||||
print '<table cellpadding="9" cellspacing="0" class="blockconfigtable">';
|
||||
print '<tr valign="top"><td>';
|
||||
rss_display_feeds();
|
||||
echo '</form>';
|
||||
print '</form>'; //not sure that this is needed
|
||||
rss_get_form($act, $url, $rssid, $preferredtitle);
|
||||
echo '</td></tr></table>';
|
||||
print '</td></tr></table>';
|
||||
} ?>
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
/// This file to be included so we can assume config.php has already been included.
|
||||
/// We also assume that $inactive, $activetab and $currentaction have been set
|
||||
|
||||
global $USER;
|
||||
$tabs = $row = array();
|
||||
|
||||
$row[] = new tabobject('configblock', me().'&currentaction=configblock',
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock'));
|
||||
$row[] = new tabobject('configblock', $script,
|
||||
get_string('block_rss_configblock', 'block_rss_client'));
|
||||
|
||||
$row[] = new tabobject('managefeeds', me().'&currentaction=managefeeds',
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds'));
|
||||
$row[] = new tabobject('managefeeds', $script,
|
||||
get_string('block_rss_managefeeds', 'block_rss_client'));
|
||||
|
||||
$tabs[] = $row;
|
||||
|
||||
Reference in New Issue
Block a user