Ignore:
Timestamp:
Feb 10, 2012, 11:52:07 AM (12 years ago)
Author:
plg
Message:

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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r13052 r13077  
    15321532
    15331533/**
     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 */
     1541function 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 = '
     1550DELETE '.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/**
    15341565 * Associate images associated to a list of source categories to a list of
    15351566 * destination categories.
     
    19882019  switch ($menu_page)
    19892020  {
     2021    case 'photo':
    19902022    case 'photos_add':
    19912023    case 'rating':
Note: See TracChangeset for help on using the changeset viewer.