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

replace toggle_image.php by webservices

Location:
extensions/UserCollections/include
Files:
2 edited

Legend:

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

    r20097 r20141  
    169169      'collection_toggle_url' => $self_url,
    170170      'U_LIST' => USER_COLLEC_PUBLIC,
    171       'COL_ID' => $page['col_id'],
     171      'AJAX_COL_ID' => $page['col_id'],
     172      'UC_IN_EDIT' => true,
    172173      ));
    173174   
     
    330331function user_collections_thumbnails_in_collection($tpl_thumbnails_var, $pictures)
    331332{
    332   global $template;
     333  global $template, $page;
     334 
     335  $url = USER_COLLEC_PUBLIC . 'edit/'.$page['col_id'];
    333336 
    334337  foreach ($tpl_thumbnails_var as &$thumbnail)
     
    345348        array('start')
    346349      );
     350     
     351    $thumbnail['COLLECTION_SELECTED'] = true;
     352    $thumbnail['COLLECTION_TOGGLE_URL'] = add_url_params($url, array('collection_toggle'=>$thumbnail['id']));
    347353  }
    348354 
  • 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.