Ignore:
Timestamp:
Apr 29, 2012, 9:34:44 AM (12 years ago)
Author:
plg
Message:

feature 2626: new design for the watermark configuration screen (tab in the "config > options")

TODO: the detection of derivatives that need to be updated is not working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r14251 r14512  
    174174      break;
    175175    }
     176    case 'watermark' :
     177    {
     178      include(PHPWG_ROOT_PATH.'admin/include/configuration_watermark_process.inc.php');       
     179      break;
     180    }
    176181    case 'sizes' :
    177182    {
     
    271276$tabsheet->add('main', l10n('Main'), $conf_link.'main');
    272277$tabsheet->add('sizes', l10n('Photo sizes'), $conf_link.'sizes');
     278$tabsheet->add('watermark', l10n('Watermark'), $conf_link.'watermark');
    273279$tabsheet->add('display', l10n('Display'), $conf_link.'display');
    274280$tabsheet->add('comments', l10n('Comments'), $conf_link.'comments');
     
    496502    break;
    497503  }
     504  case 'watermark' :
     505  {
     506    $watermark_files = array();
     507    foreach (glob(PHPWG_ROOT_PATH.'themes/default/watermarks/*.png') as $file)
     508    {
     509      $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
     510    }
     511    foreach (glob(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks/*.png') as $file)
     512    {
     513      $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
     514    }
     515    $watermark_filemap = array( '' => '---' );
     516    foreach( $watermark_files as $file)
     517    {
     518      $display = basename($file);
     519      $watermark_filemap[$file] = $display;
     520    }
     521    $template->assign('watermark_files', $watermark_filemap);
     522
     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    {
     549      $position = 'custom';
     550    }
     551   
     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      );
     571    break;
     572  }
    498573}
    499574
Note: See TracChangeset for help on using the changeset viewer.