aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-02-10 10:52:07 +0000
committerplegall <plg@piwigo.org>2012-02-10 10:52:07 +0000
commitbea45c89b62c779dd56383e82b0fbb9bd76696df (patch)
tree9fd2a99b54f475273eda65ca2890acaf73ce3b82 /admin/include
parent62bfdd3f97eee2ad6136f98a9c322c3660541b9e (diff)
feature 2564: redesign on photo administration screen.
* one screen with several tabs (for now: properties + coi) * double select boxes for album associations and representation have been converted to simple multiple select boxes with jQuery Chosen * more details about the photo in an introduction text git-svn-id: http://piwigo.org/svn/trunk@13077 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php32
-rw-r--r--admin/include/photos_add_direct_process.inc.php5
2 files changed, 33 insertions, 4 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 9e6901f27..3afb705d0 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1531,6 +1531,37 @@ DELETE
}
/**
+ * Disssociate images from all categories except their storage category and
+ * associate to new categories.
+ *
+ * @param array images
+ * @param array categories
+ * @return void
+ */
+function move_images_to_categories($images, $categories)
+{
+ if (count($images) == 0)
+ {
+ return false;
+ }
+
+ // let's first break links with all albums but their "storage album"
+ $query = '
+DELETE '.IMAGE_CATEGORY_TABLE.'.*
+ FROM '.IMAGE_CATEGORY_TABLE.'
+ JOIN '.IMAGES_TABLE.' ON image_id=id
+ WHERE id IN ('.implode(',', $images).')
+ AND (storage_category_id IS NULL OR storage_category_id != category_id)
+;';
+ pwg_query($query);
+
+ if (is_array($categories) and count($categories) > 0)
+ {
+ associate_images_to_categories($images, $categories);
+ }
+}
+
+/**
* Associate images associated to a list of source categories to a list of
* destination categories.
*
@@ -1987,6 +2018,7 @@ function get_active_menu($menu_page)
switch ($menu_page)
{
+ case 'photo':
case 'photos_add':
case 'rating':
case 'tags':
diff --git a/admin/include/photos_add_direct_process.inc.php b/admin/include/photos_add_direct_process.inc.php
index 59e37e891..100b61032 100644
--- a/admin/include/photos_add_direct_process.inc.php
+++ b/admin/include/photos_add_direct_process.inc.php
@@ -215,10 +215,7 @@ SELECT
// function get_image_name($name, $file) would be better
$thumbnail['title'] = get_name_from_file($image_infos['file']);
- $thumbnail['link'] = PHPWG_ROOT_PATH.'admin.php?page=picture_modify'
- .'&amp;image_id='.$image_id
- .'&amp;cat_id='.$category_id
- ;
+ $thumbnail['link'] = get_root_url().'admin.php?page=photo-'.$image_id.'&amp;cat_id='.$category_id;
array_push($page['thumbnails'], $thumbnail);
}