source: trunk/admin/cat_move.php @ 18629

Last change on this file since 18629 was 13282, checked in by plg, 13 years ago

feature 2581: new design on albums list management.

icons removed, replaced by text links visible on :hover

better ergonomy for automatic order: the "save manual order" submit button
only appears when a change is detected in the album ordering. The "automatic
sort order" becomes a dedicated fieldset, hidden by default, displayed "on
user demand".

new virtual album form displayed only "on user demand"

cat_list, cat_move and permalinks are 3 tabs for the "Albums > Manage" link
in the menubar.

permalinks admin page slightly redesign: fieldsets instead of centered h3,
"on user demand" form to add/modify permalinks.

  • Property svn:eol-style set to LF
File size: 4.3 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based photo gallery                                    |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23
24if (!defined('PHPWG_ROOT_PATH'))
25{
26  die('Hacking attempt!');
27}
28
29include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
30
31// +-----------------------------------------------------------------------+
32// | Check Access and exit when user status is not ok                      |
33// +-----------------------------------------------------------------------+
34check_status(ACCESS_ADMINISTRATOR);
35
36// +-----------------------------------------------------------------------+
37// |                               functions                               |
38// +-----------------------------------------------------------------------+
39
40
41// +-----------------------------------------------------------------------+
42// |                          categories movement                          |
43// +-----------------------------------------------------------------------+
44
45if (isset($_POST['submit']))
46{
47  if (count($_POST['selection']) > 0)
48  {
49    // TODO: tests
50    move_categories($_POST['selection'], $_POST['parent']);
51  }
52  else
53  {
54    array_push(
55      $page['errors'],
56      l10n('Select at least one album')
57      );
58  }
59}
60
61// +-----------------------------------------------------------------------+
62// |                       template initialization                         |
63// +-----------------------------------------------------------------------+
64$template->set_filename('cat_move', 'cat_move.tpl');
65
66$template->assign(
67  array(
68    'U_HELP' => get_root_url().'admin/popuphelp.php?page=cat_move',
69    'F_ACTION' => get_root_url().'admin.php?page=cat_move',
70    )
71  );
72 
73// +-----------------------------------------------------------------------+
74// | tabs                                                                  |
75// +-----------------------------------------------------------------------+
76
77$page['tab'] = 'move';
78include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
79
80// +-----------------------------------------------------------------------+
81// |                          Categories display                           |
82// +-----------------------------------------------------------------------+
83
84$query = '
85SELECT id,name,uppercats,global_rank
86  FROM '.CATEGORIES_TABLE.'
87  WHERE dir IS NULL
88;';
89display_select_cat_wrapper(
90  $query,
91  array(),
92  'category_to_move_options'
93  );
94
95$query = '
96SELECT id,name,uppercats,global_rank
97  FROM '.CATEGORIES_TABLE.'
98;';
99
100display_select_cat_wrapper(
101  $query,
102  array(),
103  'category_parent_options'
104  );
105
106// +-----------------------------------------------------------------------+
107// |                          sending html code                            |
108// +-----------------------------------------------------------------------+
109
110$template->assign_var_from_handle('ADMIN_CONTENT', 'cat_move');
111?>
Note: See TracBrowser for help on using the repository browser.