Ignore:
Timestamp:
Feb 2, 2011, 10:35:48 AM (13 years ago)
Author:
plg
Message:

bug 2172 fixed: the "sort order" options are removed from the album administration main page.

bug 2173 fixed: rename "manual order" into "automatic order" and "by rank" into "manual order"

bug 2174 fixed: only show the automatic order options when it's relevant

new icon for the "manage photo order" screen

hide the numeric rank below the thumbnail (it is confusing for users)

tell users that you can drag'n drop to reorder photos

bug fixed: the "apply to sub-albums" options for photo orders was not working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r8728 r9051  
    4545if (isset($_POST['submit']))
    4646{
    47   $image_order = null;
    48   if ( !isset($_POST['image_order_default']) )
    49   {
    50     for ($i=1; $i<=3; $i++)
    51     {
    52       if ( !empty($_POST['order_field_'.$i]) )
    53       {
    54         if (! empty($image_order) )
    55         {
    56           $image_order .= ',';
    57         }
    58         $image_order .= $_POST['order_field_'.$i];
    59         if ($_POST['order_direction_'.$i]=='DESC')
    60         {
    61           $image_order .= ' DESC';
    62         }
    63       }
    64     }
    65   }
    66 
    6747  $data =
    6848    array(
     
    7353        $conf['allow_html_descriptions'] ?
    7454          @$_POST['comment'] : strip_tags(@$_POST['comment']),
    75       'image_order' => $image_order,
    7655      );
    7756
     
    8766  // retrieve cat infos before continuing (following updates are expensive)
    8867  $cat_info = get_cat_info($_GET['cat_id']);
    89 
    90   if (isset($_POST['image_order_subcats']))
    91   {
    92     $query = '
    93 UPDATE '.CATEGORIES_TABLE.' SET image_order='.(isset($image_order) ? 'NULL':'\''.$image_order.'\'').'
    94   WHERE uppercats LIKE \''.$cat_info['uppercats'].',%\'';
    95     pwg_query($query);
    96   }
    9768
    9869  if ($cat_info['visible'] != get_boolean( $_POST['visible'] ) )
     
    245216    'CAT_COMMENTABLE'   => boolean_to_string($category['commentable']),
    246217
    247     'IMG_ORDER_DEFAULT'  => empty($category['image_order']) ?
    248                               'checked="checked"' : '',
    249 
    250218    'U_JUMPTO' => make_index_url(
    251219      array(
     
    278246    $base_url.'batch_manager&amp;cat='.$category['id']
    279247    );
    280   $template->assign(
    281     'U_MANAGE_RANKS',
    282     $base_url.'element_set_ranks&amp;cat_id='.$category['id']
    283     );
    284 }
     248}
     249
     250$template->assign(
     251  'U_MANAGE_RANKS',
     252  $base_url.'element_set_ranks&amp;cat_id='.$category['id']
     253  );
    285254
    286255if ($category['is_virtual'])
     
    303272    );
    304273}
    305 
    306 // image order management
    307 
    308 $sort_fields = array(
    309   '' => '',
    310   'date_creation' => l10n('Creation date'),
    311   'date_available' => l10n('Post date'),
    312   'average_rate' => l10n('Average rate'),
    313   'hit' => l10n('Most visited'),
    314   'file' => l10n('File name'),
    315   'id' => 'Id',
    316   'rank' => l10n('Rank'),
    317   );
    318 
    319 $sort_directions = array(
    320   'ASC' => l10n('ascending'),
    321   'DESC' => l10n('descending'),
    322   );
    323 
    324 $template->assign( 'image_order_field_options', $sort_fields);
    325 $template->assign( 'image_order_direction_options', $sort_directions);
    326 
    327 $matches = array();
    328 if ( !empty( $category['image_order'] ) )
    329 {
    330   preg_match_all('/([a-z_]+) *(?:(asc|desc)(?:ending)?)? *(?:, *|$)/i',
    331     $category['image_order'], $matches);
    332 }
    333 
    334 for ($i=0; $i<3; $i++) // 3 fields
    335 {
    336   $tpl_image_order_select = array(
    337       'ID' => $i+1,
    338       'FIELD' => array(''),
    339       'DIRECTION' => array('ASC'),
    340     );
    341 
    342   if ( isset($matches[1][$i]) )
    343   {
    344     $tpl_image_order_select['FIELD'] = array($matches[1][$i]);
    345   }
    346 
    347   if (isset($matches[2][$i]) and strcasecmp($matches[2][$i],'DESC')==0)
    348   {
    349     $tpl_image_order_select['DIRECTION'] = array('DESC');
    350   }
    351   $template->append( 'image_orders', $tpl_image_order_select);
    352 }
    353 
    354274
    355275// representant management
Note: See TracChangeset for help on using the changeset viewer.