summaryrefslogtreecommitdiff
path: root/modules/tag/views
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
committerAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
commit0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch)
tree6877946232f1b01b1c8709054c689f6658cef34f /modules/tag/views
parent218493c50be9362d4abed6900a816308fee5d978 (diff)
parent9379308f91a476f790fb8d444536719535c584e4 (diff)
Merge commit 'upstream/master'
Conflicts: modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/tag/views')
-rw-r--r--modules/tag/views/admin_tags.html.php81
-rw-r--r--modules/tag/views/tag_block.html.php26
-rw-r--r--modules/tag/views/tag_cloud.html.php2
3 files changed, 58 insertions, 51 deletions
diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php
index 8f3693aa..b637a7f1 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -1,64 +1,59 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script>
- var TAG_RENAME_URL = <?= html::js_string(url::site("admin/tags/rename/__ID__")) ?>;
+<script type="text/javascript">
$("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")->for_js() ?>);
- $("#gTagAdmin .delete-link").attr("title", $(".delete-link:first span").html());
+ $("#g-tag-admin .g-tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>);
+ $("#g-tag-admin .g-delete-link").attr("title", $(".g-delete-link:first span").html());
// In-place editing for tag admin
- $(".gEditable").bind("click", editInPlace);
+ $(".g-editable").gallery_in_place_edit({
+ form_url: <?= html::js_string(url::site("admin/tags/form_rename/__ID__")) ?>
+ });
});
- // make some values available within tag.js
- var csrf_token = "<?= $csrf ?>";
- 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>
- <?= t("Tag Admin") ?>
- </h2>
- <? $tags_per_column = $tags->count()/5 ?>
- <? $column_tag_count = 0 ?>
+<? $tags_per_column = $tags->count()/5 ?>
+<? $column_tag_count = 0 ?>
- <table id="gTagAdmin" class="gBlockContent">
- <caption class="understate">
- <?= t2("There is one tag", "There are %count tags", $tags->count()) ?>
- </caption>
- <tr>
- <td>
+<div class="g-block">
+ <h1> <?= t("Tag Admin") ?> </h1>
+
+ <div class="g-block-content">
+ <table id="g-tag-admin">
+ <caption>
+ <?= t2("There is one tag", "There are %count tags", $tags->count()) ?>
+ </caption>
+ <tr>
+ <td>
<? foreach ($tags as $i => $tag): ?>
<? $current_letter = strtoupper(mb_substr($tag->name, 0, 1)) ?>
<? if ($i == 0): /* first letter */ ?>
- <strong><?= html::clean($current_letter) ?></strong>
- <ul>
+ <strong><?= html::clean($current_letter) ?></strong>
+ <ul>
<? elseif ($last_letter != $current_letter): /* new letter */ ?>
+ </ul>
<? if ($column_tag_count > $tags_per_column): /* new column */ ?>
- </td>
- <td>
<? $column_tag_count = 0 ?>
+ </td>
+ <td>
<? endif ?>
-
- </ul>
- <strong><?= html::clean($current_letter) ?></strong>
- <ul>
+ <strong><?= html::clean($current_letter) ?></strong>
+ <ul>
<? endif ?>
-
- <li>
- <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">
- <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
- </li>
-
+ <li>
+ <span class="g-editable g-tag-name" rel="<?= $tag->id ?>"><?= html::clean($tag->name) ?></span>
+ <span class="g-understate">(<?= $tag->count ?>)</span>
+ <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
+ class="g-dialog-link g-delete-link g-button">
+ <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
+ </li>
<? $column_tag_count++ ?>
<? $last_letter = $current_letter ?>
- <? endforeach /* $tags */ ?>
- </ul>
- </td>
- </tr>
- </table>
+ <? endforeach ?>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php
index 59a4ef88..00b57360 100644
--- a/modules/tag/views/tag_block.html.php
+++ b/modules/tag/views/tag_block.html.php
@@ -1,17 +1,29 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script>
- $("#gAddTagForm").ready(function() {
- var url = $("#gTagCloud").attr("title") + "/autocomplete";
- $("#gAddTagForm input:text").autocomplete(
+<script type="text/javascript">
+ $("#g-add-tag-form").ready(function() {
+ var url = $("#g-tag-cloud").attr("ref") + "/autocomplete";
+ $("#g-add-tag-form input:text").autocomplete(
url, {
max: 30,
multiple: true,
- multipleSeparator: ',',
- cacheLength: 1}
+ multipleSeparator: ',',
+ cacheLength: 1
+ }
);
+ $("#g-add-tag-form").ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.result == "success") {
+ $.get($("#g-tag-cloud").attr("ref"), function(data, textStatus) {
+ $("#g-tag-cloud").html(data);
+ });
+ }
+ $("#g-add-tag-form").resetForm();
+ }
+ });
});
</script>
-<div id="gTagCloud" title="<?= url::site("tags") ?>">
+<div id="g-tag-cloud" ref="<?= 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 d6a0b5f8..de12bb49 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") ?>"><?= html::clean($tag->name) ?></a>
+ <a href="<?= $tag->url() ?>"><?= html::clean($tag->name) ?></a>
</li>
<? endforeach ?>
</ul>