Ignore:
Timestamp:
Jun 16, 2011, 12:54:59 PM (13 years ago)
Author:
mistic100
Message:

add a list of all SmartAlbums

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/include/init_cat_list.php

    r11376 r11392  
    3131;';
    3232 
    33   $result = pwg_query($query);
    34   $smart_cats = array();
    35   while ($cat = pwg_db_fetch_assoc($result))
    36   {
    37     $smart_cats[$cat['id']] = trigger_event('render_category_name', $cat['name']);
    38   }
    39  
     33  $smart_cats = hash_from_query($query, 'id');
    4034  $smart_count = count($smart_cats);
    4135 
     
    4539    if ($_GET['smart_generate'] == 'all')
    4640    {
    47       foreach ($smart_cats as $cat => $name)
     41      foreach ($smart_cats as $category)
    4842      {
    49         $associated_images = smart_make_associations($cat);
     43        $associated_images = smart_make_associations($category['id']);
    5044        array_push(
    5145          $page['infos'],
    5246          l10n_args(get_l10n_args(
    5347            '%d photos associated to album «%s»',
    54             array(count($associated_images), $name)
     48            array(
     49              count($associated_images),
     50              trigger_event(
     51                'render_category_name',
     52                $category['name'],
     53                'admin_cat_list'
     54                )
     55              )
    5556            ))
    5657          );
     
    6566        l10n_args(get_l10n_args(
    6667          '%d photos associated to album «%s»',
    67           array(count($associated_images), $smart_cats[$_GET['smart_generate']])
     68          array(
     69            count($associated_images),
     70            trigger_event(
     71              'render_category_name',
     72              $smart_cats[$_GET['smart_generate']]['name'],
     73              'admin_cat_list'
     74              )
     75            )
    6876          ))
    6977        );
     
    98106  $replacement[0] = '
    99107{if isset($SMART_URL[$category.ID])}
    100         <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\'regenerate photos list\'|@translate}"></a></li>
     108        <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\'Regenerate photos list of this SmartAlbum\'|@translate}"></a></li>
    101109{/if}'
    102110.$search[0];
Note: See TracChangeset for help on using the changeset viewer.