aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_unit.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-03-19 12:50:19 +0000
committerplegall <plg@piwigo.org>2010-03-19 12:50:19 +0000
commit3a076f460d89628e75a7e9e693be0c3962ac2c39 (patch)
tree2155ac51c61e251057a1d9127b54a4d8588950df /admin/element_set_unit.php
parentb7fee65e8fccc08b3741bc63725f58aae73eb456 (diff)
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. git-svn-id: http://piwigo.org/svn/trunk@5188 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/element_set_unit.php36
1 files changed, 12 insertions, 24 deletions
diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php
index 9abcb3889..d80d65fa8 100644
--- a/admin/element_set_unit.php
+++ b/admin/element_set_unit.php
@@ -105,7 +105,8 @@ SELECT id, date_creation
// tags management
if (isset($_POST[ 'tags-'.$row['id'] ]))
{
- set_tags($_POST[ 'tags-'.$row['id'] ], $row['id']);
+ $tag_ids = get_fckb_tag_ids($_POST[ 'tags-'.$row['id'] ]);
+ set_tags($tag_ids, $row['id']);
}
}
@@ -207,13 +208,6 @@ SELECT id,path,tn_ext,name,date_creation,comment,author,file
$src = get_thumbnail_url($row);
- $query = '
-SELECT tag_id
- FROM '.IMAGE_TAG_TABLE.'
- WHERE image_id = '.$row['id'].'
-;';
- $selected_tags = array_from_query($query, 'tag_id');
-
// creation date
if (!empty($row['date_creation']))
{
@@ -224,21 +218,15 @@ SELECT tag_id
list($year,$month,$day) = array('',0,0);
}
- if (count($all_tags) > 0)
- {
- $tag_selection = get_html_tag_selection(
- $all_tags,
- 'tags-'.$row['id'],
- $selected_tags
- );
- }
- else
- {
- $tag_selection =
- '<p>'.
- l10n('No tag defined. Use Administration>Pictures>Tags').
- '</p>';
- }
+ $query = '
+SELECT
+ tag_id,
+ name AS tag_name
+ FROM '.IMAGE_TAG_TABLE.' AS it
+ JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id
+ WHERE image_id = '.$row['id'].'
+;';
+ $tag_selection = get_fckb_taglist($query);
$template->append(
'elements',
@@ -258,7 +246,7 @@ SELECT tag_id
'DATE_CREATION_MONTH' => (int)$month,
'DATE_CREATION_DAY' => (int)$day,
- 'TAG_SELECTION' => $tag_selection,
+ 'TAGS' => $tag_selection,
)
);
}