Changeset 11587 for trunk/include


Ignore:
Timestamp:
Jul 1, 2011, 3:19:35 PM (13 years ago)
Author:
mistic100
Message:

feature:2317 move order config to Admin->Config->Options
new GUI interface for simple paterns
in GUI, order_by and order_by_inside_category are merged (not un DB)
users can define special paterns with $conforder_by_custom and $conforder_by_inside_category_custom

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r11511 r11587  
    107107  @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php');
    108108}
     109
     110// that's for migration from 2.2, will be deprecated in 2.4
     111if (isset($conf['order_by']))
     112{
     113  $conf['order_by_custom'] = $conf['order_by'];
     114}
     115if (isset($conf['order_by_inside_category']))
     116{
     117  $conf['order_by_inside_category_custom'] = $conf['order_by_inside_category'];
     118}
     119
    109120include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php');
    110121
     
    143154
    144155load_plugins();
     156
     157// users can have defined a custom order pattern, incompatible with GUI form
     158if (isset($conf['order_by_custom']))
     159{
     160  $conf['order_by'] = $conf['order_by_custom'];
     161}
     162if (isset($conf['order_by_inside_category_custom']))
     163{
     164  $conf['order_by_inside_category'] = $conf['order_by_inside_category_custom'];
     165}
    145166
    146167include(PHPWG_ROOT_PATH.'include/user.inc.php');
  • trunk/include/config_default.inc.php

    r10685 r11587  
    4444// +-----------------------------------------------------------------------+
    4545
    46 // order_by : how to change the order of display for images in a category ?
    47 //
    48 // There are several fields that can order the display :
    49 //
    50 //  - date_available : the date of the adding to the gallery
    51 //  - file : the name of the file
    52 //  - id : element identifier
    53 //  - date_creation : date of element creation
    54 //
    55 // Once you've chosen which field(s) to use for ordering, you must chose the
    56 // ascending or descending order for each field.  examples :
    57 //
    58 // 1. $conf['order_by'] = " order by date_available desc, file asc";
    59 //    will order pictures by date_available descending & by filename ascending
    60 //
    61 // 2. $conf['order_by'] = " order by file asc";
    62 //    will only order pictures by file ascending without taking into account
    63 //    the date_available
    64 $conf['order_by'] = ' ORDER BY date_available DESC, file ASC, id ASC';
     46// order_by_custom and order_by_inside_category_custom : for non common pattern
     47// you can define special ORDER configuration
     48//
     49// $conf['order_by_custom'] = ' ORDER BY date_available DESC, file ASC, id ASC';
    6550
    6651// order_by_inside_category : inside a category, images can also be ordered
    6752// by rank. A manually defined rank on each image for the category.
    6853//
    69 // In addition to fields of #images table, you can use the
    70 // #image_category.rank column
    71 //
    72 // $conf['order_by_inside_category'] = ' ORDER BY rank';
    73 // will sort images by the manually defined rank of images in this album.
    74 $conf['order_by_inside_category'] = $conf['order_by'];
     54// $conf['order_by_inside_category_custom'] = $conf['order_by_custom'];
    7555
    7656// file_ext : file extensions (case sensitive) authorized
Note: See TracChangeset for help on using the changeset viewer.