Ignore:
Timestamp:
Jan 14, 2013, 5:29:39 PM (11 years ago)
Author:
mistic100
Message:

replace toggle_image.php by webservices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/include/events.inc.php

    r20099 r20141  
    9999    $template->assign('NO_AJAX', true);
    100100  }
     101  else
     102  {
     103    $template->assign('AJAX_COL_ID', $col_id );
     104  }
    101105 
    102106  // template vars
    103   $url = duplicate_index_url(array(), array('collection_toggle')); 
     107  $url = duplicate_index_url(array(), array('collection_toggle'));
    104108 
    105109  foreach ($tpl_thumbnails_var as &$thumbnail)
     
    109113      $thumbnail['COLLECTION_SELECTED'] = true;
    110114    }
     115    $thumbnail['COLLECTION_TOGGLE_URL'] = add_url_params($url, array('collection_toggle'=>$thumbnail['id']));
    111116  }
    112117  unset($thumbnail);
     
    114119  $template->assign(array(
    115120    'USER_COLLEC_PATH' => USER_COLLEC_PATH,
    116     'collection_toggle_url' =>  add_url_params($url, array('collection_toggle'=>'')),
    117121    ));
    118122 
     
    128132  $search = '#(<li>|<li class="gthumb">)#';
    129133  $replace = '$1
    130 {strip}<a class="addCollection" href="{$collection_toggle_url}{$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
    131 <span class="uc_remove" {if not $COL_ID and not $thumbnail.COLLECTION_SELECTED}style="display:none;"{/if}>
     134{strip}<a class="addCollection" href="{$thumbnail.COLLECTION_TOGGLE_URL}" data-id="{$thumbnail.id}" data-stat="{if $thumbnail.COLLECTION_SELECTED}remove{else}add{/if}" rel="nofollow">
     135<span class="uc_remove" {if not $thumbnail.COLLECTION_SELECTED}style="display:none;"{/if}>
    132136{\'Remove from collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/image_delete.png" title="{\'Remove from collection\'|@translate}">
    133137</span>
    134 <span class="uc_add" {if $COL_ID or $thumbnail.COLLECTION_SELECTED}style="display:none;"{/if}>
     138<span class="uc_add" {if $thumbnail.COLLECTION_SELECTED}style="display:none;"{/if}>
    135139{\'Add to collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/image_add.png" title="{\'Add to collection\'|@translate}">
    136140</span>
Note: See TracChangeset for help on using the changeset viewer.