From 1e1ba8c2956729d054d851bd28b2e971f08cf294 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Fri, 17 Mar 2006 05:53:52 +0000 Subject: [PATCH] change in publish states --- blog/edit.html | 2 +- blog/edit.php | 4 +--- blog/index.php | 5 +++++ blog/lib.php | 22 +++++----------------- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/blog/edit.html b/blog/edit.html index 7ad8217cbbc..42809c9af27 100755 --- a/blog/edit.html +++ b/blog/edit.html @@ -41,7 +41,7 @@ courseid); //$blogEntry may be null + $options = blog_applicable_publish_states(); //$blogEntry may be null choose_from_menu($options, 'publishstate', $post->publishstate, ''); ?> blog_enable_moderation && $blogEntry->entryPublishState != 'draft') { - error('You are not allowed to modify a published entry. A teacher must first change this post back to draft status.'); //Daryl Hawes note: localize this line - } + $blogEntry = $PAGE->bloginfo->get_blog_entry_by_id($editid); //using an unformatted entry body here so that extra formatting information is not stored in the db diff --git a/blog/index.php b/blog/index.php index b69b91b184e..439669be716 100755 --- a/blog/index.php +++ b/blog/index.php @@ -15,6 +15,11 @@ require_once('../config.php'); require_once($CFG->dirroot .'/blog/lib.php'); require_once($CFG->libdir .'/blocklib.php'); +/* rss testing code */ +require_once('rsslib.php'); +blog_rss_feeds(); + + $id = optional_param('id', 0, PARAM_INT); $limit = optional_param('limit', 0, PARAM_INT); $start = optional_param('formstart', 0, PARAM_INT); diff --git a/blog/lib.php b/blog/lib.php index 3aef6a1fc88..4e7edd35cc3 100755 --- a/blog/lib.php +++ b/blog/lib.php @@ -221,7 +221,7 @@ function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filtersel * in its complete form (eg. archive page). If anything other than 'full' * display the entry in its abbreviated format (eg. index page) */ -function blog_print_entry(&$blogEntry, $viewtype='full', $filtertype='', $filterselect='') { +function blog_print_entry(&$blogEntry, $viewtype='full', $filtertype='', $filterselect='', $mode='loud') { global $CFG, $THEME, $USER; static $bloginfoarray; @@ -247,12 +247,12 @@ function blog_print_entry(&$blogEntry, $viewtype='full', $filtertype='', $filter $template['created'] = $blogEntry->formattedEntryCreated; $template['publishtomenu'] = $blogEntry->get_publish_to_menu(true, true); //forum style printing of blogs - blog_print_entry_content ($template, $blogEntry->entryId, $filtertype, $filterselect); + blog_print_entry_content ($template, $blogEntry->entryId, $filtertype, $filterselect, $mode); } //forum style printing of blogs -function blog_print_entry_content ($template, $entryid, $filtertype='', $filterselect='') { +function blog_print_entry_content ($template, $entryid, $filtertype='', $filterselect='', $mode='loud') { global $USER, $CFG, $course, $ME; $stredit = get_string('edit'); @@ -327,21 +327,9 @@ function blog_applicable_publish_states($courseid='') { // everyone gets draft access $options = array ( 'draft' => get_string('publishtonoone', 'blog') ); - if (is_numeric($courseid) && $courseid != SITEID && $course = get_record('course', 'id', $courseid, '', '', '', '', 'shortname') ) { - require_login($courseid); - // if we're viewing a course allow publishing to course teachers - $options['teacher'] = get_string('publishtoteachers', 'blog', $course->shortname); - if (!$CFG->blog_enable_moderation || isadmin() || isteacher($courseid) ) { - // only admins and teachers can publish to course members when moderation is enabled - $options['course'] = get_string('publishtocourse', 'blog', $course->shortname); - } - } + $options['site'] = get_string('publishtosite', 'blog'); + $options['public'] = get_string('publishtoworld', 'blog'); - if (isadmin() || (is_numeric($courseid) && isteacher($courseid)) ) { - // only admins and teachers can see site and public options when moderation is enabled - $options['site'] = get_string('publishtosite', 'blog'); - $options['public'] = get_string('publishtoworld', 'blog'); - } return $options; } -- 2.43.0