| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | |
|---|
| 4 | Copyright (c) Ampache.org |
|---|
| 5 | All Rights Reserved |
|---|
| 6 | |
|---|
| 7 | This program is free software; you can redistribute it and/or |
|---|
| 8 | modify it under the terms of the GNU General Public License v2 |
|---|
| 9 | as published by the Free Software Foundation. |
|---|
| 10 | |
|---|
| 11 | This program is distributed in the hope that it will be useful, |
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | GNU General Public License for more details. |
|---|
| 15 | |
|---|
| 16 | You should have received a copy of the GNU General Public License |
|---|
| 17 | along with this program; if not, write to the Free Software |
|---|
| 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 19 | |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | /** |
|---|
| 23 | * Flag Document |
|---|
| 24 | * This is called for all of our flagging needs |
|---|
| 25 | */ |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | require_once('lib/init.php'); |
|---|
| 29 | |
|---|
| 30 | show_template('header'); |
|---|
| 31 | |
|---|
| 32 | $action = scrub_in($_REQUEST['action']); |
|---|
| 33 | $flag = new Flag($_REQUEST['flag_id']); |
|---|
| 34 | |
|---|
| 35 | /* Switch on the action */ |
|---|
| 36 | switch ($action) { |
|---|
| 37 | case 'remove_flag': |
|---|
| 38 | break; |
|---|
| 39 | case 'flag': |
|---|
| 40 | $id = scrub_in($_REQUEST['id']); |
|---|
| 41 | $type = scrub_in($_REQUEST['type']); |
|---|
| 42 | $flag_type = scrub_in($_REQUEST['flag_type']); |
|---|
| 43 | $comment = scrub_in($_REQUEST['comment']); |
|---|
| 44 | $flag->add($id,$type,$flag_type,$comment); |
|---|
| 45 | show_confirmation(_('Item Flagged'),_('The specified item has been flagged'),$_SESSION['source_page']); |
|---|
| 46 | break; |
|---|
| 47 | case 'show_flag': |
|---|
| 48 | /* Store where they came from */ |
|---|
| 49 | $_SESSION['source_page'] = return_referer(); |
|---|
| 50 | include(conf('prefix') . '/templates/show_flag.inc.php'); |
|---|
| 51 | break; |
|---|
| 52 | case 'show_remove_flag': |
|---|
| 53 | |
|---|
| 54 | break; |
|---|
| 55 | default: |
|---|
| 56 | |
|---|
| 57 | break; |
|---|
| 58 | } // end action switch |
|---|
| 59 | |
|---|
| 60 | show_footer(); |
|---|
| 61 | ?> |
|---|