aboutsummaryrefslogtreecommitdiffstats
path: root/admin/picture_modify.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/picture_modify.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 'admin/picture_modify.php')
-rw-r--r--admin/picture_modify.php43
1 files changed, 5 insertions, 38 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 42306fc23..e33447f70 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -106,34 +106,13 @@ if (isset($_POST['submit']) and count($page['errors']) == 0 and !is_adviser())
array($data)
);
- // In $_POST[tags] we receive something like array('~~6~~', '~~59~~', 'New
- // tag', 'Another new tag') The ~~34~~ means that it is an existing
- // tag. I've added the surrounding ~~ to permit creation of tags like "10"
- // or "1234" (numeric characters only)
+ // time to deal with tags
$tag_ids = array();
if (isset($_POST['tags']))
{
- foreach ($_POST['tags'] as $raw_tag)
- {
- if (preg_match('/^~~(\d+)~~$/', $raw_tag, $matches))
- {
- array_push($tag_ids, $matches[1]);
- }
- else
- {
- // we have to create a new tag
- array_push(
- $tag_ids,
- tag_id_from_tag_name($raw_tag)
- );
- }
- }
+ $tag_ids = get_fckb_tag_ids($_POST['tags']);
}
-
- set_tags(
- $tag_ids,
- $_GET['image_id']
- );
+ set_tags($tag_ids, $_GET['image_id']);
array_push($page['infos'], l10n('Picture informations updated'));
}
@@ -194,27 +173,15 @@ if (isset($_POST['dismiss'])
}
// tags
-$tags = array();
-
$query = '
SELECT
tag_id,
- name
+ name AS tag_name
FROM '.IMAGE_TAG_TABLE.' AS it
JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id
WHERE image_id = '.$_GET['image_id'].'
;';
-$result = pwg_query($query);
-while ($row = pwg_db_fetch_assoc($result))
-{
- array_push(
- $tags,
- array(
- 'value' => '~~'.$row['tag_id'].'~~',
- 'caption' => $row['name'],
- )
- );
-}
+$tags = get_fckb_taglist($query);
// retrieving direct information about picture
$query = '