2 /*==============================================================
\r
4 ==============================================================
\r
5 Copyright (c) 2006 by Dylan Cheon & Kelvin Wong
\r
6 Institute for Assistive Technology / University of Victoria
\r
7 http://www.canassist.ca/
\r
9 This program is free software. You can redistribute it and/or
\r
10 modify it under the terms of the GNU General Public License
\r
11 as published by the Free Software Foundation.
\r
12 ==============================================================
\r
17 * @desc This file handles the delete image / comment operations
\r
18 * @author Dylan Cheon & Kelvin Wong
\r
19 * @copyright 2006, Institute for Assistive Technology / University of Victoria
\r
20 * @link http://www.canassist.ca/
\r
24 define('AT_INCLUDE_PATH', '../../../include/');
\r
25 require_once(AT_INCLUDE_PATH.'vitals.inc.php');
\r
26 $_custom_css = $_base_path . 'mods/photo_album/module.css'; // use a custom stylesheet
\r
27 require_once (AT_INCLUDE_PATH.'header.inc.php');
\r
31 define('PATH', '../');
\r
32 require_once (PATH.'define.php');
\r
33 require_once (PATH.'include/data_func.php');
\r
34 require_once (PATH.'include/general_func.php');
\r
35 /* checks whether the user typed 'Yes' button or not
\r
36 * If the user clicked 'Yes' to delete the data, delete it
\r
38 if (($_POST['confirm']=='Yes') && ($_SESSION['pa']['mode']=='delete')){
\r
39 if ($_SESSION['pa']['completed']==true){
\r
40 if ($_SESSION['pa']['choose']==IMAGE){
\r
41 if ($_SESSION['pa']['administrator_mode']==true){
\r
42 $msg->addFeedback('pa_delete_image_success');
\r
43 redirect('admin_image_list.php');
\r
45 $msg->addFeedback('pa_delete_image_success');
\r
46 redirect('index.php');
\r
49 redirect('view.php?image_id='.$_SESSION['pa']['image_id']);
\r
53 if ($_SESSION['pa']['choose']==IMAGE){
\r
54 $delete=delete_image($_SESSION['pa']['image_id'], $_SESSION['pa']['course_id']);
\r
56 $_SESSION['pa']['completed']=true;
\r
57 if ($_SESSION['pa']['administrator_mode']==true){
\r
58 $msg->addFeedback('pa_delete_image_success');
\r
59 redirect('admin_image_list.php');
\r
61 $msg->addFeedback('pa_delete_image_success');
\r
62 redirect('index.php');
\r
65 $msg->addError('pa_func_delete_image');
\r
66 redirect('index.php');
\r
68 } else if ($_SESSION['pa']['choose']==COMMENT){
\r
69 $delete=delete_blog($_SESSION['pa']['image_id'], $_SESSION['pa']['course_id'], $_SESSION['pa']['comment_id']);
\r
71 $_SESSION['pa']['completed']=true;
\r
72 $msg->addFeedback('pa_delete_comment_success');
\r
73 redirect('view.php?image_id='.$_SESSION['pa']['image_id']);
\r
75 $msg->addError('pa_func_delete_blog');
\r
76 redirect('index.php');
\r
79 $msg->addError('pa_var_unauthorized');
\r
80 redirect('index.php');
\r
84 $msg->addError('pa_var_unauthorized');
\r
85 redirect('index.php');
\r
92 <?php require_once(AT_INCLUDE_PATH.'footer.inc.php'); ?>
\r