Ignore:
Timestamp:
Jan 13, 2013, 12:49:45 PM (12 years ago)
Author:
mistic100
Message:

compatible with Simple, new export options

Location:
extensions/UserCollections/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/admin/export.php

    r20090 r20099  
    1212}
    1313
     14// pwg_unset_session_var('uc_export_active_fields');
     15// pwg_unset_session_var('uc_export_inactive_fields');
    1416
    1517if (isset($_POST['download']))
    1618{
    17   $content = $UserCollection->serialize($_POST['content']);
     19  pwg_set_session_var('uc_export_active_fields', $_POST['active']);
     20  pwg_set_session_var('uc_export_inactive_fields', $_POST['inactive']);
     21 
     22  $content = $UserCollection->serialize($_POST['active']);
    1823  $filename = 'collection_'.$_GET['col_id'].'_'.date('Ymd-Hi').'.csv';
    1924 
     
    3237}
    3338
     39$default_active_fields = array(
     40  'id',
     41  'name',
     42  'path',
     43  );
     44$default_inactive_fields = array(
     45  'file',
     46  'url',
     47  'date_creation',
     48  'collection_add_date',
     49  'filesize',
     50  'width',
     51  'height',
     52  );
     53
     54$template->assign('active_fields', pwg_get_session_var('uc_export_active_fields', $default_active_fields));
     55$template->assign('inactive_fields', pwg_get_session_var('uc_export_inactive_fields', $default_inactive_fields));
     56
    3457$template->set_filename('user_collections', dirname(__FILE__) . '/template/export.tpl');
    3558
  • extensions/UserCollections/admin/template/export.tpl

    r20093 r20099  
    2020});
    2121
     22$("#invokeFrame").load(function() {
     23  $(this).css('height', $(this).contents().find('body').outerHeight(true)+10);
     24});
     25
    2226$("input[name='download']").click(function() {
    2327  $("#fields_active li").each(function() {
    24     $("#export_form").append('<input type="hidden" name="content[]" value="'+ $(this).data('name') +'"/>');
     28    $("#export_form").append('<input type="hidden" name="active[]" value="'+ $(this).data('name') +'"/>');
     29  });
     30  $("#fields_inactive li").each(function() {
     31    $("#export_form").append('<input type="hidden" name="inactive[]" value="'+ $(this).data('name') +'"/>');
    2532  });
    2633});
     
    3744  <ul id="fields_active" class="connectedSortable">
    3845    <h4>{'Active'|@translate}</h4>
    39     <li data-name="id"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> id</li>
    40     <li data-name="name"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> name</li>
    41     <li data-name="path"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> path</li>
     46  {foreach from=$active_fields item=field}
     47    <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li>
     48  {/foreach}
    4249  </ul>
    4350  <ul id="fields_inactive" class="connectedSortable">
    4451    <h4>{'Inactive'|@translate}</h4>
    45     <li data-name="file"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> file</li>
    46     <li data-name="url"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> url</li>
     52  {foreach from=$inactive_fields item=field}
     53    <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li>
     54  {/foreach}
    4755  </ul>
    4856 
  • extensions/UserCollections/admin/template/style.css

    r20090 r20099  
    4444.connectedSortable {
    4545  display:inline-block;
    46   width:150px;
     46  width:170px;
    4747  vertical-align:top;
    4848  border:1px dashed #7a7a7a;
     
    9696#invokeFrame {
    9797  width:100%;
    98   height:500px;
     98  background:#e7e7e7;
     99  color:#222;
     100  border:none;
    99101}
Note: See TracChangeset for help on using the changeset viewer.