aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-02-18 12:31:56 +0000
committermistic100 <mistic@piwigo.org>2013-02-18 12:31:56 +0000
commit75fa687b88f09f12dd75691837b252545206df75 (patch)
tree0155c61711ba3083d5efcf5eb58f4a00bf8615be /admin/include
parentd80011ed4c232a41262c35670759aecb7293aa09 (diff)
allow to pass an array to get_tag_ids()
git-svn-id: http://piwigo.org/svn/trunk@20805 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 03bce26cc..46460a29a 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2129,6 +2129,11 @@ function get_active_menu($menu_page)
return 0;
}
+/*
+ * get tags list from SQL query (ids are surrounded by ~~, for get_tag_ids())
+ * @param string: query
+ * @param boolean: only_user_language, if true, only local name is returned for multilingual tags
+ */
function get_taglist($query, $only_user_language=true)
{
$result = pwg_query($query);
@@ -2169,6 +2174,11 @@ function get_taglist($query, $only_user_language=true)
return $taglist;
}
+/*
+ * get tags ids from a list of raw tags (existing tags or new tags)
+ * @param mixed: raw_tags, array or comma separated string
+ * @param boolean: allow_create
+ */
function get_tag_ids($raw_tags, $allow_create=true)
{
// In $raw_tags we receive something like array('~~6~~', '~~59~~', 'New
@@ -2177,7 +2187,10 @@ function get_tag_ids($raw_tags, $allow_create=true)
// or "1234" (numeric characters only)
$tag_ids = array();
- $raw_tags = explode(',',$raw_tags);
+ if (!is_array($raw_tags))
+ {
+ $raw_tags = explode(',',$raw_tags);
+ }
foreach ($raw_tags as $raw_tag)
{