Ignore:
Timestamp:
Mar 19, 2010, 1:50:19 PM (14 years ago)
Author:
plg
Message:

feature 724: FCBKcomplete propagated to element_set_global and
element_set_unit to manage tags.

Note: multiple instances of FCBKcomplete on the same page does not work as
good as a single instance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set_unit.php

    r4334 r5188  
    106106    if (isset($_POST[ 'tags-'.$row['id'] ]))
    107107    {
    108       set_tags($_POST[ 'tags-'.$row['id'] ], $row['id']);
     108      $tag_ids = get_fckb_tag_ids($_POST[ 'tags-'.$row['id'] ]);
     109      set_tags($tag_ids, $row['id']);
    109110    }
    110111  }
     
    208209    $src = get_thumbnail_url($row);
    209210
     211    // creation date
     212    if (!empty($row['date_creation']))
     213    {
     214      list($year,$month,$day) = explode('-', $row['date_creation']);
     215    }
     216    else
     217    {
     218      list($year,$month,$day) = array('',0,0);
     219    }
     220
    210221    $query = '
    211 SELECT tag_id
    212   FROM '.IMAGE_TAG_TABLE.'
     222SELECT
     223    tag_id,
     224    name AS tag_name
     225  FROM '.IMAGE_TAG_TABLE.' AS it
     226    JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id
    213227  WHERE image_id = '.$row['id'].'
    214228;';
    215     $selected_tags = array_from_query($query, 'tag_id');
    216 
    217     // creation date
    218     if (!empty($row['date_creation']))
    219     {
    220       list($year,$month,$day) = explode('-', $row['date_creation']);
    221     }
    222     else
    223     {
    224       list($year,$month,$day) = array('',0,0);
    225     }
    226 
    227     if (count($all_tags) > 0)
    228     {
    229       $tag_selection = get_html_tag_selection(
    230         $all_tags,
    231         'tags-'.$row['id'],
    232         $selected_tags
    233         );
    234     }
    235     else
    236     {
    237       $tag_selection =
    238         '<p>'.
    239         l10n('No tag defined. Use Administration>Pictures>Tags').
    240         '</p>';
    241     }
     229    $tag_selection = get_fckb_taglist($query);
    242230
    243231    $template->append(
     
    259247        'DATE_CREATION_DAY' => (int)$day,
    260248
    261         'TAG_SELECTION' => $tag_selection,
     249        'TAGS' => $tag_selection,
    262250        )
    263251      );
Note: See TracChangeset for help on using the changeset viewer.