diff --git a/blog/edit.html b/blog/edit.html deleted file mode 100755 index a91e26a8df9..00000000000 --- a/blog/edit.html +++ /dev/null @@ -1,194 +0,0 @@ -id)) { - if ($tagsused = get_records('blog_tag_instance', 'entryid', $post->id)) { - foreach ($tagsused as $usedtag) { - $usedtags[] = $usedtag -> tagid; - } - } - } - - if ($usehtmleditor) { - // clean and convert to html before editting - $options = new object(); - $options->smiley = false; - $options->filter = false; - $options->nocache = true; - $post->summary = format_text($post->summary, $post->format, $options); - } -?> - -
diff --git a/blog/edit.php b/blog/edit.php index 5c1639f716f..d5343add1bf 100755 --- a/blog/edit.php +++ b/blog/edit.php @@ -46,81 +46,104 @@ if (!empty($courseid)) { $returnurl .= '&courseid='.$courseid; } -$errors = array(); -$post = new object(); // editing form data -$usehtmleditor = can_use_richtext_editor(); $strblogs = get_string('blogs','blog'); -/// Main switch for processing blog entry -switch ($action) { +if ($action=='delete'){ + if (!$existing) { + error('Incorrect blog post id'); + } + if (data_submitted() and $confirm and confirm_sesskey()) { + do_delete($existing); + redirect($returnurl); + } else { + $optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey(), 'courseid'=>$courseid); + $optionsno = array('userid'=>$existing->userid, 'courseid'=>$courseid); + print_header("$SITE->shortname: $strblogs", $SITE->fullname); + blog_print_entry($existing); + echo '