aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2011-07-30 04:49:02 +0000
committerrvelices <rv-github@modusoptimus.com>2011-07-30 04:49:02 +0000
commitc17ed8b55fc7886a5cbe4797694b310ed3dc4816 (patch)
tree33b35a49c7507fcceb8d12b035f4ab1ac1e38c3b /admin/include/functions.php
parentafb91c6ca29625cfe3bd422e42ee1bd85153f844 (diff)
feature 2387: addd a filter by tag in the batch manager
git-svn-id: http://piwigo.org/svn/trunk@11853 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/functions.php')
-rw-r--r--admin/include/functions.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index afd6c7eaf..8d7a178bd 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2048,7 +2048,7 @@ function get_taglist($query)
$taglist = array();
while ($row = pwg_db_fetch_assoc($result))
{
- if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['tag_name'], $matches))
+ if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['name'], $matches))
{
foreach ($matches[2] as $tag_name)
{
@@ -2056,7 +2056,7 @@ function get_taglist($query)
$taglist,
array(
'name' => trigger_event('render_tag_name', $tag_name),
- 'id' => '~~'.$row['tag_id'].'~~',
+ 'id' => '~~'.$row['id'].'~~',
)
);
}
@@ -2064,13 +2064,13 @@ function get_taglist($query)
$row['tag_name'] = preg_replace('#\[lang=(.*?)\](.*?)\[/lang\]#is', null, $row['tag_name']);
}
- if (strlen($row['tag_name']) > 0)
+ if (strlen($row['name']) > 0)
{
array_push(
$taglist,
array(
- 'name' => trigger_event('render_tag_name', $row['tag_name']),
- 'id' => '~~'.$row['tag_id'].'~~',
+ 'name' => trigger_event('render_tag_name', $row['name']),
+ 'id' => '~~'.$row['id'].'~~',
)
);
}
@@ -2082,7 +2082,7 @@ function get_taglist($query)
return $taglist;
}
-function get_tag_ids($raw_tags)
+function get_tag_ids($raw_tags, $allow_create=true)
{
// In $raw_tags we receive something like array('~~6~~', '~~59~~', 'New
// tag', 'Another new tag') The ~~34~~ means that it is an existing
@@ -2098,13 +2098,10 @@ function get_tag_ids($raw_tags)
{
array_push($tag_ids, $matches[1]);
}
- else
+ elseif ($allow_create)
{
// we have to create a new tag
- array_push(
- $tag_ids,
- tag_id_from_tag_name($raw_tag)
- );
+ $tag_ids[] = tag_id_from_tag_name($raw_tag);
}
}