diff options
author | mistic100 <mistic@piwigo.org> | 2014-08-23 10:24:55 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2014-08-23 10:24:55 +0000 |
commit | 78d95a8a144f24e420933820e55004d44ecff81e (patch) | |
tree | d4f171ad5a620c30753dec01899b2c6405bc7343 /admin/batch_manager.php | |
parent | 9c9f8548fc68038a206f3cf5ca551ec930019405 (diff) |
create a mini jquery plugin for sliders on batch manager + async load
git-svn-id: http://piwigo.org/svn/trunk@29249 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/batch_manager.php')
-rw-r--r-- | admin/batch_manager.php | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/admin/batch_manager.php b/admin/batch_manager.php index 8259f2bb9..26f764e0b 100644 --- a/admin/batch_manager.php +++ b/admin/batch_manager.php @@ -535,6 +535,7 @@ $tabsheet->assign(); $widths = array(); $heights = array(); $ratios = array(); +$dimensions = array(); // get all width, height and ratios $query = ' @@ -565,28 +566,20 @@ if (empty($widths)) $ratios = array(1.25, 1.52, 1.78); } - - -$widths = array_unique($widths); -sort($widths); - -$heights = array_unique($heights); -sort($heights); - -$ratios = array_unique($ratios); -sort($ratios); - -$dimensions['widths'] = implode(',', $widths); -$dimensions['heights'] = implode(',', $heights); -$dimensions['ratios'] = implode(',', $ratios); +foreach (array('widths','heights','ratios') as $type) +{ + ${$type} = array_unique(${$type}); + sort(${$type}); + $dimensions[$type] = implode(',', ${$type}); +} $dimensions['bounds'] = array( 'min_width' => $widths[0], - 'max_width' => $widths[count($widths)-1], + 'max_width' => end($widths), 'min_height' => $heights[0], - 'max_height' => $heights[count($heights)-1], + 'max_height' => end($heights), 'min_ratio' => $ratios[0], - 'max_ratio' => $ratios[count($ratios)-1], + 'max_ratio' => end($ratios), ); // find ratio categories @@ -617,13 +610,13 @@ foreach ($ratios as $ratio) } } -foreach (array_keys($ratio_categories) as $ratio_category) +foreach (array_keys($ratio_categories) as $type) { - if (count($ratio_categories[$ratio_category]) > 0) + if (count($ratio_categories[$type]) > 0) { - $dimensions['ratio_'.$ratio_category] = array( - 'min' => $ratio_categories[$ratio_category][0], - 'max' => array_pop($ratio_categories[$ratio_category]), + $dimensions['ratio_'.$type] = array( + 'min' => $ratio_categories[$type][0], + 'max' => end($ratio_categories[$type]), ); } } @@ -644,6 +637,7 @@ $template->assign('dimensions', $dimensions); // +-----------------------------------------------------------------------+ $filesizes = array(); +$filesize = array(); $query = ' SELECT @@ -675,7 +669,7 @@ $filesize['list'] = implode(',', $filesizes); $filesize['bounds'] = array( 'min' => $filesizes[0], - 'max' => $filesizes[count($filesizes)-1], + 'max' => end($filesizes), ); // selected=bound if nothing selected |