aboutsummaryrefslogtreecommitdiffstats
path: root/admin/configuration.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-04-29 07:34:44 +0000
committerplegall <plg@piwigo.org>2012-04-29 07:34:44 +0000
commit5884b956f88bc8b602a7179d9e59f1c737ad99fc (patch)
tree64ebfc3e6741a45a097dde8e061a6567a5082be7 /admin/configuration.php
parent7c25cf9b781dab5183649b1216d51bf91326d257 (diff)
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. git-svn-id: http://piwigo.org/svn/trunk@14512 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/configuration.php75
1 files changed, 75 insertions, 0 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 0de99e40f..0fbe113d6 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -173,6 +173,11 @@ if (isset($_POST['submit']))
}
break;
}
+ case 'watermark' :
+ {
+ include(PHPWG_ROOT_PATH.'admin/include/configuration_watermark_process.inc.php');
+ break;
+ }
case 'sizes' :
{
include(PHPWG_ROOT_PATH.'admin/include/configuration_sizes_process.inc.php');
@@ -270,6 +275,7 @@ $tabsheet = new tabsheet();
// TabSheet initialization
$tabsheet->add('main', l10n('Main'), $conf_link.'main');
$tabsheet->add('sizes', l10n('Photo sizes'), $conf_link.'sizes');
+$tabsheet->add('watermark', l10n('Watermark'), $conf_link.'watermark');
$tabsheet->add('display', l10n('Display'), $conf_link.'display');
$tabsheet->add('comments', l10n('Comments'), $conf_link.'comments');
$tabsheet->add('default', l10n('Guest Settings'), $conf_link.'default');
@@ -495,6 +501,75 @@ switch ($page['section'])
break;
}
+ case 'watermark' :
+ {
+ $watermark_files = array();
+ foreach (glob(PHPWG_ROOT_PATH.'themes/default/watermarks/*.png') as $file)
+ {
+ $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
+ }
+ foreach (glob(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks/*.png') as $file)
+ {
+ $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
+ }
+ $watermark_filemap = array( '' => '---' );
+ foreach( $watermark_files as $file)
+ {
+ $display = basename($file);
+ $watermark_filemap[$file] = $display;
+ }
+ $template->assign('watermark_files', $watermark_filemap);
+
+ $wm = ImageStdParams::get_watermark();
+
+ $position = 'custom';
+ if ($wm->xpos == 0 and $wm->ypos == 0)
+ {
+ $position = 'topleft';
+ }
+ if ($wm->xpos == 100 and $wm->ypos == 0)
+ {
+ $position = 'topright';
+ }
+ if ($wm->xpos == 50 and $wm->ypos == 50)
+ {
+ $position = 'middle';
+ }
+ if ($wm->xpos == 0 and $wm->ypos == 100)
+ {
+ $position = 'bottomleft';
+ }
+ if ($wm->xpos == 100 and $wm->ypos == 100)
+ {
+ $position = 'bottomright';
+ }
+
+ if ($wm->xrepeat != 0)
+ {
+ $position = 'custom';
+ }
+
+ $template->assign(
+ 'watermark',
+ array(
+ 'file' => $wm->file,
+ 'minw' => $wm->min_size[0],
+ 'minh' => $wm->min_size[1],
+ 'xpos' => $wm->xpos,
+ 'ypos' => $wm->ypos,
+ 'xrepeat' => $wm->xrepeat,
+ 'opacity' => $wm->opacity,
+ 'position' => $position,
+ )
+ );
+
+ $template->append(
+ 'watermark',
+ array(),
+ true
+ );
+ break;
+ }
}
//----------------------------------------------------------- sending html code