示例#1
0
 /**
  * Standard aed_module delete actualiser.
  *
  * @param  ID_TEXT		The entry being deleted
  */
 function delete_actualisation($_id)
 {
     $id = intval($_id);
     $delete_status = post_param('delete', 'leave');
     $this->donext_type = post_param('cat');
     delete_video($id, $delete_status == '2');
 }
示例#2
0
/**
 * Delete a specified gallery.
 *
 * @param  ID_TEXT		The gallery codename
 */
function delete_gallery($name)
{
    if ($name == '') {
        warn_exit(do_lang_tempcode('NO_DELETE_ROOT'));
    }
    $rows = $GLOBALS['SITE_DB']->query_select('galleries', array('*'), array('name' => $name), '', 1);
    if (!array_key_exists(0, $rows)) {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    require_code('files2');
    delete_upload('uploads/grepimages', 'galleries', 'rep_image', 'name', $name);
    delete_upload('uploads/watermarks', 'galleries', 'watermark_top_left', 'name', $name);
    delete_upload('uploads/watermarks', 'galleries', 'watermark_top_right', 'name', $name);
    delete_upload('uploads/watermarks', 'galleries', 'watermark_bottom_left', 'name', $name);
    delete_upload('uploads/watermarks', 'galleries', 'watermark_bottom_right', 'name', $name);
    log_it('DELETE_GALLERY', $name, get_translated_text($rows[0]['fullname']));
    delete_lang($rows[0]['fullname']);
    delete_lang($rows[0]['description']);
    delete_lang($rows[0]['teaser']);
    // Images and videos are deleted, because we are deleting the _gallery_, not just a category (nobody is going to be deleting galleries with the expectation of moving the image to a different one in bulk - unlike download categories, for example).
    if (function_exists('set_time_limit')) {
        @set_time_limit(0);
    }
    do {
        $images = $GLOBALS['SITE_DB']->query_select('images', array('id'), array('cat' => $name), '', 200);
        foreach ($images as $image) {
            delete_image($image['id'], false);
        }
    } while ($images != array());
    do {
        $videos = $GLOBALS['SITE_DB']->query_select('videos', array('id'), array('cat' => $name), '', 200);
        foreach ($videos as $video) {
            delete_video($video['id'], false);
        }
    } while ($images != array());
    //... but the subgalleries remain
    $GLOBALS['SITE_DB']->query_update('galleries', array('parent_id' => $rows[0]['parent_id']), array('parent_id' => $name));
    $GLOBALS['SITE_DB']->query_delete('galleries', array('name' => $name), '', 1);
    $GLOBALS['SITE_DB']->query_delete('rating', array('rating_for_type' => 'images', 'rating_for_id' => $name));
    $GLOBALS['SITE_DB']->query_delete('rating', array('rating_for_type' => 'videos', 'rating_for_id' => $name));
    require_code('seo2');
    seo_meta_erase_storage('gallery', $name);
    $GLOBALS['SITE_DB']->query_delete('group_category_access', array('module_the_name' => 'galleries', 'category_name' => $name));
    $GLOBALS['SITE_DB']->query_delete('gsp', array('module_the_name' => 'galleries', 'category_name' => $name));
    decache('main_top_galleries');
    decache('main_recent_galleries');
    decache('main_root_galleries');
    decache('side_root_galleries');
}
示例#3
0
        $tool_content .= "<div class='alert alert-success'>$langLinksAdded</div>";
    }
    if (isset($_GET['delete'])) {
        if ($_GET['delete'] == 'delcat') { // delete video category
            $q = Database::get()->queryArray("SELECT id FROM video WHERE category = ?d AND course_id = ?d", $_GET['id'], $course_id);
            foreach ($q as $a) {
                delete_video($a->id, 'video');
            }
            $q = Database::get()->queryArray("SELECT id FROM videolink WHERE category = ?d AND course_id = ?d", $_GET['id'], $course_id);
            foreach ($q as $a) {
                delete_video($a->id, 'videolink');
            }
            delete_video_category($_GET['id']);
        } else {  // delete video / videolink
            $table = select_table($_GET['table']);
            delete_video($_GET['id'], $table);
        }
        $tool_content .= "<div class='alert alert-success'>$langGlossaryDeleted</div>";
    } else if (isset($_GET['form_input'])) { // display video form
        $navigation[] = array('url' => "$_SERVER[SCRIPT_NAME]?course=$course_code", 'name' => $langVideo);

        if ($_GET['form_input'] === 'file' || $_GET['form_input'] === 'url') {
            // Form
            $tool_content .= "<div class='row'><div class='col-sm-12'><div class='form-wrapper'>";
            if ($_GET['form_input'] === 'file') {
                $tool_content .= "<form class='form-horizontal' role='form' method='POST' action='$_SERVER[SCRIPT_NAME]?course=$course_code' enctype='multipart/form-data' onsubmit=\"return checkrequired(this, 'title');\">";
            } else if ($_GET['form_input'] === 'url') {
                $tool_content .= "<form class='form-horizontal' role='form' method='POST' action='$_SERVER[SCRIPT_NAME]?course=$course_code' onsubmit=\"return checkrequired(this, 'title');\">";
            }
            $tool_content .= "<fieldset>";