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

update for Piwigo 2.6

Location:
extensions/SmartAlbums/admin
Files:
1 deleted
7 edited

Legend:

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

    r21358 r26442  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    24 if(!defined("PHPWG_ROOT_PATH")) die ("Hacking attempt!");
     2defined('SMART_PATH') or die('Hacking attempt!');
    253
    264// +-----------------------------------------------------------------------+
     
    3311
    3412check_input_parameter('cat_id', $_GET, false, PATTERN_ID);
    35 
    36 $admin_album_base_url = get_root_url().'admin.php?page=album-'.$_GET['cat_id'];
    37 $self_url = SMART_ADMIN.'-album&amp;cat_id='.$_GET['cat_id'];
     13$cat_id = $_GET['cat_id'];
     14
     15$admin_album_base_url = get_root_url().'admin.php?page=album-'.$cat_id;
     16$self_url = SMART_ADMIN.'-album&amp;cat_id='.$cat_id;
    3817
    3918$query = '
    4019SELECT *
    4120  FROM '.CATEGORIES_TABLE.'
    42   WHERE id = '.$_GET['cat_id'].'
     21  WHERE id = '.$cat_id.'
    4322;';
    4423$category = pwg_db_fetch_assoc(pwg_query($query));
     
    4827  die("unknown album");
    4928}
     29
     30// category must be virtual
     31if ($category['dir'] != NULL)
     32{
     33  die("physical album");
     34}
     35
    5036
    5137// +-----------------------------------------------------------------------+
     
    6046
    6147
    62 $cat_id = $_GET['cat_id'];
    63 
    64 // category must be virtual
    65 if ($category['dir'] != NULL)
    66 {
    67   die("physical album");
    68 }
    69 
    7048// +-----------------------------------------------------------------------+
    7149// | Save Filters                                                          |
     
    7856    var_dump($_POST['filters']);
    7957  }
    80  
     58
    8159  // test if it was a Smart Album
    8260  $query = '
    83 SELECT DISTINCT category_id 
    84   FROM '.CATEGORY_FILTERS_TABLE.' 
     61SELECT DISTINCT category_id
     62  FROM '.CATEGORY_FILTERS_TABLE.'
    8563  WHERE category_id = '.$cat_id.'
    8664;';
    8765  $was_smart = pwg_db_num_rows(pwg_query($query));
    88  
     66
    8967  /* this album is no longer a SmartAlbum */
    90   if ( $was_smart AND !isset($_POST['is_smart']) )
     68  if ($was_smart and !isset($_POST['is_smart']))
    9169  {
    9270    pwg_query('DELETE FROM '.IMAGE_CATEGORY_TABLE.' WHERE category_id = '.$cat_id.' AND smart = true;');
    9371    pwg_query('DELETE FROM '.CATEGORY_FILTERS_TABLE.' WHERE category_id = '.$cat_id.';');
     72
    9473    set_random_representant(array($cat_id));
     74
     75    define('SMART_NOT_UPDATE', 1);
    9576    invalidate_user_cache();
    9677  }
    9778  /* no filter selected */
    98   else if ( isset($_POST['is_smart']) AND empty($_POST['filters']) )
    99   {
    100     array_push($page['errors'], l10n('No filter selected'));
     79  else if (isset($_POST['is_smart']) and empty($_POST['filters']))
     80  {
     81    $page['errors'][] = l10n('No filter selected');
    10182  }
    10283  /* everything is fine */
    103   else if ( isset($_POST['is_smart']) )
     84  else if (isset($_POST['is_smart']))
    10485  {
    10586    pwg_query('DELETE FROM '.CATEGORY_FILTERS_TABLE.' WHERE category_id = '.$cat_id.';');
    106    
     87
    10788    $inserts = array();
    10889    foreach ($_POST['filters'] as $filter)
     
    11495      }
    11596    }
    116    
     97
    11798    mass_inserts(
    118       CATEGORY_FILTERS_TABLE, 
    119       array('category_id', 'type', 'cond', 'value'), 
     99      CATEGORY_FILTERS_TABLE,
     100      array('category_id', 'type', 'cond', 'value'),
    120101      $inserts,
    121102      array('ignore'=>true)
    122103      );
    123    
     104
    124105    $associated_images = smart_make_associations($cat_id);
    125106    $template->assign('IMAGE_COUNT', l10n_dec('%d photo', '%d photos', count($associated_images)));
    126    
    127     array_push($page['infos'], sprintf(l10n('%d photos associated to album %s'), count($associated_images), ''));
    128    
     107
     108    $page['infos'][] = l10n('%d photos associated to album %s', count($associated_images), '');
     109
    129110    define('SMART_NOT_UPDATE', 1);
    130111    invalidate_user_cache();
     
    225206/* get filters for this album */
    226207$query = '
    227 SELECT * 
    228   FROM '.CATEGORY_FILTERS_TABLE.' 
     208SELECT *
     209  FROM '.CATEGORY_FILTERS_TABLE.'
    229210  WHERE category_id = '.$cat_id.'
    230   ORDER BY 
    231     type ASC, 
     211  ORDER BY
     212    type ASC,
    232213    cond ASC
    233214;';
     
    250231  WHERE id IN('.$filter['value'].')
    251232;';
    252     $filter['value'] = get_taglist($query); 
    253   }
    254  
     233    $filter['value'] = get_taglist($query);
     234  }
     235
    255236  $template->append('filters', $filter);
    256237}
     
    260241$template->assign('format_options', array(
    261242  'portrait' => l10n('Portrait'),
    262   'square'   => l10n('Square'),
     243  'square'   => l10n('square'),
    263244  'lanscape' => l10n('Landscape'),
    264245  'panorama' => l10n('Panorama'),
     
    274255/* all albums */
    275256$query = '
    276 SELECT 
    277     id, 
    278     name, 
    279     uppercats, 
     257SELECT
     258    id,
     259    name,
     260    uppercats,
    280261    global_rank
    281262  FROM '.CATEGORIES_TABLE.'
     
    303284while ($row = pwg_db_fetch_assoc($result))
    304285{
    305   $widths[] = $row['width'];
    306   $heights[] = $row['height'];
    307   $ratios[] = floor($row['width'] * 100 / $row['height']) / 100;
     286  if ($row['width']>0 && $row['height']>0)
     287  {
     288    $widths[] = $row['width'];
     289    $heights[] = $row['height'];
     290    $ratios[] = floor($row['width'] / $row['height'] * 100) / 100;
     291  }
    308292}
    309293
     
    354338}
    355339
    356 foreach (array_keys($ratio_categories) as $ratio_category)
    357 {
    358   if (count($ratio_categories[$ratio_category]) > 0)
    359   {
    360     $dimensions['ratio_'.$ratio_category] = array(
    361       'min' => $ratio_categories[$ratio_category][0],
    362       'max' => $ratio_categories[$ratio_category][count($ratio_categories[$ratio_category]) - 1]
     340foreach ($ratio_categories as $ratio_name => $ratio_values)
     341{
     342  if (count($ratio_values) > 0)
     343  {
     344    $dimensions['ratio_'.$ratio_name] = array(
     345      'min' => $ratio_values[0],
     346      'max' => array_pop($ratio_values),
    363347      );
    364348  }
     
    371355{
    372356  $query = '
    373 SELECT count(1) 
    374   FROM '.IMAGE_CATEGORY_TABLE.' 
    375   WHERE 
    376     category_id = '.$cat_id.' 
     357SELECT count(1)
     358  FROM '.IMAGE_CATEGORY_TABLE.'
     359  WHERE
     360    category_id = '.$cat_id.'
    377361    AND smart = true
    378362';
     
    396380));
    397381
    398 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/album.tpl');
    399 
    400 ?>
     382$template->set_filename('SmartAlbums_content', realpath(SMART_PATH . 'admin/template/album.tpl'));
  • 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'));
  • extensions/SmartAlbums/admin/config.php

    r19446 r26442  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('SMART_PATH') or die('Hacking attempt!');
    33
    4 // Enregistrement de la configuration
    54if (isset($_POST['submit']))
    65{
    7   if ( $_POST['update_timeout'] == 0 or !preg_match('#^[0-9.]+$#', $_POST['update_timeout']) )
     6  if ($_POST['update_timeout'] == 0 or !preg_match('#^[0-9.]+$#', $_POST['update_timeout']))
    87  {
    9     array_push($page['errors'], l10n('Invalid number of days'));
     8    $page['errors'][] = l10n('Invalid number of days');
    109    $_POST['update_timeout'] = $conf['SmartAlbums']['update_timeout'];
    1110  }
    12    
     11
    1312  $conf['SmartAlbums'] = array(
    1413    'show_list_messages' => $conf['SmartAlbums']['show_list_messages'],
     
    1918    'smart_is_forbidden' => isset($_POST['smart_is_forbidden']),
    2019    );
    21  
     20
    2221  conf_update_param('SmartAlbums', serialize($conf['SmartAlbums']));
    23   array_push($page['infos'], l10n('Information data registered in database'));
     22  $page['infos'][] = l10n('Information data registered in database');
    2423}
    2524
    2625$template->assign($conf['SmartAlbums']);
    2726
    28 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/config.tpl');
    29 
    30 ?>
     27$template->set_filename('SmartAlbums_content', realpath(SMART_PATH . 'admin/template/config.tpl'));
  • extensions/SmartAlbums/admin/template/album.tpl

    r19722 r26442  
    1 {combine_css path=$SMART_PATH|@cat:"admin/template/style.css"}
    2 {combine_script id='sprintf' load='footer' path=$SMART_PATH|@cat:"admin/template/sprintf.js"}
     1{combine_css path=$SMART_PATH|cat:'admin/template/style.css'}
    32{include file='include/datepicker.inc.tpl'}
     3{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
     4
     5{combine_css path='themes/default/js/plugins/jquery.tokeninput.css'}
    46{combine_script id='jquery.tokeninput' load='footer' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'}
    5 {combine_css path="themes/default/js/plugins/chosen.css"}
     7
     8{combine_css path='themes/default/js/plugins/chosen.css'}
    69{combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'}
    7 {combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
     10
     11{combine_css path='themes/default/js/ui/theme/jquery.ui.slider.css'}
    812{combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
    913
    10 {footer_script}{literal}
    11 var count=0;
    12 var limit_count=0;
    13 var level_count=0;
    14 
    15 // MAIN EVENT HANDLERS
    16 $('#addFilter').change(function() {
    17   add_filter($(this).attr('value'));
    18   $(this).attr('value', '-1');
    19 });
    20  
    21 $('#removeFilters').click(function() {
    22   $('#filtersList li').each(function() {
    23     $(this).remove();
     14{*combine_script id='smartalbums.filters' require='common,datepicker.js,jquery.tokeninput,jquery.chosen,jquery.ui.slider'
     15  path=$SMART_PATH|cat:'admin/template/filters.js' load='footer' template=true*}
     16
     17{footer_script require='jquery'}
     18var addFilter = (function($){
     19  var count=0,
     20      limit_count=0,
     21      level_count=0;
     22
     23  // MAIN EVENT HANDLERS
     24  $('#addFilter').change(function() {
     25    if ($(this).val() != -1) {
     26      add_filter($(this).val());
     27      $(this).val(-1);
     28    }
    2429  });
    25  
    26   limit_level=0;
    27   level_count=0;
    28   return false;
    29 });
    30 
    31 $('input[name="is_smart"]').change(function() {
    32   $('#SmartAlbum_options').toggle();
    33   $('input[name="countImages"]').toggle();
    34   $('.count_images_wrapper').toggle();
    35 });
    36 
    37 $('input[name="countImages"]').click(function() {
    38   countImages($("#smart"));
    39   return false;
    40 });
    41 
    42 
    43 // ADD FILTER FUNCTIONS
    44 function add_filter(type, cond, value) {
    45   count++;
    46  
    47   content = $("#filtersRepo #filter_"+type).html().replace(/iiii/g, count);
    48   $block = $(content);
    49   $("#filtersList").append($block);
    50  
    51   if (cond) {
    52     select_cond($block, type, cond);
    53   }
    54  
    55   if (value) {
    56     if (type == "tags") {
    57       $block.find(".filter-value .tagSelect").html(value);
    58     }
    59     else if (type == "album") {
    60       select_options($block, value);
    61     }
    62     else if (type == "level") {
    63       select_options($block, value);
    64     }
    65     else if (type != "dimensions") {
    66       $block.find(".filter-value input").val(value);
    67     }
    68   }
    69  
    70   init_jquery_handlers($block);
    71  
    72   if (type == "dimensions") {
    73     select_dimensions($block, cond, value);
    74   }
    75  
    76   if (type == 'limit') {
    77     limit_count=1;
    78     $("#addFilter option[value='limit']").attr('disabled','disabled');
    79   }
    80   else if (type == 'level') {
    81     level_count=1;
    82     $("#addFilter option[value='level']").attr('disabled','disabled');
    83   }
    84 }
    85 
    86 function select_cond($block, type, cond) {
    87   $block.find(".filter-cond option").removeAttr('selected');
    88   $block.find(".filter-cond option[value='"+cond+"']").attr('selected', 'selected');
    89 }
    90 
    91 function select_dimensions($block, cond, value) {
    92   if (!cond) cond = 'width';
    93  
    94   $block.find(".filter-value span:not(.filter_dimension_info)").hide();
    95   $block.find(".filter-value .dimension_"+cond).show();
    96  
    97   if (value) {
    98     values = value.split(',');
    99   }
    100   else {
    101     values = $block.find(".filter_dimension_"+cond+"_slider").slider("values");
    102   }
    103   $block.find(".filter_dimension_"+cond+"_slider").slider("values", values);
    104 }
    105 
    106 function select_options($block, value) { 
    107   values = value.split(',');
    108   for (j in values) {
    109     $block.find(".filter-value option[value='"+ values[j] +"']").attr('selected', 'selected');
    110   }
    111 }
    112 
    113 
    114 // DECLARE JQUERY PLUGINS AND VERSATILE HANDLERS
    115 function init_jquery_handlers($block) {
    116   // remove filter
    117   $block.find(".removeFilter").click(function() {
    118     type = $(this).next("input").val();
     30
     31  $('#removeFilters').click(function() {
     32    $('#filtersList li').each(function() {
     33      $(this).remove();
     34    });
     35
     36    limit_level=0;
     37    level_count=0;
     38    return false;
     39  });
     40
     41  $('input[name="is_smart"]').change(function() {
     42    $('#SmartAlbum_options').toggle();
     43    $('input[name="countImages"]').toggle();
     44    $('.count_images_wrapper').toggle();
     45  });
     46
     47  $('input[name="countImages"]').click(function() {
     48    countImages($("#smart"));
     49    return false;
     50  });
     51
     52
     53  // ADD FILTER FUNCTIONS
     54  function add_filter(type, cond, value) {
     55    count++;
     56
     57    var content = $("#filtersRepo #filter_"+type).html().replace(/iiii/g, count);
     58    $block = $($.parseHTML(content)).appendTo("#filtersList");
     59
     60    if (cond) {
     61      select_cond($block, type, cond);
     62    }
     63
     64    if (value) {
     65      if (type == "tags") {
     66        $block.find(".filter-value .tagSelect").html(value);
     67      }
     68      else if (type == "album") {
     69        select_options($block, value);
     70      }
     71      else if (type == "level") {
     72        select_options($block, value);
     73      }
     74      else if (type != "dimensions") {
     75        $block.find(".filter-value input").val(value);
     76      }
     77    }
     78
     79    init_jquery_handlers($block);
     80
     81    if (type == "dimensions") {
     82      select_dimensions($block, cond, value);
     83    }
     84
    11985    if (type == 'limit') {
    12086      limit_count=1;
    121       $("#addFilter option[value='limit']").removeAttr('disabled');
     87      $("#addFilter option[value='limit']").attr('disabled','disabled');
    12288    }
    12389    else if (type == 'level') {
    12490      level_count=1;
    125       $("#addFilter option[value='level']").removeAttr('disabled');
    126     }
    127    
    128     $(this).parents('li').remove();
    129     return false;
    130   });
    131 
    132   // date filter
    133   if ($block.hasClass('filter_date')) {
    134     $block.find("input[type='text']").each(function() {
    135       $(this).datepicker({dateFormat:'yy-mm-dd', firstDay:1});
     91      $("#addFilter option[value='level']").attr('disabled','disabled');
     92    }
     93  }
     94
     95  function select_cond($block, type, cond) {
     96    $block.find(".filter-cond option").removeAttr('selected');
     97    $block.find(".filter-cond option[value='"+cond+"']").attr('selected', 'selected');
     98  }
     99
     100  function select_dimensions($block, cond, value) {
     101    console.log($block, cond, value);
     102    cond = cond || 'width';
     103
     104    $block.find(">.filter-value>span").hide();
     105    $block.find(".dimension_"+cond).show();
     106
     107    if (value) {
     108      values = value.split(',');
     109    }
     110    else {
     111      values = $block.find(".filter_dimension_"+cond+"_slider").slider("values");
     112    }
     113    $block.find(".filter_dimension_"+cond+"_slider").slider("values", values);
     114  }
     115
     116  function select_options($block, value) {
     117    values = value.split(',');
     118    for (j in values) {
     119      $block.find(".filter-value option[value='"+ values[j] +"']").attr('selected', 'selected');
     120    }
     121  }
     122
     123
     124  // DECLARE JQUERY PLUGINS AND VERSATILE HANDLERS
     125  function init_jquery_handlers($block) {
     126    // remove filter
     127    $block.find(".removeFilter").click(function() {
     128      type = $(this).next("input").val();
     129      if (type == 'limit') {
     130        limit_count=1;
     131        $("#addFilter option[value='limit']").removeAttr('disabled');
     132      }
     133      else if (type == 'level') {
     134        level_count=1;
     135        $("#addFilter option[value='level']").removeAttr('disabled');
     136      }
     137
     138      $(this).parents('li').remove();
     139      return false;
    136140    });
    137   }
    138 
    139   // tags filter
    140   if ($block.hasClass('filter_tags')) {
    141     $block.find(".tagSelect").tokenInput(
    142     {/literal}
    143       [{foreach from=$all_tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],
    144       {ldelim}
    145         hintText: '{'Type in a search term'|@translate}',
    146         noResultsText: '{'No results'|@translate}',
    147         searchingText: '{'Searching...'|@translate}',
    148         animateDropdown: false,
    149         preventDuplicates: true,
    150         allowCreation: false
    151     {literal}
    152     });
    153   }
    154  
    155   // album filter
    156   if ($block.hasClass('filter_album')) {
    157     $block.find(".albumSelect").chosen();
    158   }
    159  
    160   // dimension filter
    161   if ($block.hasClass('filter_dimensions')) {
    162     $block.find(".filter-cond select").change(function() {
    163       select_dimensions($block, $(this).attr("value"));
    164     });
    165     {/literal}
    166    
    167     $block.find(".filter_dimension_width_slider").slider({ldelim}
    168       range: true,
    169       min: {$dimensions.bounds.min_width},
    170       max: {$dimensions.bounds.max_width},
    171       values: [{$dimensions.bounds.min_width}, {$dimensions.bounds.max_width}],
    172       slide: function(event, ui) {ldelim}
    173         change_dimension_info($block, ui.values, "{'between %d and %d pixels'|@translate}");
    174       },
    175       change: function(event, ui) {ldelim}
    176         change_dimension_info($block, ui.values, "{'between %d and %d pixels'|@translate}");
    177       }
    178     });
    179    
    180     $block.find(".filter_dimension_height_slider").slider({ldelim}
    181       range: true,
    182       min: {$dimensions.bounds.min_height},
    183       max: {$dimensions.bounds.max_height},
    184       values: [{$dimensions.bounds.min_height}, {$dimensions.bounds.max_height}],
    185       slide: function(event, ui) {ldelim}
    186         change_dimension_info($block, ui.values, "{'between %d and %d pixels'|@translate}");
    187       },
    188       change: function(event, ui) {ldelim}
    189         change_dimension_info($block, ui.values, "{'between %d and %d pixels'|@translate}");
    190       }
    191     });
    192    
    193     $block.find(".filter_dimension_ratio_slider").slider({ldelim}
    194       range: true,
    195       step: 0.01,
    196       min: {$dimensions.bounds.min_ratio},
    197       max: {$dimensions.bounds.max_ratio},
    198       values: [{$dimensions.bounds.min_ratio}, {$dimensions.bounds.max_ratio}],
    199       slide: function(event, ui) {ldelim}
    200         change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|@translate}");
    201       },
    202       change: function(event, ui) {ldelim}
    203         change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|@translate}");
    204       }
    205     });
    206     {literal}
    207    
    208     $block.find("a.dimensions-choice").click(function() {
    209       $block.find(".filter_dimension_"+ $(this).data("type") +"_slider").slider("values",
    210         [$(this).data("min"), $(this).data("max")]
     141
     142    // date filter
     143    if ($block.hasClass('filter_date')) {
     144      $block.find("input[type='text']").each(function() {
     145        $(this).datepicker({
     146          dateFormat:'yy-mm-dd',
     147          firstDay:1
     148        });
     149      });
     150    }
     151
     152    // tags filter
     153    if ($block.hasClass('filter_tags')) {
     154      $block.find(".tagSelect").tokenInput(
     155        [{foreach from=$all_tags item=tag name=tags}{ name:"{$tag.name|escape:javascript}", id:"{$tag.id}" }{if !$smarty.foreach.tags.last},{/if}{/foreach}],
     156        {
     157          hintText: '{'Type in a search term'|translate}',
     158          noResultsText: '{'No results'|translate}',
     159          searchingText: '{'Searching...'|translate}',
     160          animateDropdown: false,
     161          preventDuplicates: true,
     162          allowFreeTagging: false
     163        }
    211164      );
    212     });
    213   }
    214 }
    215 
    216 
    217 // GENERAL FUNCTIONS
    218 function change_dimension_info($block, values, text) {
    219   $block.find("input[name$='[value][min]']").val(values[0]);
    220   $block.find("input[name$='[value][max]']").val(values[1]);
    221   $block.find(".filter_dimension_info").html(sprintf(text, values[0], values[1]));
    222 }
    223 
    224 function countImages(form) {
    225 {/literal}
    226   jQuery.post("{$COUNT_SCRIPT_URL}", 'cat_id={$CAT_ID}&'+form.serialize(),
    227 {literal}
    228     function success(data) {
    229       jQuery('.count_images_wrapper').html(data);
    230     }
    231   );
    232 }
    233 
    234 function doBlink(obj,start,finish) {
    235   jQuery(obj).fadeOut(400).fadeIn(400);
    236   if(start!=finish) {
    237     doBlink(obj,start+1,finish);
    238   } else {
    239     jQuery(obj).fadeOut(400);
    240   }
    241 }
    242 {/literal}
    243 
    244 {if isset($new_smart)}doBlink('.new_smart', 0, 3);{/if}
     165    }
     166
     167    // album filter
     168    if ($block.hasClass('filter_album')) {
     169      $block.find(".albumSelect").chosen();
     170    }
     171
     172    // dimension filter
     173    if ($block.hasClass('filter_dimensions')) {
     174      $block.find(".filter-cond select").change(function() {
     175        select_dimensions($block, $(this).val());
     176      });
     177
     178      $block.find(".filter_dimension_width_slider").slider({
     179        range: true,
     180        min: {$dimensions.bounds.min_width},
     181        max: {$dimensions.bounds.max_width},
     182        values: [{$dimensions.bounds.min_width}, {$dimensions.bounds.max_width}],
     183        slide: function(event, ui) {
     184          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
     185        },
     186        change: function(event, ui) {
     187          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
     188        }
     189      });
     190
     191      $block.find(".filter_dimension_height_slider").slider({
     192        range: true,
     193        min: {$dimensions.bounds.min_height},
     194        max: {$dimensions.bounds.max_height},
     195        values: [{$dimensions.bounds.min_height}, {$dimensions.bounds.max_height}],
     196        slide: function(event, ui) {
     197          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
     198        },
     199        change: function(event, ui) {
     200          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
     201        }
     202      });
     203
     204      $block.find(".filter_dimension_ratio_slider").slider({
     205        range: true,
     206        step: 0.01,
     207        min: {$dimensions.bounds.min_ratio},
     208        max: {$dimensions.bounds.max_ratio},
     209        values: [{$dimensions.bounds.min_ratio}, {$dimensions.bounds.max_ratio}],
     210        slide: function(event, ui) {
     211          change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|translate}");
     212        },
     213        change: function(event, ui) {
     214          change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|translate}");
     215        }
     216      });
     217
     218      $block.find("a.dimensions-choice").click(function() {
     219        $block.find(".filter_dimension_"+ $(this).data("type") +"_slider").slider("values",
     220          [$(this).data("min"), $(this).data("max")]
     221        );
     222      });
     223    }
     224  }
     225
     226
     227  // GENERAL FUNCTIONS
     228  function change_dimension_info($block, values, text) {
     229    $block.find("input[name$='[value][min]']").val(values[0]);
     230    $block.find("input[name$='[value][max]']").val(values[1]);
     231    $block.find(".filter_dimension_info").html(sprintf(text, values[0], values[1]));
     232  }
     233
     234  function countImages(form) {
     235    jQuery.post("{$COUNT_SCRIPT_URL}", 'cat_id={$CAT_ID}&'+form.serialize(),
     236      function success(data) {
     237        jQuery('.count_images_wrapper').html(data);
     238      }
     239    );
     240  }
     241
     242
     243  {if isset($new_smart)}
     244  function doBlink(obj,start,finish) {
     245    jQuery(obj).fadeOut(400).fadeIn(400);
     246    if(start!=finish) {
     247      doBlink(obj,start+1,finish);
     248    }
     249    else {
     250      jQuery(obj).fadeOut(400);
     251    }
     252  }
     253
     254  doBlink('.new_smart', 0, 3);
     255  {/if}
     256
     257  return add_filter; // expose add_filter method
     258}(jQuery));
    245259{/footer_script}
    246260
    247261
    248262<div class="titrePage">
    249   <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> &#8250; {'Edit album'|@translate} [SmartAlbum]</h2>
     263  <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> &#8250; {'Edit album'|translate} [SmartAlbum]</h2>
    250264</div>
    251265
    252266<noscript>
    253 <div class="errors"><ul><li>JavaScript required!</li></ul></div>
     267  <div class="errors"><ul><li>JavaScript required!</li></ul></div>
    254268</noscript>
    255269
    256270<div id="batchManagerGlobal">
    257271<form action="{$F_ACTION}" method="POST" id="smart">
    258   <p style="text-align:left;"><label><input type="checkbox" name="is_smart" {if isset($filters) OR isset($new_smart)}checked="checked"{/if}/> {'This album is a SmartAlbum'|@translate}</label></p>
     272  <p style="text-align:left;"><label><input type="checkbox" name="is_smart" {if isset($filters) OR isset($new_smart)}checked="checked"{/if}/> {'This album is a SmartAlbum'|translate}</label></p>
    259273
    260274  <fieldset id="SmartAlbum_options" style="margin-top:1em;{if !isset($filters) AND !isset($new_smart)}display:none;{/if}">
    261     <legend>{'Filters'|@translate}</legend>
    262      
     275    <legend>{'Filters'|translate}</legend>
     276
    263277    <ul id="filtersList">
    264278    {foreach from=$filters item=filter}{strip}
     
    268282        {assign var='value' value=$filter.value}
    269283      {/if}
    270      
     284
    271285      {if $filter.type == 'limit'}
    272286        {footer_script}
     
    280294        {/footer_script}
    281295      {/if}
    282      
    283       {footer_script}add_filter('{$filter.type}', '{$filter.cond}', '{$value|escape:javascript}');{/footer_script}
     296
     297      {footer_script}addFilter('{$filter.type}', '{$filter.cond}', '{$value|escape:javascript}');{/footer_script}
    284298    {/strip}{/foreach}
    285299    </ul>
    286    
     300
    287301    <div>
    288       <b>{'Mode'|@translate} :</b>
     302      <b>{'Mode'|translate} :</b>
    289303      <label><input type="radio" name="filters[0][value]" value="and" {if $filter_mode=='and'}checked="checked"{/if}> AND</label>
    290304      <label><input type="radio" name="filters[0][value]" value="or" {if $filter_mode=='or'}checked="checked"{/if}> OR</label>
     
    292306      <input type="hidden" name="filters[0][cond]" value="mode">
    293307    </div>
    294    
     308
    295309    <p class="actionButtons">
    296310      <select id="addFilter">
    297         <option value="-1">{'Add a filter'|@translate}</option>
     311        <option value="-1">{'Add a filter'|translate}</option>
    298312        <option disabled="disabled">------------------</option>
    299         <option value="tags">{'Tags'|@translate}</option>
    300         <option value="date">{'Date'|@translate}</option>
    301         <option value="name">{'Photo name'|@translate}</option>
    302         <option value="album">{'Album'|@translate}</option>
    303         <option value="dimensions">{'Dimensions'|@translate}</option>
    304         <option value="author">{'Author'|@translate}</option>
    305         <option value="hit">{'Hits'|@translate}</option>
    306         <option value="rating_score">{'Rating score'|@translate}</option>
    307         <option value="level">{'Privacy level'|@translate}</option>
    308         <option value="limit">{'Max. number of photos'|@translate}</option>
    309       </select>
    310       <a id="removeFilters">{'Remove all filters'|@translate}</a>
    311       {if isset($new_smart)}<span class="new_smart">{'Add filters here'|@translate}</span>{/if}
     313        <option value="tags">{'Tags'|translate}</option>
     314        <option value="date">{'Date'|translate}</option>
     315        <option value="name">{'Photo name'|translate}</option>
     316        <option value="album">{'Album'|translate}</option>
     317        <option value="dimensions">{'Dimensions'|translate}</option>
     318        <option value="author">{'Author'|translate}</option>
     319        <option value="hit">{'Hits'|translate}</option>
     320        <option value="rating_score">{'Rating score'|translate}</option>
     321        <option value="level">{'Privacy level'|translate}</option>
     322        <option value="limit">{'Max. number of photos'|translate}</option>
     323      </select>
     324      <a id="removeFilters">{'Remove all filters'|translate}</a>
     325      {if isset($new_smart)}<span class="new_smart">{'Add filters here'|translate}</span>{/if}
    312326    </p>
    313327  </fieldset>
    314  
     328
    315329  <p class="actionButtons" id="applyFilterBlock">
    316     <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitFilters"/>
    317     <input class="submit" type="submit" value="{'Count'|@translate}" name="countImages" {if !isset($filters) AND !isset($new_smart)}style="display:none;"{/if}/>
     330    <input class="submit" type="submit" value="{'Submit'|translate}" name="submitFilters"/>
     331    <input class="submit" type="submit" value="{'Count'|translate}" name="countImages" {if !isset($filters) AND !isset($new_smart)}style="display:none;"{/if}/>
    318332    <span class="count_images_wrapper" {if !isset($filters) AND !isset($new_smart)}style="display:none;"{/if}><span class="count_image">{$IMAGE_COUNT}</span></span>
    319333  </p>
     
    327341  <li id="filter_iiii" class="filter_tags">
    328342    <span class="filter-title">
    329       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     343      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    330344      <input type="hidden" name="filters[iiii][type]" value="tags"/>
    331345      {$options.tags.name}
    332346    </span>
    333    
     347
    334348    <span class="filter-cond">
    335349      <select name="filters[iiii][cond]">
     
    337351      </select>
    338352    </span>
    339    
     353
    340354    <span class="filter-value">
    341355      <select name="filters[iiii][value]" class="tagSelect">
     
    344358  </li>
    345359  </div>
    346  
     360
    347361  <!-- date -->
    348362  <div id="filter_date">
    349363  <li id="filter_iiii" class="filter_date">
    350364    <span class="filter-title">
    351       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     365      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    352366      <input type="hidden" name="filters[iiii][type]" value="date"/>
    353367      {$options.date.name}
    354368    </span>
    355    
     369
    356370    <span class="filter-cond">
    357371      <select name="filters[iiii][cond]">
     
    359373      </select>
    360374    </span>
    361    
     375
    362376    <span class="filter-value">
    363377      <input type="text" name="filters[iiii][value]" size="30"/>
     
    365379  </li>
    366380  </div>
    367  
     381
    368382  <!-- name -->
    369383  <div id="filter_name">
    370384  <li id="filter_iiii" class="filter_name">
    371385    <span class="filter-title">
    372       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     386      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    373387      <input type="hidden" name="filters[iiii][type]" value="name"/>
    374388      {$options.name.name}
    375389    </span>
    376    
     390
    377391    <span class="filter-cond">
    378392      <select name="filters[iiii][cond]">
     
    380394      </select>
    381395    </span>
    382    
     396
    383397    <span class="filter-value">
    384398      <input type="text" name="filters[iiii][value]" size="30"/>
     
    386400  </li>
    387401  </div>
    388  
     402
    389403  <!-- album -->
    390404  <div id="filter_album">
    391405  <li id="filter_iiii" class="filter_album">
    392406    <span class="filter-title">
    393       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     407      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    394408      <input type="hidden" name="filters[iiii][type]" value="album"/>
    395409      {$options.album.name}
    396410    </span>
    397    
     411
    398412    <span class="filter-cond">
    399413      <select name="filters[iiii][cond]">
     
    401415      </select>
    402416    </span>
    403    
    404     <span class="filter-value">
    405       <select name="filters[iiii][value][]" class="albumSelect" multiple="multiple" data-placeholder="{'Select albums...'|@translate}">
     417
     418    <span class="filter-value">
     419      <select name="filters[iiii][value][]" class="albumSelect" multiple="multiple" data-placeholder="{'Select albums...'|translate}">
    406420        {html_options options=$all_albums}
    407421      </select>
     
    409423  </li>
    410424  </div>
    411  
     425
    412426  <!-- dimensions -->
    413427  <div id="filter_dimensions">
    414428  <li id="filter_iiii" class="filter_dimensions">
    415429    <span class="filter-title">
    416       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     430      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    417431      <input type="hidden" name="filters[iiii][type]" value="dimensions"/>
    418432      {$options.dimensions.name}
     
    427441    <span class="filter-value">
    428442      <span class="dimension_width">
    429       <span class="filter_dimension_info"></span>
    430         | <a class="dimensions-choice" data-type="width" data-min="{$dimensions.bounds.min_width}" data-max="{$dimensions.bounds.max_width}">{'Reset'|@translate}</a>
    431         <div class="filter_dimension_width_slider"></div>
     443        <span class="filter_dimension_info"></span>
     444          | <a class="dimensions-choice" data-type="width" data-min="{$dimensions.bounds.min_width}" data-max="{$dimensions.bounds.max_width}">{'Reset'|translate}</a>
     445          <div class="filter_dimension_width_slider"></div>
    432446      </span>
    433447
    434       <span class="filter-value dimension_height">
    435       <span class="filter_dimension_info"></span>
    436         | <a class="dimensions-choice" data-type="height" data-min="{$dimensions.bounds.min_height}" data-max="{$dimensions.bounds.max_height}">{'Reset'|@translate}</a>
    437         <div class="filter_dimension_height_slider"></div>
     448      <span class="dimension_height">
     449        <span class="filter_dimension_info"></span>
     450          | <a class="dimensions-choice" data-type="height" data-min="{$dimensions.bounds.min_height}" data-max="{$dimensions.bounds.max_height}">{'Reset'|translate}</a>
     451          <div class="filter_dimension_height_slider"></div>
    438452      </span>
    439453
    440       <span class="filter-value dimension_ratio">
    441       <span class="filter_dimension_info"></span>
    442 {if isset($dimensions.ratio_portrait)}
    443         | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_portrait.min}" data-max="{$dimensions.ratio_portrait.max}">{'Portrait'|@translate}</a>
    444 {/if}
    445 {if isset($dimensions.ratio_square)}
    446         | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_square.min}" data-max="{$dimensions.ratio_square.max}">{'square'|@translate}</a>
    447 {/if}
    448 {if isset($dimensions.ratio_landscape)}
    449         | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_landscape.min}" data-max="{$dimensions.ratio_landscape.max}">{'Landscape'|@translate}</a>
    450 {/if}
    451 {if isset($dimensions.ratio_panorama)}
    452         | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_panorama.min}" data-max="{$dimensions.ratio_panorama.max}">{'Panorama'|@translate}</a>
    453 {/if}
    454         | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.bounds.min_ratio}" data-max="{$dimensions.bounds.max_ratio}">{'Reset'|@translate}</a>
    455         <div class="filter_dimension_ratio_slider"></div>
     454      <span class="dimension_ratio">
     455        <span class="filter_dimension_info"></span>
     456        {if isset($dimensions.ratio_portrait)}
     457          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_portrait.min}" data-max="{$dimensions.ratio_portrait.max}">{'Portrait'|translate}</a>
     458        {/if}
     459        {if isset($dimensions.ratio_square)}
     460          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_square.min}" data-max="{$dimensions.ratio_square.max}">{'square'|translate}</a>
     461        {/if}
     462        {if isset($dimensions.ratio_landscape)}
     463          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_landscape.min}" data-max="{$dimensions.ratio_landscape.max}">{'Landscape'|translate}</a>
     464        {/if}
     465        {if isset($dimensions.ratio_panorama)}
     466          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_panorama.min}" data-max="{$dimensions.ratio_panorama.max}">{'Panorama'|translate}</a>
     467        {/if}
     468          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.bounds.min_ratio}" data-max="{$dimensions.bounds.max_ratio}">{'Reset'|translate}</a>
     469          <div class="filter_dimension_ratio_slider"></div>
    456470      </span>
    457471    </span>
     
    461475  </li>
    462476  </div>
    463  
     477
    464478  <!-- author -->
    465479  <div id="filter_author">
    466480  <li id="filter_iiii" class="filter_author">
    467481    <span class="filter-title">
    468       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     482      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    469483      <input type="hidden" name="filters[iiii][type]" value="author"/>
    470484      {$options.author.name}
    471485    </span>
    472    
     486
    473487    <span class="filter-cond">
    474488      <select name="filters[iiii][cond]">
     
    476490      </select>
    477491    </span>
    478    
     492
    479493    <span class="filter-value">
    480494      <input type="text" name="filters[iiii][value]" size="30"/>
    481       <i>{'For "Is (not) in", separate each author by a comma'|@translate}</i>
    482     </span>
    483   </li>
    484   </div>
    485  
     495      <i>{'For "Is (not) in", separate each author by a comma'|translate}</i>
     496    </span>
     497  </li>
     498  </div>
     499
    486500  <!-- hit -->
    487501  <div id="filter_hit">
    488502  <li id="filter_iiii" class="filter_hit">
    489503    <span class="filter-title">
    490       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     504      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    491505      <input type="hidden" name="filters[iiii][type]" value="hit"/>
    492506      {$options.hit.name}
    493507    </span>
    494    
     508
    495509    <span class="filter-cond">
    496510      <select name="filters[iiii][cond]">
     
    498512      </select>
    499513    </span>
    500    
     514
    501515    <span class="filter-value">
    502516      <input type="text" name="filters[iiii][value]" size="5"/>
     
    504518  </li>
    505519  </div>
    506  
     520
    507521  <!-- rating_score -->
    508522  <div id="filter_rating_score">
    509523  <li id="filter_iiii" class="filter_rating_score">
    510524    <span class="filter-title">
    511       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     525      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    512526      <input type="hidden" name="filters[iiii][type]" value="rating_score"/>
    513527      {$options.rating_score.name}
    514528    </span>
    515    
     529
    516530    <span class="filter-cond">
    517531      <select name="filters[iiii][cond]">
     
    519533      </select>
    520534    </span>
    521    
     535
    522536    <span class="filter-value">
    523537      <input type="text" name="filters[iiii][value]" size="5"/>
     
    525539  </li>
    526540  </div>
    527  
     541
    528542  <!-- level -->
    529543  <div id="filter_level">
    530544  <li id="filter_iiii" class="filter_level">
    531545    <span class="filter-title">
    532       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     546      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    533547      <input type="hidden" name="filters[iiii][type]" value="level"/>
    534548      {$options.level.name}
    535549    </span>
    536    
     550
    537551    <input type="hidden" name="filters[iiii][cond]" value="level"/>
    538    
     552
    539553    <span class="filter-value">
    540554      <select name="filters[iiii][value]">
     
    544558  </li>
    545559  </div>
    546  
     560
    547561  <!-- limit -->
    548562  <div id="filter_limit">
    549563  <li id="filter_iiii" class="filter_limit">
    550564    <span class="filter-title">
    551       <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
     565      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
    552566      <input type="hidden" name="filters[iiii][type]" value="limit"/>
    553567      {$options.limit.name}
    554568    </span>
    555    
     569
    556570    <input type="hidden" name="filters[iiii][cond]" value="limit"/>
    557    
     571
    558572    <span class="filter-value">
    559573      <input type="text" name="filters[iiii][value]" size="5"/>
  • extensions/SmartAlbums/admin/template/cat_list.tpl

    r19446 r26442  
    1 {footer_script require='jquery.ui.sortable'}{literal}
    2 jQuery(document).ready(function(){
    3   jQuery("#addAlbumOpen").click(function(){
    4     jQuery("#createAlbum").toggle();
    5     jQuery("input[name=virtual_name]").focus();
    6     jQuery("#autoOrder").hide();
    7   });
     1{footer_script require='jquery'}
     2jQuery("#addAlbumOpen").click(function(){
     3  jQuery("#createAlbum").toggle();
     4  jQuery("input[name=virtual_name]").focus();
     5  jQuery("#autoOrder").hide();
     6});
    87
    9   jQuery("#addAlbumClose").click(function(){
    10     jQuery("#createAlbum").hide();
    11   });
     8jQuery("#addAlbumClose").click(function(){
     9  jQuery("#createAlbum").hide();
    1210});
    13 {/literal}{/footer_script}
     11{/footer_script}
    1412
    15 {* è *}
    1613
    1714<div class="titrePage">
     
    2421<p class="showCreateAlbum">
    2522  <span id="notManualOrder">
    26     <a href="#" id="addAlbumOpen">{'create a new SmartAlbum'|@translate}</a>
    27     | <a href="{$F_ACTION}&amp;smart_generate=all">{'Regenerate photos list of all SmartAlbums'|@translate}</a>
     23    <a href="#" id="addAlbumOpen">{'create a new SmartAlbum'|translate}</a>
     24    | <a href="{$F_ACTION}&amp;smart_generate=all">{'Regenerate photos list of all SmartAlbums'|translate}</a>
    2825  </span>
    2926</p>
    3027
    3128<fieldset id="createAlbum" style="display:none;">
    32   <legend>{'create a new SmartAlbum'|@translate}</legend>
     29  <legend>{'create a new SmartAlbum'|translate}</legend>
    3330  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    3431
    3532  <p>
    36     <strong>{'Album name'|@translate}</strong> :
     33    <strong>{'Album name'|translate}</strong> :
    3734    <input type="text" name="virtual_name">
    3835  </p>
    3936  <p>
    40     <strong>{'Parent album'|@translate}</strong>  :
     37    <strong>{'Parent album'|translate}</strong>  :
    4138    <select class="categoryDropDown" name="parent_id">
    4239      <option value="0">------------</option>
     
    4542  </p>
    4643  <p class="actionButtons">
    47     <input class="submit" type="submit" value="{'Create'|@translate}" name="submitAdd">
    48     <a href="#" id="addAlbumClose">{'Cancel'|@translate}</a>
     44    <input class="submit" type="submit" value="{'Create'|translate}" name="submitAdd">
     45    <a href="#" id="addAlbumClose">{'Cancel'|translate}</a>
    4946  </p>
    5047</fieldset>
     
    5855      <!-- category {$category.ID} -->
    5956      <p class="albumTitle">
    60         <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong>
     57        <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|translate}">{$category.NAME}</a></strong>
    6158        <img src="{$SMART_PATH}admin/template/lightning.png">
    62         {'%d photos'|@translate|sprintf:$category.IMG_COUNT}
     59        {'%d photos'|translate:$category.IMG_COUNT}
    6360      </p>
    6461
    6562      <p class="albumActions">
    66         <a href="{$category.U_EDIT}">{'Edit'|@translate}</a>
    67         | <a href="{$category.U_SMART}" title="{$category.LAST_UPDATE}">{'Regenerate photos list of this SmartAlbum'|@translate}</a>
     63        <a href="{$category.U_EDIT}">{'Edit'|translate}</a>
     64        | <a href="{$category.U_SMART}" title="{$category.LAST_UPDATE}">{'Regenerate photos list of this SmartAlbum'|translate}</a>
    6865        {if isset($category.U_DELETE) }
    69         | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a>
     66        | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|translate|escape:javascript}');">{'delete album'|translate}</a>
    7067        {/if}
    7168        {if cat_admin_access($category.ID)}
    72         | <a href="{$category.U_JUMPTO}">{'jump to album'|@translate} ?</a>
     69        | <a href="{$category.U_JUMPTO}">{'jump to album'|translate} ?</a>
    7370        {/if}
    7471      </p>
  • extensions/SmartAlbums/admin/template/config.tpl

    r19446 r26442  
    1 {html_head}{literal}
    2 <style type="text/css">
    3 .showInfo {
    4   position:static;
    5   display:inline-block;
    6   padding:1px 6px !important;
    7   width:auto;
    8   font-size:0.8em;
    9   line-height:1.2em;
    10 }
    11 </style>
    12 {/literal}{/html_head}
     1{footer_script require="jquery"}
     2jQuery(".showInfo").tipTip({
     3  delay: 0,
     4  fadeIn: 200,
     5  fadeOut: 200,
     6  maxWidth: '300px',
     7  defaultPosition:"right"
     8});
     9{/footer_script}
    1310
    14 {footer_script require="jquery"}
    15 jQuery(".showInfo").tipTip({ldelim}
    16     delay: 0,
    17     fadeIn: 200,
    18     fadeOut: 200,
    19     maxWidth: '300px',
    20     defaultPosition:"right"
    21   });
    22 {/footer_script}
    2311
    2412<div class="titrePage">
     
    2614</div>
    2715
    28 <form method="post" action="" class="properties"> 
     16<form method="post" action="" class="properties">
    2917  <fieldset id="commentsConf">
    3018    <ul>
    3119      <li>
    3220        <label>
    33           <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/>
    34           <b>{'Update albums on file upload'|@translate}</b>
    35           <a class="showInfo" title="{'can cause slowdowns'|@translate}">i</a>
    36         </label>
     21          <input type="checkbox" name="update_on_date" value="true" {if $update_on_date}checked="checked"{/if}/>
     22          {assign var=input value='</label><input type="text" name="update_timeout" size="2" value="'|cat:$update_timeout|cat:'"/>'}
     23          <b>{'Update albums every %s days'|translate:$input}</b>
     24        <!-- label -->
    3725      </li>
    3826      <li>
    3927        <label>
    40           <input type="checkbox" name="update_on_date" value="true" {if $update_on_date}checked="checked"{/if}/>
    41           {assign var=input value='<input type="text" name="update_timeout" size="2" value="'|cat:$update_timeout|cat:'"/>'}
    42           <b>{'Update albums every %s days'|@translate|sprintf:$input}</b>
     28          <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/>
     29          <b>{'Update albums on file upload'|translate}</b>
     30          <a class="icon-info-circled-1 showInfo" title="{'can cause slowdowns'|translate}"></a>
    4331        </label>
    4432      </li>
     
    4634        <label>
    4735          <input type="checkbox" name="smart_is_forbidden" value="true" {if $smart_is_forbidden}checked="checked"{/if}/>
    48           <b>{'Exclude SmartAlbums from permissions management'|@translate}</b>
    49           <a class="showInfo" title="{'SmartAlbums are considered private for everyone, and a user can see it\'s content only if available in another album he has access to.'|@translate}">i</a>
     36          <b>{'Exclude SmartAlbums from permissions management'|translate}</b>
     37          <a class="icon-info-circled-1 showInfo" title="{'SmartAlbums are considered private for everyone, and a user can see it\'s content only if available in another album he has access to.'|translate}"></a>
    5038        </label>
    5139      </li>
    5240    </ul>
    5341  </fieldset>
    54    
    55   <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
     42
     43  <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|translate}" name="submit" /></p>
    5644</form>
  • extensions/SmartAlbums/admin/template/style.css

    r19722 r26442  
    88}
    99#batchManagerGlobal #filtersList li.token-input-input-token {
    10   margin-bottom:-3px !important; 
     10  margin-bottom:-3px !important;
    1111}
    1212
    1313#batchManagerGlobal .filter_dimensions .ui-slider-horizontal {
    14     margin: 5px 0 3px 0;
    15     width: 500px;
     14  margin:5px 0 3px 0;
     15  width:400px;
    1616}
    1717
Note: See TracChangeset for help on using the changeset viewer.