aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-06-11 14:35:38 +0000
committermistic100 <mistic@piwigo.org>2011-06-11 14:35:38 +0000
commitdef88719e84445cfea91539bc96072c31fd65189 (patch)
tree38bbaeb35dd4d7132c11932da5a088cde6a9c76b
parentc50eebb15e1615189400cab9feca04ffeb23c9d0 (diff)
feature:2322 Add two new trigger events for tag name display and tag url
git-svn-id: http://piwigo.org/svn/trunk@11317 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php2
-rw-r--r--admin/tags.php4
-rw-r--r--admin/themes/default/template/tags.tpl4
-rw-r--r--include/functions_html.inc.php4
-rw-r--r--include/functions_tag.inc.php3
5 files changed, 10 insertions, 7 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 510ef767a..487327fd4 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2107,7 +2107,7 @@ function get_taglist($query)
array_push(
$taglist,
array(
- 'name' => $row['tag_name'],
+ 'name' => trigger_event('render_tag_name', $row['tag_name']),
'id' => '~~'.$row['tag_id'].'~~',
)
);
diff --git a/admin/tags.php b/admin/tags.php
index 16dea3661..8cc997f60 100644
--- a/admin/tags.php
+++ b/admin/tags.php
@@ -84,7 +84,7 @@ SELECT id, name
array(
'id' => $tag_id,
'name' => addslashes($tag_name),
- 'url_name' => str2url($tag_name),
+ 'url_name' => str2url(trigger_event('render_tag_url', $tag_name)),
)
);
}
@@ -174,7 +174,7 @@ SELECT id
array(
array(
'name' => $tag_name,
- 'url_name' => str2url($tag_name),
+ 'url_name' => str2url(trigger_event('render_tag_url', $tag_name)),
)
)
);
diff --git a/admin/themes/default/template/tags.tpl b/admin/themes/default/template/tags.tpl
index aeca6fe5b..10a4f8b84 100644
--- a/admin/themes/default/template/tags.tpl
+++ b/admin/themes/default/template/tags.tpl
@@ -17,7 +17,7 @@
{foreach from=$tags item=tag}
<tr>
<td>{$tag.NAME}</td>
- <td><input type="text" name="tag_name-{$tag.ID}" value="{$tag.NAME}"></td>
+ <td><input type="text" name="tag_name-{$tag.ID}" value="{$tag.NAME}" size="30"></td>
</tr>
{/foreach}
</table>
@@ -35,7 +35,7 @@
<label>
{'New tag'|@translate}
- <input type="text" name="add_tag">
+ <input type="text" name="add_tag" size="30">
</label>
<p><input class="submit" type="submit" name="add" value="{'Submit'|@translate}"></p>
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index 9e422288e..60b3a9a86 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -275,7 +275,7 @@ function get_html_tag_selection(
}
$output.=
- '>'
+ '> '
.$tag['name']
.'</label>'
.'</li>'
@@ -441,7 +441,7 @@ function get_tags_content_title()
.'" title="'
.l10n('display photos linked to this tag')
.'">'
- .$page['tags'][$i]['name']
+ .trigger_event('render_tag_name', $page['tags'][$i]['name'])
.'</a>';
$remove_url = null;
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index 76931710f..028fd766c 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -68,6 +68,7 @@ SELECT *
if ( $counter )
{
$row['counter'] = $counter;
+ $row['name'] = trigger_event('render_tag_name', $row['name']);
array_push($tags, $row);
}
}
@@ -89,6 +90,7 @@ SELECT *
$tags = array();
while ($row = pwg_db_fetch_assoc($result))
{
+ $row['name'] = trigger_event('render_tag_name', $row['name']);
array_push($tags, $row);
}
@@ -238,6 +240,7 @@ SELECT t.*, count(*) AS counter
$tags = array();
while($row = pwg_db_fetch_assoc($result))
{
+ $row['name'] = trigger_event('render_tag_name', $row['name']);
array_push($tags, $row);
}
usort($tags, 'tag_alpha_compare');