Example #1
0
function delete_blog_submit(Pieform $form, $values)
{
    global $SESSION;
    $blog = new ArtefactTypeBlog($values['delete']);
    $blog->check_permission();
    if ($blog->get('locked')) {
        $SESSION->add_error_msg(get_string('submittedforassessment', 'view'));
    } else {
        $blog->delete();
        $SESSION->add_ok_msg(get_string('blogdeleted', 'artefact.blog'));
    }
    redirect('/artefact/blog/index.php');
}
Example #2
0
function delete_blog_submit(Pieform $form, $values)
{
    global $SESSION;
    require_once 'embeddedimage.php';
    $blog = new ArtefactTypeBlog($values['delete']);
    $blog->check_permission();
    $institution = $blog->get('institution');
    if ($blog->get('locked')) {
        $SESSION->add_error_msg(get_string('submittedforassessment', 'view'));
    } else {
        $blog->delete();
        EmbeddedImage::delete_embedded_images('blog', $blog->get('id'));
        $SESSION->add_ok_msg(get_string('blogdeleted', 'artefact.blog'));
    }
    if ($institution) {
        redirect('/artefact/blog/index.php?institution=' . $institution);
    }
    redirect('/artefact/blog/index.php');
}