diff options
Diffstat (limited to 'modules/watermark/controllers')
-rw-r--r-- | modules/watermark/controllers/watermark.php | 39 | ||||
-rw-r--r-- | modules/watermark/controllers/watermark_admin.php | 21 |
2 files changed, 21 insertions, 39 deletions
diff --git a/modules/watermark/controllers/watermark.php b/modules/watermark/controllers/watermark.php deleted file mode 100644 index a23cce64..00000000 --- a/modules/watermark/controllers/watermark.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2008 Bharat Mediratta - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ -class Watermark_Controller extends Controller { - public function load() { - $form = watermark::get_watermark_form(); - if ($form->validate()) { - $file = $_POST["file"]; - - $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 - } - } - - print $form; - } -}
\ No newline at end of file diff --git a/modules/watermark/controllers/watermark_admin.php b/modules/watermark/controllers/watermark_admin.php index c6d53999..9557e27f 100644 --- a/modules/watermark/controllers/watermark_admin.php +++ b/modules/watermark/controllers/watermark_admin.php @@ -18,6 +18,27 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Watermark_admin_Controller extends Controller { + public function load() { + $form = watermark::get_watermark_form(); + Kohana::log("debug", print_r($form, 1)); + if ($form->validate()) { + $file = $_POST["file"]; + Kohana::log("debug", $file); + + $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 + } + } + + print $form; + } + public function get_form($user_id) { try { // @todo check for admin user |