Changeset 16608 for extensions/UserCollections/include/collections.inc.php
- Timestamp:
- Jul 11, 2012, 12:20:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/collections.inc.php
r16597 r16608 135 135 { 136 136 $col['name'] = 'temp #'.$col['id']; 137 $col['U_VIEW'] = $col['U_EDIT'];138 137 $col['U_SAVE'] = USER_COLLEC_PUBLIC.'&action=save&col_id='.$col['id']; 139 138 $template->append('temp_col', $col); … … 141 140 else 142 141 { 143 $col['U_VIEW'] = USER_COLLEC_PUBLIC.'view/'.$col['id'];144 142 $template->append('collections', $col); 145 143 } … … 166 164 'U_VIEW' => $self_url, 167 165 'U_LIST' => USER_COLLEC_PUBLIC, 166 'COL_ID' => $page['col_id'], 168 167 )); 169 168 … … 191 190 $template->assign('collection', $UserCollection->getCollectionInfo()); 192 191 193 $template->set_prefilter('index_thumbnails', 'user_collection _thumbnails_list_prefilter');192 $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_special_prefilter'); 194 193 195 194 $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0; … … 282 281 $template->assign('USER_COLLEC_PATH', USER_COLLEC_PATH); 283 282 284 function user_collection_thumbnails_list_prefilter($content, &$smarty) 283 284 function user_collections_thumbnails_list_special_prefilter($content, &$smarty) 285 285 { 286 $search = '<span class="thumbName">'; 286 // custom style 287 $search[0] = '{/html_style}'; 288 $replace[0] = '.thumbnails .wrap1 {ldelim} position:relative; } 289 .addCollection {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:0.8em; } 290 .wrap1:hover .addCollection {ldelim} display:block; }' 291 .$search[0]; 292 293 // links 294 $search[1] = '<span class="wrap1">'; 295 $replace[1] = $search[1].' 296 {strip}<a class="addCollection" href="{$U_VIEW}&remove={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow"> 297 {\'Remove from collection\'|@translate} <img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}"> 298 </a>{/strip}'; 299 300 // AJAX request 301 $search[2] = '{/html_style}'; 302 $replace[2] = $search[2].' 303 {footer_script require=\'jquery\'} 304 jQuery(".addCollection").click(function() {ldelim} 305 var toggle_id = jQuery(this).data("id"); 306 var $trigger = jQuery(this); 287 307 288 $add = '<a href="{$U_VIEW}&remove={$thumbnail.id}" rel="nofollow"> 289 <img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}"> 290 </a> '; 291 292 return str_replace($search, $search.$add, $content); 308 jQuery.ajax({ldelim} 309 type: "POST", 310 url: "{$USER_COLLEC_PATH}toggle_image.php", 311 data: {ldelim} "col_id": "{$COL_ID}", "toggle_id": toggle_id } 312 }).done(function(msg) {ldelim} 313 if (msg == "false") {ldelim} 314 $trigger.parent(".wrap1").hide("fast", function() {ldelim} $trigger.remove() }); 315 } else {ldelim} 316 $trigger.html(\'{\'Un unknown error occured\'|@translate}\'); 317 } 318 }); 319 320 return false; 321 }); 322 {/footer_script}'; 323 324 return str_replace($search, $replace, $content); 293 325 } 294 326
Note: See TracChangeset
for help on using the changeset viewer.