Ignore:
Timestamp:
Jan 4, 2014, 4:13:08 PM (11 years ago)
Author:
mistic100
Message:

update for Piwigo 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/admin/cat_list.php

    r21658 r26442  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('SMART_PATH') or die('Hacking attempt!');
    33
    44if (isset($_GET['hide_messages']))
     
    1616$categories = array();
    1717$query = '
    18 SELECT 
     18SELECT
    1919    id,
    2020    name,
     
    5151  if (isset($output_create['error']))
    5252  {
    53     array_push($page['errors'], $output_create['error']);
     53    $page['errors'][] = $output_create['error'];
    5454  }
    5555  else
     
    6969    {
    7070      $associated_images = smart_make_associations($category['id']);
    71       array_push($page['infos'],
    72         sprintf(l10n('%d photos associated to album %s'),
    73           count($associated_images),
    74           '&laquo;'.trigger_event('render_category_name', $category['name'], 'admin_cat_list').'&raquo;'
    75           )
     71
     72      $page['infos'][] = l10n(
     73        '%d photos associated to album %s',
     74        count($associated_images),
     75        '&laquo;'.trigger_event('render_category_name', $category['name'], 'admin_cat_list').'&raquo;'
    7676        );
    7777    }
     
    8080  else
    8181  {
    82     $associated_images = smart_make_associations($_GET['smart_generate']);   
    83     array_push($page['infos'],
    84       sprintf(l10n('%d photos associated to album %s'),
    85         count($associated_images),
    86         '&laquo;'.trigger_event('render_category_name', $categories[ $_GET['smart_generate'] ]['name'], 'admin_cat_list').'&raquo;'
    87         )
     82    $associated_images = smart_make_associations($_GET['smart_generate']);
     83
     84    $page['infos'][] = l10n(
     85      '%d photos associated to album %s',
     86      count($associated_images),
     87      '&laquo;'.trigger_event('render_category_name', $categories[ $_GET['smart_generate'] ]['name'], 'admin_cat_list').'&raquo;'
    8888      );
    8989  }
    90  
     90
    9191  define('SMART_NOT_UPDATE', 1);
    9292  invalidate_user_cache();
     
    100100  'PWG_TOKEN' => get_pwg_token(),
    101101 ));
    102  
     102
    103103// retrieve all existing categories for album creation
    104104$query = '
     
    108108
    109109display_select_cat_wrapper(
    110   $query,
    111   null,
     110  $query, null,
    112111  'category_options'
    113112  );
    114  
     113
    115114if ($conf['SmartAlbums']['show_list_messages'])
    116115{
    117   array_push($page['warnings'], l10n('Only SmartAlbums are displayed on this page'));
    118   array_push($page['warnings'], sprintf(l10n('To order albums please go the main albums <a href="%s">management page</a>'), $base_url.'cat_list'));
    119   array_push($page['warnings'], '<a href="'.$self_url.'&hide_messages">['.l10n('Don\'t show this message again').']</a>');
     116  $page['warnings'][] = l10n('Only SmartAlbums are displayed on this page');
     117  $page['warnings'][] = sprintf(l10n('To order albums please go the main albums <a href="%s">management page</a>'), $base_url.'cat_list');
     118  $page['warnings'][] = '<a href="'.$self_url.'&hide_messages">['.l10n('Don\'t show this message again').']</a>';
    120119}
    121120
     
    125124
    126125$categories_count_images = array();
    127 if ( count($categories) )
     126if (count($categories))
    128127{
    129128  $query = '
    130 SELECT 
    131     category_id, 
     129SELECT
     130    category_id,
    132131    COUNT(image_id) AS total_images
    133132  FROM '.IMAGE_CATEGORY_TABLE.'
     
    154153      'U_SMART'     => $self_url.'&amp;smart_generate='.$category['id'],
    155154    );
    156  
     155
    157156  $template->append('categories', $tpl_cat);
    158157}
    159158
    160 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/cat_list.tpl');
    161 
    162 ?>
     159$template->set_filename('SmartAlbums_content', realpath(SMART_PATH . 'admin/template/cat_list.tpl'));
Note: See TracChangeset for help on using the changeset viewer.