Ignore:
Timestamp:
Jun 11, 2005, 4:10:04 PM (19 years ago)
Author:
plg
Message:
  • errors and informations boxes : management centralized in admin.php, $errors and $infos arrays replaced by $pageerrors and $pageinfos, special management for admin/update.php (more complex management)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/thumbnail.php

    r716 r792  
    3232function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext)
    3333{
    34   global $conf, $lang, $errors;
     34  global $conf, $lang, $page;
    3535
    3636  $filename = basename($path);
     
    101101      if (!is_writable($dirname))
    102102      {
    103         array_push($errors, '['.$dirname.'] : '.$lang['no_write_access']);
     103        array_push($page['errors'],
     104                   '['.$dirname.'] : '.$lang['no_write_access']);
    104105        return false;
    105106      }
     
    115116    if (!is_writable($tndir))
    116117    {
    117       array_push($errors, '['.$tndir.'] : '.$lang['no_write_access']);
     118      array_push($page['errors'], '['.$tndir.'] : '.$lang['no_write_access']);
    118119      return false;
    119120    }
     
    149150}
    150151
    151 $errors = array();
    152152$pictures = array();
    153153$stats = array();
     
    248248if (isset($_POST['submit']))
    249249{
    250   $errors = array();
    251250  $times = array();
    252251  $infos = array();
     
    255254  if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10)
    256255  {
    257     array_push($errors, $lang['tn_err_width'].' 10');
     256    array_push($page['errors'], $lang['tn_err_width'].' 10');
    258257  }
    259258  if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10)
    260259  {
    261     array_push($errors, $lang['tn_err_height'].' 10');
     260    array_push($page['errors'], $lang['tn_err_height'].' 10');
    262261  }
    263262 
    264263  // picture miniaturization
    265   if (count($errors) == 0)
     264  if (count($page['errors']) == 0)
    266265  {
    267266    $num = 1;
     
    346345}
    347346// +-----------------------------------------------------------------------+
    348 // |                            errors display                             |
    349 // +-----------------------------------------------------------------------+
    350 if (count($errors) != 0)
    351 {
    352   $template->assign_block_vars('errors',array());
    353   foreach ($errors as $error)
    354   {
    355     $template->assign_block_vars('errors.error',array('ERROR'=>$error));
    356   }
    357 }
    358 // +-----------------------------------------------------------------------+
    359347// |             form & pictures without thumbnails display                |
    360348// +-----------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.