Changeset 16698


Ignore:
Timestamp:
Jul 13, 2012, 8:49:13 PM (12 years ago)
Author:
mistic100
Message:

-update menu when the temp collection is created
-update BatchDownloader confirmation message

Location:
extensions/UserCollections
Files:
6 edited

Legend:

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

    r16688 r16698  
    8989 
    9090  // get existing collections
    91   if (empty($UserCollection) and ($col_id = get_current_collection_id(false)) !== false)
     91  $col_id = get_current_collection_id(false);
     92  if (empty($UserCollection) and $col_id !== false)
    9293  {
    9394    $UserCollection = new UserCollection($col_id);
     
    101102  {
    102103    $collection = array();
     104  }
     105 
     106  // if the collection is created we don't use AJAX to force menu refresh
     107  if ($col_id === false)
     108  {
     109    $template->assign('NO_AJAX', true);
    103110  }
    104111 
     
    196203  if (is_a_guest()) return;
    197204 
    198   global $user;
    199  
    200205  $menu = &$menu_ref_arr[0];
    201206  if ($menu->get_id() != 'menubar') return;
    202  
    203   $query = '
    204 SELECT id
    205   FROM '.COLLECTIONS_TABLE.'
    206   WHERE user_id = '.$user['id'].'
    207   LIMIT 1
    208 ;';
    209   $result = pwg_query($query);
    210  
    211   if (!pwg_db_num_rows($result)) return;
    212  
     207   
    213208  $menu->register_block(new RegisteredBlock('mbUserCollection', l10n('Collections'), 'UserCollection'));
    214209}
  • extensions/UserCollections/language/en_UK/plugin.lang.php

    r16688 r16698  
    44$lang['Public collection'] = 'Public';
    55$lang['Copy to clipboard'] = 'Copy to clipboard';
    6 $lang['Return to collections list'] = 'Return to collections list';
     6$lang['Return to collections list'] = 'Return to list';
    77$lang['This collection is empty'] = 'This collection is empty';
    88$lang['Collection name:'] = 'Collection name:';
     
    2121$lang['Add to collection'] = 'Add to collection';
    2222$lang['Clear collection'] = 'Clear';
     23$lang['You have %d collection'] = 'You have %d collection';
     24$lang['You have no collection'] = 'You have no collection';
    2325$lang['You have %d collections'] = 'You have %d collections';
    2426$lang['active'] = 'active';
  • extensions/UserCollections/language/fr_FR/plugin.lang.php

    r16688 r16698  
    2121$lang['Add to collection'] = 'Ajouter à la collection';
    2222$lang['Clear collection'] = 'Vider';
     23$lang['You have %d collection'] = 'Vous avez %d collection';
     24$lang['You have no collection'] = 'Vous n\'avez aucune collection';
    2325$lang['You have %d collections'] = 'Vous avez %d collections';
    2426$lang['active'] = 'active';
  • extensions/UserCollections/template/edit.tpl

    r16688 r16698  
    7777
    7878
     79<form id="actions" style="text-align:center;">
     80<input type="submit" data-href="{$collection.U_CLEAR}" value="{'Clear collection'|@translate}">
     81<input type="submit" data-href="{$collection.U_DELETE}" value="{'Delete'|@translate}">
     82</form>
     83
     84
    7985{if $collection.NB_IMAGES > 0}
    8086<ul class="thumbnails" id="thumbnails">
     
    8692
    8793{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
    88 
    89 
    90 <form id="actions" style="text-align:center;">
    91 <input type="submit" data-href="{$collection.U_CLEAR}" value="{'Clear collection'|@translate}">
    92 <input type="submit" data-href="{$collection.U_DELETE}" value="{'Delete'|@translate}">
    93 </form>
    9494{/if}
    9595
  • extensions/UserCollections/template/menublock_user_collec.tpl

    r16688 r16698  
    11<dt>{$block->get_title()}</dt>
    22<dd>
    3   <p><a href="{$block->data.U_LIST}">{'You have %d collections'|@translate|sprintf:$block->data.NB_COL}</a></p>
     3  <p>
     4    {if $block->data.NB_COL == 0}
     5      {'You have no collection'|@translate|sprintf:$block->data.NB_COL}
     6    {else}
     7      <a href="{$block->data.U_LIST}">{$pwg->l10n_dec('You have %d collection', 'You have %d collections', $block->data.NB_COL)}</a>
     8    {/if}</p>
    49  {if $block->data.collections}
    510  <ul>{strip}
  • extensions/UserCollections/template/thumbnails_css_js.tpl

    r16688 r16698  
    55{/html_style}
    66
     7{if not $NO_AJAX}
    78{footer_script require='jquery'}
    89jQuery(".addCollection").click(function() {ldelim}
     
    2122    {if $COL_ID}
    2223      $trigger.parent(".wrap1").hide("fast", function() {ldelim} $trigger.remove() });
     24      if (typeof batchdown_count != 'undefined') batchdown_count-=1;
    2325    {else}
    2426      $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">');
     
    3335});
    3436{/footer_script}
     37{/if}
Note: See TracChangeset for help on using the changeset viewer.