Ignore:
Timestamp:
Jun 18, 2013, 3:38:03 AM (11 years ago)
Author:
mistic100
Message:

it's late! some corrections, code cleaning & filter by size on admin page

Location:
extensions/BatchDownloader/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/admin/sets.php

    r23317 r23318  
    6464  }
    6565 
    66   $order_by = $_POST['order_by'].' '.$_POST['direction'];
     66  if ($_POST['size'] != -1)
     67  {
     68    array_push($where_clauses, 'size = "'.$_POST['size'].'"');
     69  }
     70 
     71  if ($_POST['order_by'] == 'size')
     72  {
     73    $order_by = 'FIND_IN_SET(size, "square,thumb,2small,xsmall,small,medium,large,xlarge,xxlarge,original") '.$_POST['direction'];
     74  }
     75  else
     76  {
     77    $order_by = $_POST['order_by'].' '.$_POST['direction'];
     78  }
    6779}
    6880
     
    122134  );
    123135
     136$page['size_items'] = array(
     137  -1 => '------------',
     138  );
     139foreach (ImageStdParams::get_defined_type_map() as $params)
     140{
     141  $page['size_items'][ $params->type ] = l10n($params->type);
     142}
     143$page['size_items']['original'] = l10n('Original');
     144
    124145$page['order_by_items'] = array(
    125146  'date_creation' => l10n('Creation date'),
     
    127148  'nb_images' => l10n('Number of images'),
    128149  'nb_archives' => l10n('Number of archives'),
     150  'size' => l10n('Photo sizes'),
    129151  );
    130152
     
    139161  'type_options' => $page['type_items'],
    140162  'type_selected' => isset($_POST['type']) ? $_POST['type'] : '',
     163  'size_options' => $page['size_items'],
     164  'size_selected' => isset($_POST['size']) ? $_POST['size'] : '',
    141165  'order_options' => $page['order_by_items'],
    142166  'order_selected' => isset($_POST['order_by']) ? $_POST['order_by'] : '',
  • extensions/BatchDownloader/admin/template/sets.tpl

    r23291 r23318  
    1717    {'Set type'|@translate}
    1818    {html_options name=type options=$type_options selected=$type_selected}
     19  </label>
     20 
     21  <label>
     22    {'Photo sizes'|@translate}
     23    {html_options name=size options=$size_options selected=$size_selected}
    1924  </label>
    2025 
     
    4954      <td class="type">{'Set type'|@translate}</td>
    5055      <td class="date">{'Creation date'|@translate}</td>
    51       <td class="size">{'Total size'|@translate}</td>
     56      <td class="img_size">{'Photo sizes'|@translate}</td>
    5257      <td class="images">{'Number of images'|@translate}</td>
    5358      <td class="archives">{'Number of archives'|@translate}</td>
     59      <td class="size">{'Total size'|@translate}</td>
    5460      <td class="status">{'Status'|@translate}</td>
    5561      <td class="action">{'Actions'|@translate}</td>
     
    6268    <td>{$set.NAME}</td>
    6369    <td style="text-align:center;">{$set.DATE_CREATION}</td>
    64     <td>{$set.TOTAL_SIZE}</td>
     70    <td>{if $set.SIZE=='original'}{'Original'|@translate}{else}{$set.SIZE|@translate}{/if}</td>
    6571    <td>{$set.NB_IMAGES}</td>
    6672    <td>{$set.NB_ARCHIVES}</td>
     73    <td>{$set.TOTAL_SIZE}</td>
    6774    <td>
    6875      {$set.STATUS|@translate}
  • extensions/BatchDownloader/admin/template/style.css

    r23288 r23318  
    3838  width:100px;
    3939}
     40.table2 .img_size {
     41  width:120px;
     42}
    4043.table2 .images {
    4144  width:100px;
Note: See TracChangeset for help on using the changeset viewer.