<?php 
}
?>
        <div id="region-main-box">
            <div id="region-post-box">
                <div id="region-main-wrap">
                    <div id="region-main">
                        <div class="region-content">
                            <?php 
if ($PAGE->theme->settings->activateSlideshow) {
    ?>
                                <!-- HOME PAGE SLIDESHOW-->
                                <div id="home-page">
                                    <!-- SLIDESHOW -->
                                    <?php 
    $slider_helper = ArchaiusSliderHelper::Instance($context->id);
    echo $slider_helper->add_slideshow();
    ?>
                                    <!-- END SLIDESHOW-->
                                    <?php 
    if (isloggedin() && has_capability('moodle/site:config', $context, $USER->id, true)) {
        ?>
                                           <div id ='toggle-admin-menu' class="pretty-button pretty-link-button">
                                            <?php 
        echo get_string("settings");
        ?>
                                           </div>
                                           <?php 
        echo $slider_helper->admin_options();
        ?>
 
 * @package   theme_archaius
 * @copyright 2012 onwards Daniel Munera Sanchez  {@link http://dmuneras.com}
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 *
 */
/*    DELETE SLIDES                                               
-----------------------------------------------------------------------------*/
//imports
require_once $CFG->dirroot . '/theme/archaius/slideshow/helpers/ArchaiusSliderHelper.class.php';
require_once $CFG->dirroot . '/repository/lib.php';
list($context, $course, $cm) = get_context_info_array($contextid);
require_login($course, true, $cm);
if (isguestuser()) {
    die;
}
global $DB, $USER;
if (isloggedin() && has_capability('moodle/site:config', $context, $USER->id, true)) {
    $DB->delete_records('theme_archaius', array("id" => $id));
    $fs = get_file_storage();
    $related_files = $fs->get_area_files($context->id, "theme_archaius", "slides_images_" . $id, 910120, 'id');
    foreach ($related_files as $file) {
        $file->delete();
    }
    if ($ajax == 1) {
        echo ArchaiusSliderHelper::Instance($contextid)->add_slideshow();
    } else {
        redirect($CFG->wwwroot . "/index.php");
    }
} else {
    redirect($CFG->wwwroot . "/index.php");
}