aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-06-22 16:38:58 +0000
committermistic100 <mistic@piwigo.org>2011-06-22 16:38:58 +0000
commit99d78adde75e434b7139a4288aed5fcdfd2d2990 (patch)
tree6de364cd2226f38f7ac3e7cee63eac8e8b3a87f8 /admin
parent029688227b8c004ce660e06c61330c125f8b1c21 (diff)
feature:2322 display all localisations as independant tags in TokenInput
git-svn-id: http://piwigo.org/svn/trunk@11487 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/include/functions.php35
-rw-r--r--admin/tags.php2
2 files changed, 28 insertions, 9 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 487327fd4..c19c202ca 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2104,18 +2104,37 @@ function get_taglist($query)
$taglist = array();
while ($row = pwg_db_fetch_assoc($result))
{
- array_push(
- $taglist,
- array(
- 'name' => trigger_event('render_tag_name', $row['tag_name']),
- 'id' => '~~'.$row['tag_id'].'~~',
- )
- );
+ if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['tag_name'], $matches))
+ {
+ foreach ($matches[2] as $tag_name)
+ {
+ array_push(
+ $taglist,
+ array(
+ 'name' => trigger_event('render_tag_name', $tag_name),
+ 'id' => '~~'.$row['tag_id'].'~~',
+ )
+ );
+ }
+
+ $row['tag_name'] = preg_replace('#\[lang=(.*?)\](.*?)\[/lang\]#is', null, $row['tag_name']);
+ }
+
+ if (strlen($row['tag_name']) > 0)
+ {
+ array_push(
+ $taglist,
+ array(
+ 'name' => trigger_event('render_tag_name', $row['tag_name']),
+ 'id' => '~~'.$row['tag_id'].'~~',
+ )
+ );
+ }
}
$cmp = create_function('$a,$b', 'return strcasecmp($a["name"], $b["name"]);');
usort($taglist, $cmp);
-
+
return $taglist;
}
diff --git a/admin/tags.php b/admin/tags.php
index 8cc997f60..67cc9bf3c 100644
--- a/admin/tags.php
+++ b/admin/tags.php
@@ -221,7 +221,7 @@ $orphan_tags = get_orphan_tags();
$orphan_tag_names = array();
foreach ($orphan_tags as $tag)
{
- array_push($orphan_tag_names, $tag['name']);
+ array_push($orphan_tag_names, trigger_event('render_tag_name', $tag['name']));
}
if (count($orphan_tag_names) > 0)