aboutsummaryrefslogtreecommitdiffstats
path: root/admin/configuration.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/configuration.php')
-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