From e851f504acebc9422b79f58da25420666da6e296 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 11 Jun 2005 14:10:04 +0000 Subject: - errors and informations boxes : management centralized in admin.php, $errors and $infos arrays replaced by $page['errors'] and $page['infos'], special management for admin/update.php (more complex management) git-svn-id: http://piwigo.org/svn/trunk@792 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/thumbnail.php | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'admin/thumbnail.php') diff --git a/admin/thumbnail.php b/admin/thumbnail.php index 7cdb1711a..64a6797e3 100644 --- a/admin/thumbnail.php +++ b/admin/thumbnail.php @@ -31,7 +31,7 @@ include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); // "thumbnail". function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) { - global $conf, $lang, $errors; + global $conf, $lang, $page; $filename = basename($path); $dirname = dirname($path); @@ -100,7 +100,8 @@ function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) { if (!is_writable($dirname)) { - array_push($errors, '['.$dirname.'] : '.$lang['no_write_access']); + array_push($page['errors'], + '['.$dirname.'] : '.$lang['no_write_access']); return false; } umask(0000); @@ -114,7 +115,7 @@ function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) // creation and backup of final picture if (!is_writable($tndir)) { - array_push($errors, '['.$tndir.'] : '.$lang['no_write_access']); + array_push($page['errors'], '['.$tndir.'] : '.$lang['no_write_access']); return false; } imagejpeg($destImage, $dest_file); @@ -148,7 +149,6 @@ function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) } } -$errors = array(); $pictures = array(); $stats = array(); // +-----------------------------------------------------------------------+ @@ -247,22 +247,21 @@ foreach ($fs['elements'] as $path) // +-----------------------------------------------------------------------+ if (isset($_POST['submit'])) { - $errors = array(); $times = array(); $infos = array(); // checking criteria if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10) { - array_push($errors, $lang['tn_err_width'].' 10'); + array_push($page['errors'], $lang['tn_err_width'].' 10'); } if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10) { - array_push($errors, $lang['tn_err_height'].' 10'); + array_push($page['errors'], $lang['tn_err_height'].' 10'); } // picture miniaturization - if (count($errors) == 0) + if (count($page['errors']) == 0) { $num = 1; foreach ($wo_thumbnails as $path) @@ -345,17 +344,6 @@ if (isset($_POST['submit'])) } } // +-----------------------------------------------------------------------+ -// | errors display | -// +-----------------------------------------------------------------------+ -if (count($errors) != 0) -{ - $template->assign_block_vars('errors',array()); - foreach ($errors as $error) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$error)); - } -} -// +-----------------------------------------------------------------------+ // | form & pictures without thumbnails display | // +-----------------------------------------------------------------------+ $remainings = array_diff($wo_thumbnails, $thumbnalized); -- cgit v1.2.3