1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | PhpWebGallery - a PHP based picture gallery | |
---|
4 | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | |
---|
5 | // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | |
---|
6 | // +-----------------------------------------------------------------------+ |
---|
7 | // | file : $Id: cat_move.php 1962 2007-04-19 06:04:04Z rub $ |
---|
8 | // | last update : $Date: 2007-04-19 06:04:04 +0000 (Thu, 19 Apr 2007) $ |
---|
9 | // | last modifier : $Author: rub $ |
---|
10 | // | revision : $Revision: 1962 $ |
---|
11 | // +-----------------------------------------------------------------------+ |
---|
12 | // | This program is free software; you can redistribute it and/or modify | |
---|
13 | // | it under the terms of the GNU General Public License as published by | |
---|
14 | // | the Free Software Foundation | |
---|
15 | // | | |
---|
16 | // | This program is distributed in the hope that it will be useful, but | |
---|
17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
19 | // | General Public License for more details. | |
---|
20 | // | | |
---|
21 | // | You should have received a copy of the GNU General Public License | |
---|
22 | // | along with this program; if not, write to the Free Software | |
---|
23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
24 | // | USA. | |
---|
25 | // +-----------------------------------------------------------------------+ |
---|
26 | |
---|
27 | if (!defined('PHPWG_ROOT_PATH')) |
---|
28 | { |
---|
29 | die('Hacking attempt!'); |
---|
30 | } |
---|
31 | |
---|
32 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
33 | |
---|
34 | // +-----------------------------------------------------------------------+ |
---|
35 | // | Check Access and exit when user status is not ok | |
---|
36 | // +-----------------------------------------------------------------------+ |
---|
37 | check_status(ACCESS_ADMINISTRATOR); |
---|
38 | |
---|
39 | // +-----------------------------------------------------------------------+ |
---|
40 | // | functions | |
---|
41 | // +-----------------------------------------------------------------------+ |
---|
42 | |
---|
43 | |
---|
44 | // +-----------------------------------------------------------------------+ |
---|
45 | // | categories movement | |
---|
46 | // +-----------------------------------------------------------------------+ |
---|
47 | |
---|
48 | if (isset($_POST['submit'])) |
---|
49 | { |
---|
50 | if (count($_POST['selection']) > 0) |
---|
51 | { |
---|
52 | // TODO: tests |
---|
53 | move_categories($_POST['selection'], $_POST['parent']); |
---|
54 | } |
---|
55 | else |
---|
56 | { |
---|
57 | array_push( |
---|
58 | $page['errors'], |
---|
59 | l10n('Select at least one category') |
---|
60 | ); |
---|
61 | } |
---|
62 | } |
---|
63 | |
---|
64 | // +-----------------------------------------------------------------------+ |
---|
65 | // | template initialization | |
---|
66 | // +-----------------------------------------------------------------------+ |
---|
67 | |
---|
68 | $template->set_filenames( |
---|
69 | array( |
---|
70 | 'cat_move' => 'admin/cat_move.tpl' |
---|
71 | ) |
---|
72 | ); |
---|
73 | |
---|
74 | $template->assign_vars( |
---|
75 | array( |
---|
76 | 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=cat_move', |
---|
77 | 'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=cat_move', |
---|
78 | ) |
---|
79 | ); |
---|
80 | |
---|
81 | // +-----------------------------------------------------------------------+ |
---|
82 | // | Categories display | |
---|
83 | // +-----------------------------------------------------------------------+ |
---|
84 | |
---|
85 | $query = ' |
---|
86 | SELECT id,name,uppercats,global_rank |
---|
87 | FROM '.CATEGORIES_TABLE.' |
---|
88 | WHERE dir IS NULL |
---|
89 | ;'; |
---|
90 | |
---|
91 | display_select_cat_wrapper( |
---|
92 | $query, |
---|
93 | array(), |
---|
94 | 'category_option_selection' |
---|
95 | ); |
---|
96 | |
---|
97 | $blockname = 'category_option_parent'; |
---|
98 | |
---|
99 | $template->assign_block_vars( |
---|
100 | $blockname, |
---|
101 | array( |
---|
102 | 'VALUE'=> 0, |
---|
103 | 'OPTION' => '------------' |
---|
104 | ) |
---|
105 | ); |
---|
106 | |
---|
107 | $query = ' |
---|
108 | SELECT id,name,uppercats,global_rank |
---|
109 | FROM '.CATEGORIES_TABLE.' |
---|
110 | ;'; |
---|
111 | |
---|
112 | display_select_cat_wrapper( |
---|
113 | $query, |
---|
114 | array(), |
---|
115 | $blockname |
---|
116 | ); |
---|
117 | |
---|
118 | // +-----------------------------------------------------------------------+ |
---|
119 | // | sending html code | |
---|
120 | // +-----------------------------------------------------------------------+ |
---|
121 | |
---|
122 | $template->assign_var_from_handle('ADMIN_CONTENT', 'cat_move'); |
---|
123 | ?> |
---|