summaryrefslogtreecommitdiff
path: root/modules/watermark/controllers/watermark_admin.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-12-16 17:30:18 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-12-16 17:30:18 +0000
commit04441e11cccceea92454d3fcbc54e0e103fb8bd6 (patch)
tree06ce3eb18eb156b736cb3510ac92e1af3aa4bb94 /modules/watermark/controllers/watermark_admin.php
parent931d8c6bdce9fa4656d36c2f07ff6a38d0b47c5d (diff)
1) Remove the load watermark from the scaffolding... use the menu option
2) The set watermark dialog is now sizing properly. @todo is recenter in the window
Diffstat (limited to 'modules/watermark/controllers/watermark_admin.php')
-rw-r--r--modules/watermark/controllers/watermark_admin.php21
1 files changed, 21 insertions, 0 deletions
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