Index: /trunk/admin/cat_modify.php =================================================================== --- /trunk/admin/cat_modify.php (revision 9050) +++ /trunk/admin/cat_modify.php (revision 9051) @@ -45,24 +45,4 @@ if (isset($_POST['submit'])) { - $image_order = null; - if ( !isset($_POST['image_order_default']) ) - { - for ($i=1; $i<=3; $i++) - { - if ( !empty($_POST['order_field_'.$i]) ) - { - if (! empty($image_order) ) - { - $image_order .= ','; - } - $image_order .= $_POST['order_field_'.$i]; - if ($_POST['order_direction_'.$i]=='DESC') - { - $image_order .= ' DESC'; - } - } - } - } - $data = array( @@ -73,5 +53,4 @@ $conf['allow_html_descriptions'] ? @$_POST['comment'] : strip_tags(@$_POST['comment']), - 'image_order' => $image_order, ); @@ -87,12 +66,4 @@ // retrieve cat infos before continuing (following updates are expensive) $cat_info = get_cat_info($_GET['cat_id']); - - if (isset($_POST['image_order_subcats'])) - { - $query = ' -UPDATE '.CATEGORIES_TABLE.' SET image_order='.(isset($image_order) ? 'NULL':'\''.$image_order.'\'').' - WHERE uppercats LIKE \''.$cat_info['uppercats'].',%\''; - pwg_query($query); - } if ($cat_info['visible'] != get_boolean( $_POST['visible'] ) ) @@ -245,7 +216,4 @@ 'CAT_COMMENTABLE' => boolean_to_string($category['commentable']), - 'IMG_ORDER_DEFAULT' => empty($category['image_order']) ? - 'checked="checked"' : '', - 'U_JUMPTO' => make_index_url( array( @@ -278,9 +246,10 @@ $base_url.'batch_manager&cat='.$category['id'] ); - $template->assign( - 'U_MANAGE_RANKS', - $base_url.'element_set_ranks&cat_id='.$category['id'] - ); -} +} + +$template->assign( + 'U_MANAGE_RANKS', + $base_url.'element_set_ranks&cat_id='.$category['id'] + ); if ($category['is_virtual']) @@ -303,53 +272,4 @@ ); } - -// image order management - -$sort_fields = array( - '' => '', - 'date_creation' => l10n('Creation date'), - 'date_available' => l10n('Post date'), - 'average_rate' => l10n('Average rate'), - 'hit' => l10n('Most visited'), - 'file' => l10n('File name'), - 'id' => 'Id', - 'rank' => l10n('Rank'), - ); - -$sort_directions = array( - 'ASC' => l10n('ascending'), - 'DESC' => l10n('descending'), - ); - -$template->assign( 'image_order_field_options', $sort_fields); -$template->assign( 'image_order_direction_options', $sort_directions); - -$matches = array(); -if ( !empty( $category['image_order'] ) ) -{ - preg_match_all('/([a-z_]+) *(?:(asc|desc)(?:ending)?)? *(?:, *|$)/i', - $category['image_order'], $matches); -} - -for ($i=0; $i<3; $i++) // 3 fields -{ - $tpl_image_order_select = array( - 'ID' => $i+1, - 'FIELD' => array(''), - 'DIRECTION' => array('ASC'), - ); - - if ( isset($matches[1][$i]) ) - { - $tpl_image_order_select['FIELD'] = array($matches[1][$i]); - } - - if (isset($matches[2][$i]) and strcasecmp($matches[2][$i],'DESC')==0) - { - $tpl_image_order_select['DIRECTION'] = array('DESC'); - } - $template->append( 'image_orders', $tpl_image_order_select); -} - // representant management Index: /trunk/admin/element_set_ranks.php =================================================================== --- /trunk/admin/element_set_ranks.php (revision 9050) +++ /trunk/admin/element_set_ranks.php (revision 9051) @@ -90,15 +90,18 @@ if (isset($_POST['submit'])) { - asort($_POST['rank_of_image'], SORT_NUMERIC); + if (isset($_POST['rank_of_image'])) + { + asort($_POST['rank_of_image'], SORT_NUMERIC); - save_images_order( - $page['category_id'], - array_keys($_POST['rank_of_image']) - ); - - array_push( - $page['infos'], - l10n('Images manual order was saved') - ); + save_images_order( + $page['category_id'], + array_keys($_POST['rank_of_image']) + ); + + array_push( + $page['infos'], + l10n('Images manual order was saved') + ); + } $image_order = null; @@ -135,4 +138,17 @@ WHERE id='.$page['category_id']; pwg_query($query); + + if (isset($_POST['image_order_subcats'])) + { + $cat_info = get_cat_info($page['category_id']); + + $query = ' +UPDATE '.CATEGORIES_TABLE.' + SET image_order = '.(isset($image_order) ? '\''.$image_order.'\'' : 'NULL').' + WHERE uppercats LIKE \''.$cat_info['uppercats'].',%\''; + pwg_query($query); + } + + array_push($page['infos'], l10n('Your configuration settings are saved')); } Index: /trunk/admin/themes/clear/theme.css =================================================================== --- /trunk/admin/themes/clear/theme.css (revision 9050) +++ /trunk/admin/themes/clear/theme.css (revision 9051) @@ -262,2 +262,6 @@ .languageName {color:black;} .languageDefault {background-color:#dbe8f3;} + +UL.thumbnails li.rank-of-image { + background-color: #ddd; +} Index: /trunk/admin/themes/default/template/cat_modify.tpl =================================================================== --- /trunk/admin/themes/default/template/cat_modify.tpl (revision 9050) +++ /trunk/admin/themes/default/template/cat_modify.tpl (revision 9051) @@ -15,6 +15,6 @@ {if isset($U_MANAGE_ELEMENTS) }
Index: /trunk/admin/themes/default/template/element_set_ranks.tpl =================================================================== --- /trunk/admin/themes/default/template/element_set_ranks.tpl (revision 9050) +++ /trunk/admin/themes/default/template/element_set_ranks.tpl (revision 9051) @@ -37,10 +37,11 @@
{'No photo in this album'|@translate}