2005-10-08 00:04:53 +02:00
|
|
|
<?php
|
|
|
|
// +-----------------------------------------------------------------------+
|
2011-01-18 01:02:52 +01:00
|
|
|
// | Piwigo - a PHP based photo gallery |
|
2008-04-05 00:57:23 +02:00
|
|
|
// +-----------------------------------------------------------------------+
|
2014-01-05 01:19:25 +01:00
|
|
|
// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
|
2008-04-05 00:57:23 +02:00
|
|
|
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
|
|
|
|
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | This program is free software; you can redistribute it and/or modify |
|
|
|
|
// | it under the terms of the GNU General Public License as published by |
|
|
|
|
// | the Free Software Foundation |
|
|
|
|
// | |
|
|
|
|
// | This program is distributed in the hope that it will be useful, but |
|
|
|
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
2005-10-08 00:04:53 +02:00
|
|
|
// | General Public License for more details. |
|
|
|
|
// | |
|
|
|
|
// | You should have received a copy of the GNU General Public License |
|
|
|
|
// | along with this program; if not, write to the Free Software |
|
|
|
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
|
|
|
// | USA. |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
if (!defined('PHPWG_ROOT_PATH'))
|
|
|
|
{
|
|
|
|
die('Hacking attempt!');
|
|
|
|
}
|
2006-03-09 23:46:28 +01:00
|
|
|
|
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Check Access and exit when user status is not ok |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
check_status(ACCESS_ADMINISTRATOR);
|
2005-10-08 00:04:53 +02:00
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | functions |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | categories movement |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
if (isset($_POST['submit']))
|
|
|
|
{
|
|
|
|
if (count($_POST['selection']) > 0)
|
|
|
|
{
|
|
|
|
// TODO: tests
|
|
|
|
move_categories($_POST['selection'], $_POST['parent']);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-10-19 19:43:04 +02:00
|
|
|
$page['errors'][] = l10n('Select at least one album');
|
2005-10-08 00:04:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | template initialization |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2008-09-14 09:16:15 +02:00
|
|
|
$template->set_filename('cat_move', 'cat_move.tpl');
|
2005-10-08 00:04:53 +02:00
|
|
|
|
2008-02-28 03:41:48 +01:00
|
|
|
$template->assign(
|
2005-10-08 00:04:53 +02:00
|
|
|
array(
|
2010-04-18 20:59:37 +02:00
|
|
|
'U_HELP' => get_root_url().'admin/popuphelp.php?page=cat_move',
|
|
|
|
'F_ACTION' => get_root_url().'admin.php?page=cat_move',
|
2005-10-08 00:04:53 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2012-02-20 20:28:43 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | tabs |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
$page['tab'] = 'move';
|
|
|
|
include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
|
|
|
|
|
2005-10-08 00:04:53 +02:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Categories display |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
$query = '
|
|
|
|
SELECT id,name,uppercats,global_rank
|
|
|
|
FROM '.CATEGORIES_TABLE.'
|
|
|
|
WHERE dir IS NULL
|
|
|
|
;';
|
|
|
|
display_select_cat_wrapper(
|
|
|
|
$query,
|
|
|
|
array(),
|
2008-02-28 03:41:48 +01:00
|
|
|
'category_to_move_options'
|
2005-10-08 00:04:53 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
$query = '
|
|
|
|
SELECT id,name,uppercats,global_rank
|
|
|
|
FROM '.CATEGORIES_TABLE.'
|
|
|
|
;';
|
|
|
|
|
|
|
|
display_select_cat_wrapper(
|
|
|
|
$query,
|
|
|
|
array(),
|
2008-02-28 03:41:48 +01:00
|
|
|
'category_parent_options'
|
2005-10-08 00:04:53 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | sending html code |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
$template->assign_var_from_handle('ADMIN_CONTENT', 'cat_move');
|
|
|
|
?>
|