Changeset 2429 for trunk/template/yoga


Ignore:
Timestamp:
Jul 12, 2008, 2:30:27 AM (16 years ago)
Author:
rvelices
Message:
  • add to caddie on picture page done through ajax
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/template/yoga/picture.tpl

    r2413 r2429  
    5555      <a href="{$U_ADMIN}" title="{'link_info_image'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/preferences.png" class="button" alt="{'edit'|@translate}"></a>
    5656    {/if}
    57     {if isset($U_CADDIE) }
    58       <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>
    59     {/if}
     57    {if isset($U_CADDIE) }{*caddie management BEGIN*}
     58<script type="text/javascript">
     59{literal}function addToCadie(aElement, rootUrl, id)
     60{
     61if (aElement.disabled) return;
     62aElement.disabled=true;
     63var y = new PwgWS(rootUrl);
     64
     65y.callService(
     66  "pwg.caddie.add", {image_id: id} ,
     67  {
     68    onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
     69    onSuccess: function(result) { aElement.disabled = false; }
     70  }
     71  );
     72}{/literal}
     73</script>
     74      <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>
     75    {/if}{*caddie management END*}
    6076  </div>
    6177  {include file=$FILE_PICTURE_NAV_BUTTONS}
Note: See TracChangeset for help on using the changeset viewer.