content_id = $id; $new_image->parent_collection_id = $_GET['gid']; $new_image->delete($id); $success_delete = TRUE; $msg_id = 2004; } if ($_GET['type'] == 'Audios') { $new_image = new Audio(); $new_image->content_id = $id; $new_image->delete($id); $success_delete = TRUE; $msg_id = 2005; } if ($_GET['type'] == 'Videos') { $new_image = new Video(); $new_image->content_id = $id; $new_image->delete($id); $success_delete = TRUE; $msg_id = 2006; } } } catch (PAException $e) { $error_msg = "$e->message"; $error = TRUE; } // Code for Re-Direction After Successfull deletion if (!empty($success_delete) || !empty($success)) { $gid = $_GET['gid']; $type = $_GET['type']; $location = "$base_url/group_media_gallery.php?type=$type&msg_id=$msg_id&gid=$gid"; header("Location: $location"); exit; } $setting_data = array('middle'=> array ( 'UploadMediaModule' ) ); /* This function is a Callback function which initialize the value for the BLOCK MODULES */ function setup_module($column, $moduleName, $obj) { /* in this module we have to set user_id , group_id, as well as netwrok_id */ global $uid, $type, $album_id; $obj->uid = $uid; $obj->type = $_GET['type']; $obj->gid = $_GET['gid']; } // fetching the data from the Constants.php and Rendering the data of the page // at present we are setting the value of setting data $page = new PageRenderer("setup_module", PAGE_MEDIA_GALLERY, "Group Media Gallery", "container_one_column_media_gallery.tpl", "header.tpl", PUB, NULL, $network_info, $onload,$setting_data); uihelper_error_msg($error_msg); /* This function set the network theme in this page */ uihelper_get_network_style(); echo $page->render(); ?>