aboutsummaryrefslogtreecommitdiffstats
path: root/template/yoga/picture.tpl
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-07-12 00:30:27 +0000
committerrvelices <rv-github@modusoptimus.com>2008-07-12 00:30:27 +0000
commite2ee204c128717069c84437e0aa75bf14b6b352a (patch)
tree72f8059850e19b21168f217aa9a3b09096fdba87 /template/yoga/picture.tpl
parent22ce08c6fbc9f52152ac300156d72256d76a1d64 (diff)
- add to caddie on picture page done through ajax
git-svn-id: http://piwigo.org/svn/trunk@2429 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'template/yoga/picture.tpl')
-rw-r--r--template/yoga/picture.tpl22
1 files changed, 19 insertions, 3 deletions
diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl
index e52a7a7a7..af22ade18 100644
--- a/template/yoga/picture.tpl
+++ b/template/yoga/picture.tpl
@@ -54,9 +54,25 @@
{if isset($U_ADMIN) }
<a href="{$U_ADMIN}" title="{'link_info_image'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/preferences.png" class="button" alt="{'edit'|@translate}"></a>
{/if}
- {if isset($U_CADDIE) }
- <a href="{$U_CADDIE}" title="{'add to caddie'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/caddie_add.png" class="button" alt="{'caddie'|@translate}"></a>
- {/if}
+ {if isset($U_CADDIE) }{*caddie management BEGIN*}
+<script type="text/javascript">
+{literal}function addToCadie(aElement, rootUrl, id)
+{
+if (aElement.disabled) return;
+aElement.disabled=true;
+var y = new PwgWS(rootUrl);
+
+y.callService(
+ "pwg.caddie.add", {image_id: id} ,
+ {
+ onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
+ onSuccess: function(result) { aElement.disabled = false; }
+ }
+ );
+}{/literal}
+</script>
+ <a href="{$U_CADDIE}" onclick="addToCadie(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}); return false;" title="{'add to caddie'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/caddie_add.png" class="button" alt="{'caddie'|@translate}"></a>
+ {/if}{*caddie management END*}
</div>
{include file=$FILE_PICTURE_NAV_BUTTONS}
</div> <!-- imageToolBar -->