Changeset 13077 for trunk/admin/include/functions.php
- Timestamp:
- Feb 10, 2012, 11:52:07 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r13052 r13077 1532 1532 1533 1533 /** 1534 * Disssociate images from all categories except their storage category and 1535 * associate to new categories. 1536 * 1537 * @param array images 1538 * @param array categories 1539 * @return void 1540 */ 1541 function move_images_to_categories($images, $categories) 1542 { 1543 if (count($images) == 0) 1544 { 1545 return false; 1546 } 1547 1548 // let's first break links with all albums but their "storage album" 1549 $query = ' 1550 DELETE '.IMAGE_CATEGORY_TABLE.'.* 1551 FROM '.IMAGE_CATEGORY_TABLE.' 1552 JOIN '.IMAGES_TABLE.' ON image_id=id 1553 WHERE id IN ('.implode(',', $images).') 1554 AND (storage_category_id IS NULL OR storage_category_id != category_id) 1555 ;'; 1556 pwg_query($query); 1557 1558 if (is_array($categories) and count($categories) > 0) 1559 { 1560 associate_images_to_categories($images, $categories); 1561 } 1562 } 1563 1564 /** 1534 1565 * Associate images associated to a list of source categories to a list of 1535 1566 * destination categories. … … 1988 2019 switch ($menu_page) 1989 2020 { 2021 case 'photo': 1990 2022 case 'photos_add': 1991 2023 case 'rating':
Note: See TracChangeset
for help on using the changeset viewer.