Ignore:
Timestamp:
Feb 20, 2012, 8:28:43 PM (12 years ago)
Author:
plg
Message:

feature 2581: new design on albums list management.

icons removed, replaced by text links visible on :hover

better ergonomy for automatic order: the "save manual order" submit button
only appears when a change is detected in the album ordering. The "automatic
sort order" becomes a dedicated fieldset, hidden by default, displayed "on
user demand".

new virtual album form displayed only "on user demand"

cat_list, cat_move and permalinks are 3 tabs for the "Albums > Manage" link
in the menubar.

permalinks admin page slightly redesign: fieldsets instead of centered h3,
"on user demand" form to add/modify permalinks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_list.php

    r13025 r13282  
    101101
    102102// +-----------------------------------------------------------------------+
     103// | tabs                                                                  |
     104// +-----------------------------------------------------------------------+
     105
     106$page['tab'] = 'list';
     107include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
     108
     109// +-----------------------------------------------------------------------+
    103110// |                    virtual categories management                      |
    104111// +-----------------------------------------------------------------------+
     
    135142}
    136143// save manual category ordering
    137 else if (isset($_POST['submitOrder']))
    138 {
    139   if ('manual' == $_POST['order_type'])
    140   {
    141     asort($_POST['catOrd'], SORT_NUMERIC);
    142     save_categories_order(array_keys($_POST['catOrd']));
    143 
    144     array_push(
    145       $page['infos'],
    146       l10n('Album manual order was saved')
    147       );
    148   }
    149   else
    150   {
    151     $query = '
     144else if (isset($_POST['submitManualOrder']))
     145{
     146  asort($_POST['catOrd'], SORT_NUMERIC);
     147  save_categories_order(array_keys($_POST['catOrd']));
     148
     149  array_push(
     150    $page['infos'],
     151    l10n('Album manual order was saved')
     152    );
     153}
     154else if (isset($_POST['submitAutoOrder']))
     155{
     156  $query = '
    152157SELECT id
    153158  FROM '.CATEGORIES_TABLE.'
     
    155160    (!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).'
    156161;';
    157     $category_ids = array_from_query($query, 'id');
    158 
    159     if (isset($_POST['recursive']))
    160     {
    161       $category_ids = get_subcat_ids($category_ids);
    162     }
    163 
    164     $categories = array();
    165     $names = array();
    166     $id_uppercats = array();
     162  $category_ids = array_from_query($query, 'id');
     163
     164  if (isset($_POST['recursive']))
     165  {
     166    $category_ids = get_subcat_ids($category_ids);
     167  }
    167168 
    168     $query = '
     169  $categories = array();
     170  $names = array();
     171  $id_uppercats = array();
     172 
     173  $query = '
    169174SELECT id, name, id_uppercat
    170175  FROM '.CATEGORIES_TABLE.'
    171176  WHERE id IN ('.implode(',', $category_ids).')
    172177;';
    173     $result = pwg_query($query);
    174     while ($row = pwg_db_fetch_assoc($result))
    175     {
    176       array_push(
    177         $categories,
    178         array(
    179           'id' => $row['id'],
    180           'id_uppercat' => $row['id_uppercat'],
    181           )
    182         );
    183       array_push(
    184         $names,
    185         $row['name']
    186         );
    187     }
    188 
    189     array_multisort(
     178  $result = pwg_query($query);
     179  while ($row = pwg_db_fetch_assoc($result))
     180  {
     181    array_push(
     182      $categories,
     183      array(
     184        'id' => $row['id'],
     185        'id_uppercat' => $row['id_uppercat'],
     186        )
     187      );
     188    array_push(
    190189      $names,
    191       SORT_REGULAR,
    192       'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC,
    193       $categories
     190      $row['name']
    194191      );
    195     save_categories_order($categories);
    196 
    197     array_push(
    198       $page['infos'],
    199       l10n('Albums automatically sorted')
    200       );
    201   }
     192  }
     193
     194  array_multisort(
     195    $names,
     196    SORT_REGULAR,
     197    'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC,
     198    $categories
     199    );
     200  save_categories_order($categories);
     201
     202  array_push(
     203    $page['infos'],
     204    l10n('Albums automatically sorted')
     205    );
    202206}
    203207
Note: See TracChangeset for help on using the changeset viewer.