aboutsummaryrefslogtreecommitdiffstats
path: root/admin/configuration.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-04-29 11:41:34 +0000
committerplegall <plg@piwigo.org>2012-04-29 11:41:34 +0000
commitd04e3894119ade77bfafd02a29cf368efcdde565 (patch)
treee60a93d3a7910340d69c7a153555c26bf5d33ecc /admin/configuration.php
parent5884b956f88bc8b602a7179d9e59f1c737ad99fc (diff)
feature 2626: manage inline errors on form submission
git-svn-id: http://piwigo.org/svn/trunk@14513 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/configuration.php86
1 files changed, 42 insertions, 44 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 0fbe113d6..f9e0999e8 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -221,7 +221,7 @@ if (isset($_POST['submit']))
}
// updating configuration if no error found
- if ('sizes' != $page['section'] and count($page['errors']) == 0)
+ if (!in_array($page['section'], array('sizes', 'watermark')) and count($page['errors']) == 0)
{
//echo '<pre>'; print_r($_POST); echo '</pre>';
$result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
@@ -520,54 +520,52 @@ switch ($page['section'])
}
$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)
+ if ($template->get_template_vars('watermark') === null)
{
- $position = 'bottomright';
- }
+ $wm = ImageStdParams::get_watermark();
- if ($wm->xrepeat != 0)
- {
$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->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;
}
}