summaryrefslogtreecommitdiff
path: root/modules/tag/views
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag/views')
-rw-r--r--modules/tag/views/admin_tags.html.php14
-rw-r--r--modules/tag/views/tag_block.html.php14
-rw-r--r--modules/tag/views/tag_cloud.html.php2
3 files changed, 21 insertions, 9 deletions
diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php
index 7d201da7..8f3693aa 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -1,9 +1,9 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script>
- var TAG_RENAME_URL = "<?= url::site("admin/tags/rename/__ID__") ?>";
+ var TAG_RENAME_URL = <?= html::js_string(url::site("admin/tags/rename/__ID__")) ?>;
$("document").ready(function() {
// using JS for adding link titles to avoid running t() for each tag
- $("#gTagAdmin .tag-name").attr("title", "<?= t("Click to edit this tag") ?>");
+ $("#gTagAdmin .tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>);
$("#gTagAdmin .delete-link").attr("title", $(".delete-link:first span").html());
// In-place editing for tag admin
@@ -11,8 +11,8 @@
});
// make some values available within tag.js
var csrf_token = "<?= $csrf ?>";
- var save_i18n = '<?= t("save") ?>';
- var cancel_i18n = '<?= t("cancel") ?>';
+ var save_i18n = <?= html::js_string(t("save")->for_html_attr()) ?>;
+ var cancel_i18n = <?= html::js_string(t("cancel")->for_html_attr()) ?>;
</script>
<div class="gBlock">
<h2>
@@ -32,7 +32,7 @@
<? $current_letter = strtoupper(mb_substr($tag->name, 0, 1)) ?>
<? if ($i == 0): /* first letter */ ?>
- <strong><?= $current_letter ?></strong>
+ <strong><?= html::clean($current_letter) ?></strong>
<ul>
<? elseif ($last_letter != $current_letter): /* new letter */ ?>
<? if ($column_tag_count > $tags_per_column): /* new column */ ?>
@@ -42,12 +42,12 @@
<? endif ?>
</ul>
- <strong><?= $current_letter ?></strong>
+ <strong><?= html::clean($current_letter) ?></strong>
<ul>
<? endif ?>
<li>
- <span id="gTag-<?= $tag->id ?>" class="gEditable tag-name"><?= p::clean($tag->name) ?></span>
+ <span id="gTag-<?= $tag->id ?>" class="gEditable tag-name"><?= html::clean($tag->name) ?></span>
<span class="understate">(<?= $tag->count ?>)</span>
<a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
class="gDialogLink delete-link gButtonLink">
diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php
index 9c8f3de5..59a4ef88 100644
--- a/modules/tag/views/tag_block.html.php
+++ b/modules/tag/views/tag_block.html.php
@@ -1,5 +1,17 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gTagCloud" src="<?= url::site("tags") ?>">
+<script>
+ $("#gAddTagForm").ready(function() {
+ var url = $("#gTagCloud").attr("title") + "/autocomplete";
+ $("#gAddTagForm input:text").autocomplete(
+ url, {
+ max: 30,
+ multiple: true,
+ multipleSeparator: ',',
+ cacheLength: 1}
+ );
+ });
+</script>
+<div id="gTagCloud" title="<?= url::site("tags") ?>">
<?= $cloud ?>
</div>
<?= $form ?> \ No newline at end of file
diff --git a/modules/tag/views/tag_cloud.html.php b/modules/tag/views/tag_cloud.html.php
index eba615fc..d6a0b5f8 100644
--- a/modules/tag/views/tag_cloud.html.php
+++ b/modules/tag/views/tag_cloud.html.php
@@ -3,7 +3,7 @@
<? foreach ($tags as $tag): ?>
<li class="size<?=(int)(($tag->count / $max_count) * 7) ?>">
<span><?= $tag->count ?> photos are tagged with </span>
- <a href="<?= url::site("tags/$tag->id") ?>"><?= p::clean($tag->name) ?></a>
+ <a href="<?= url::site("tags/$tag->id") ?>"><?= html::clean($tag->name) ?></a>
</li>
<? endforeach ?>
</ul>