Changeset 16608
- Timestamp:
- Jul 11, 2012, 12:20:27 PM (12 years ago)
- Location:
- extensions/UserCollections
- Files:
-
- 1 added
- 5 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 -
extensions/UserCollections/include/events.inc.php
r16599 r16608 19 19 { 20 20 $page['section'] = 'collections'; 21 $page['title'] = '<a href="'. USER_COLLEC_PUBLIC.'">'.l10n('Collections').'</a>';21 $page['title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.USER_COLLEC_PUBLIC.'">'.l10n('Collections').'</a>'; 22 22 23 23 if (in_array(@$tokens[1], array('edit','view','list'))) … … 116 116 function user_collections_thumbnails_list_prefilter($content, &$smarty) 117 117 { 118 $search = '<span class="thumbName">'; 119 120 $add = '<a href="{$collection_toggle_url}&collection_toggle={$thumbnail.id}" rel="nofollow"> 118 // custom style 119 $search[0] = '{/html_style}'; 120 $replace[0] = '.thumbnails .wrap1 {ldelim} position:relative; } 121 .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; } 122 .wrap1:hover .addCollection {ldelim} display:block; }' 123 .$search[0]; 124 125 // links 126 $search[1] = '<span class="wrap1">'; 127 $replace[1] = $search[1].' 128 {strip}<a class="addCollection" href="{$collection_toggle_url}&collection_toggle={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow"> 121 129 {if $thumbnail.COLLECTION_SELECTED} 122 <img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">130 {\'Remove from collection\'|@translate} <img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}"> 123 131 {else} 124 <img src="{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">132 {\'Add to collection\'|@translate} <img src="{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}"> 125 133 {/if} 126 </a> '; 127 128 return str_replace($search, $search.$add, $content); 134 </a>{/strip}'; 135 136 // AJAX request 137 $search[2] = '{/html_style}'; 138 $replace[2] = $search[2].' 139 {footer_script require=\'jquery\'} 140 jQuery(".addCollection").click(function() {ldelim} 141 var toggle_id = jQuery(this).data("id"); 142 var $trigger = jQuery(this); 143 144 jQuery.ajax({ldelim} 145 type: "POST", 146 url: "{$USER_COLLEC_PATH}toggle_image.php", 147 data: {ldelim} "toggle_id": toggle_id } 148 }).done(function(msg) {ldelim} 149 if (msg == "true") {ldelim} 150 $trigger.html(\'{\'Remove from collection\'|@translate} <img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">\'); 151 } else if (msg == "false") {ldelim} 152 $trigger.html(\'{\'Add to collection\'|@translate} <img src="{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">\'); 153 } else {ldelim} 154 $trigger.html(\'{\'Un unknown error occured\'|@translate}\'); 155 } 156 }); 157 158 return false; 159 }); 160 {/footer_script}'; 161 162 return str_replace($search, $replace, $content); 129 163 } 130 164 -
extensions/UserCollections/template/edit.tpl
r16597 r16608 9 9 copy:$("#publicURL .url").html(), 10 10 afterCopy: function() {ldelim} 11 $('.confirm').remove(); 11 12 $('<span class="confirm" style="display:none;">{'Copied'|@translate}</span>').appendTo("#publicURL") 12 13 .fadeIn(400).delay(1000).fadeOut(400, function(){ldelim} $(this).remove(); }); -
extensions/UserCollections/template/list.tpl
r16597 r16608 35 35 <li {if $col.active}class="active"{/if}> 36 36 <p class="collecTitle"> 37 <a href="{$col.U_ VIEW}" rel="nofollow"><b>{$col.name}</b></a>38 <i>{'%d images'|@translate|@sprintf:$col.nb_images}</i>37 <a href="{$col.U_EDIT}" rel="nofollow"><b>{$col.name}</b></a> 38 <i>{'%d photos'|@translate|@sprintf:$col.nb_images}</i> 39 39 </p> 40 40 <p class="collecActions"> … … 61 61 </p> 62 62 <p class="collecTitle"> 63 <a href="{$col.U_ VIEW}" rel="nofollow"><b>{$col.name}</b></a>64 <i>{'%d images'|@translate|@sprintf:$col.nb_images}</i>63 <a href="{$col.U_EDIT}" rel="nofollow"><b>{$col.name}</b></a> 64 <i>{'%d photos'|@translate|@sprintf:$col.nb_images}</i> 65 65 </p> 66 66 <p class="collecActions"> -
extensions/UserCollections/template/menublock_user_collec.tpl
r16599 r16608 2 2 <dd> 3 3 {if $block->data.current} 4 {'Current collection:'|@translate} <b>{$block->data.current.NAME}</b>, {'%d images'|@translate|@sprintf:$block->data.current.NB_IMAGES}4 {'Current collection:'|@translate} <b>{$block->data.current.NAME}</b>, {'%d photos'|@translate|@sprintf:$block->data.current.NB_IMAGES} 5 5 <ul>{strip} 6 6 {foreach from=$block->data.links item=link}
Note: See TracChangeset
for help on using the changeset viewer.