Show
Ignore:
Timestamp:
04/29/12 13:41:34 (14 months ago)
Author:
plg
Message:

feature 2626: manage inline errors on form submission

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r14512 r14513  
    222222 
    223223  // updating configuration if no error found 
    224   if ('sizes' != $page['section'] and count($page['errors']) == 0) 
     224  if (!in_array($page['section'], array('sizes', 'watermark')) and count($page['errors']) == 0) 
    225225  { 
    226226    //echo '<pre>'; print_r($_POST); echo '</pre>'; 
     
    521521    $template->assign('watermark_files', $watermark_filemap); 
    522522 
    523     $wm = ImageStdParams::get_watermark(); 
    524  
    525     $position = 'custom'; 
    526     if ($wm->xpos == 0 and $wm->ypos == 0) 
    527     { 
    528       $position = 'topleft'; 
    529     } 
    530     if ($wm->xpos == 100 and $wm->ypos == 0) 
    531     { 
    532       $position = 'topright'; 
    533     } 
    534     if ($wm->xpos == 50 and $wm->ypos == 50) 
    535     { 
    536       $position = 'middle'; 
    537     } 
    538     if ($wm->xpos == 0 and $wm->ypos == 100) 
    539     { 
    540       $position = 'bottomleft'; 
    541     } 
    542     if ($wm->xpos == 100 and $wm->ypos == 100) 
    543     { 
    544       $position = 'bottomright'; 
    545     } 
    546  
    547     if ($wm->xrepeat != 0) 
    548     { 
     523    if ($template->get_template_vars('watermark') === null) 
     524    { 
     525      $wm = ImageStdParams::get_watermark(); 
     526 
    549527      $position = 'custom'; 
    550     } 
     528      if ($wm->xpos == 0 and $wm->ypos == 0) 
     529      { 
     530        $position = 'topleft'; 
     531      } 
     532      if ($wm->xpos == 100 and $wm->ypos == 0) 
     533      { 
     534        $position = 'topright'; 
     535      } 
     536      if ($wm->xpos == 50 and $wm->ypos == 50) 
     537      { 
     538        $position = 'middle'; 
     539      } 
     540      if ($wm->xpos == 0 and $wm->ypos == 100) 
     541      { 
     542        $position = 'bottomleft'; 
     543      } 
     544      if ($wm->xpos == 100 and $wm->ypos == 100) 
     545      { 
     546        $position = 'bottomright'; 
     547      } 
     548       
     549      if ($wm->xrepeat != 0) 
     550      { 
     551        $position = 'custom'; 
     552      } 
    551553     
    552     $template->assign( 
    553       'watermark', 
    554       array( 
    555         'file' => $wm->file, 
    556         'minw' => $wm->min_size[0], 
    557         'minh' => $wm->min_size[1], 
    558         'xpos' => $wm->xpos, 
    559         'ypos' => $wm->ypos, 
    560         'xrepeat' => $wm->xrepeat, 
    561         'opacity' => $wm->opacity, 
    562         'position' => $position, 
    563         ) 
    564       ); 
    565  
    566     $template->append( 
    567       'watermark', 
    568       array(), 
    569       true 
    570       ); 
     554      $template->assign( 
     555        'watermark', 
     556        array( 
     557          'file' => $wm->file, 
     558          'minw' => $wm->min_size[0], 
     559          'minh' => $wm->min_size[1], 
     560          'xpos' => $wm->xpos, 
     561          'ypos' => $wm->ypos, 
     562          'xrepeat' => $wm->xrepeat, 
     563          'opacity' => $wm->opacity, 
     564          'position' => $position, 
     565          ) 
     566        ); 
     567    } 
     568     
    571569    break; 
    572570  }