Changeset 26399 for trunk/admin
- Timestamp:
- Jan 2, 2014, 12:51:58 PM (11 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r25975 r26399 252 252 // get the categories containing images directly 253 253 $categories_with_images = array(); 254 if ( count($categories))254 if (count($categories)) 255 255 { 256 256 $query = ' 257 SELECT DISTINCT category_id 257 SELECT 258 category_id, 259 COUNT(*) AS nb_photos 258 260 FROM '.IMAGE_CATEGORY_TABLE.' 259 WHERE category_id IN ('.implode(',', array_keys($categories)).')'; 260 $categories_with_images = array_flip( array_from_query($query, 'category_id') ); 261 GROUP BY category_id 262 ;'; 263 // WHERE category_id IN ('.implode(',', array_keys($categories)).') 264 265 $nb_photos_in = query2array($query, 'category_id', 'nb_photos'); 266 267 $query = ' 268 SELECT 269 id, 270 uppercats 271 FROM '.CATEGORIES_TABLE.' 272 ;'; 273 $all_categories = query2array($query, 'id', 'uppercats'); 274 $subcats_of = array(); 275 276 foreach (array_keys($categories) as $cat_id) 277 { 278 foreach ($all_categories as $id => $uppercats) 279 { 280 if (preg_match('/(^|,)'.$cat_id.',/', $uppercats)) 281 { 282 @$subcats_of[$cat_id][] = $id; 283 } 284 } 285 } 286 287 $nb_sub_photos = array(); 288 foreach ($subcats_of as $cat_id => $subcat_ids) 289 { 290 $nb_photos = 0; 291 foreach ($subcat_ids as $id) 292 { 293 if (isset($nb_photos_in[$id])) 294 { 295 $nb_photos+= $nb_photos_in[$id]; 296 } 297 } 298 299 $nb_sub_photos[$cat_id] = $nb_photos; 300 } 261 301 } 262 302 … … 290 330 'admin_cat_list' 291 331 ), 332 'NB_PHOTOS' => isset($nb_photos_in[$category['id']]) ? $nb_photos_in[$category['id']] : 0, 333 'NB_SUB_PHOTOS' => isset($nb_sub_photos[$category['id']]) ? $nb_sub_photos[$category['id']] : 0, 334 'NB_SUB_ALBUMS' => isset($subcats_of[$category['id']]) ? count($subcats_of[$category['id']]) : 0, 292 335 'ID' => $category['id'], 293 336 'RANK' => $category['rank']*10, … … 318 361 } 319 362 320 if ( array_key_exists($category['id'], $categories_with_images) )321 {322 $tpl_cat['U_MANAGE_ELEMENTS']=323 $base_url.'batch_manager&filter=album-'.$category['id'];324 }325 326 363 $template->append('categories', $tpl_cat); 327 364 } -
trunk/admin/themes/default/template/cat_list.tpl
r24985 r26399 117 117 <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"> 118 118 <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong> 119 <span class="albumInfos"><span class="userSeparator">·</span> {$category.NB_PHOTOS|translate_dec:'%d photo':'%d photos'} <span class="userSeparator">·</span> {$category.NB_SUB_PHOTOS|translate_dec:'%d photo':'%d photos'} {$category.NB_SUB_ALBUMS|translate_dec:'in %d sub-album':'in %d sub-albums'}</span> 119 120 </p> 120 121 … … 123 124 <p class="albumActions"> 124 125 <a href="{$category.U_EDIT}"><span class="icon-pencil"></span>{'Edit'|@translate}</a> 125 {if isset($category.U_MANAGE_ELEMENTS) }126 | <a href="{$category.U_MANAGE_ELEMENTS}"><span class="icon-picture"></span>{'manage album photos'|@translate}</a>127 {/if}128 126 | <a href="{$category.U_CHILDREN}"><span class="icon-sitemap"></span>{'manage sub-albums'|@translate}</a> 129 127 {if isset($category.U_SYNC) } -
trunk/admin/themes/default/theme.css
r26230 r26399 1065 1065 1066 1066 FORM#categoryOrdering p.albumTitle {margin:0;} 1067 FORM#categoryOrdering p.albumActions {visibility:hidden; margin:0}1068 FORM#categoryOrdering .categoryLi:hover p.albumActions {visibility:visible;}1067 FORM#categoryOrdering p.albumActions, FORM#categoryOrdering span.albumInfos {visibility:hidden; margin:0} 1068 FORM#categoryOrdering .categoryLi:hover p.albumActions, FORM#categoryOrdering .categoryLi:hover span.albumInfos {visibility:visible;} 1069 1069 1070 1070 .showCreateAlbum {text-align:left; margin:0 1em 1em 1em;line-height:22px;}
Note: See TracChangeset
for help on using the changeset viewer.