Start of the dialog to specify the watermark placement. For convience, using the imagemagik nomicalture regarding watermark locations (east, west, center, etc.)

You can drag the watermark around but it doesn't stay in place.
Need to figure out how to resize the dialog box

and all of the supporting javascript
This commit is contained in:
Tim Almdal
2008-12-15 23:08:18 +00:00
parent 2f8b4df0f5
commit 92e6ed8a8a
6 changed files with 122 additions and 8 deletions
+5 -6
View File
@@ -22,13 +22,12 @@ class Watermark_Controller extends Controller {
$form = watermark::get_watermark_form();
if ($form->validate()) {
$file = $_POST["file"];
// Format of the file is config["upload.directory"]/uploadfile-hash-filename.
$index = strrpos($file, "-");
$watermark_target = VARPATH . substr($file, strrpos($file, "-") + 1);
if (rename($file, $watermark_target)) {
module::set_var("watermark", "watermark_image_path", $watermark_target);
$pathinfo = pathinfo($file);
$watermark_target = $pathinfo["basename"];
if (copy($file, VARPATH . $watermark_target)) {
module::set_var("watermark", "watermark_image_path", $watermark_target);
unlink($file);
$form->success = _("Watermark saved");
} else {
// @todo set and error message