Beispiel #1
0
 public function edit()
 {
     $form = watermark::get_edit_form();
     if ($form->validate()) {
         module::set_var("watermark", "position", $form->edit_watermark->position->value);
         module::set_var("watermark", "transparency", $form->edit_watermark->transparency->value);
         $this->_update_graphics_rules();
         log::success("watermark", t("Watermark changed"));
         message::success(t("Watermark changed"));
         print json_encode(array("result" => "success", "location" => url::site("admin/watermarks")));
     } else {
         print json_encode(array("result" => "error", "form" => $form->__toString()));
     }
 }
Beispiel #2
0
 public function edit()
 {
     access::verify_csrf();
     $form = watermark::get_edit_form();
     if ($form->validate()) {
         module::set_var("watermark", "position", $form->edit_watermark->position->value);
         module::set_var("watermark", "transparency", $form->edit_watermark->transparency->value);
         $this->_update_graphics_rules();
         log::success("watermark", t("Watermark changed"));
         message::success(t("Watermark changed"));
         json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
     } else {
         json::reply(array("result" => "error", "html" => (string) $form));
     }
 }
Beispiel #3
0
 public function edit()
 {
     access::verify_csrf();
     $form = watermark::get_edit_form();
     if ($form->validate()) {
         module::set_var("watermark", "position", $form->edit_watermark->position->value);
         module::set_var("watermark", "transparency", $form->edit_watermark->transparency->value);
         $this->_update_graphics_rules();
         log::success("watermark", t("Watermark changed"));
         message::success(t("Watermark changed"));
         json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
     } else {
         json::reply(array("result" => "error", "html" => (string) $form));
     }
     // Override the application/json mime type for iframe compatibility.  See ticket #2022.
     header("Content-Type: text/plain; charset=" . Kohana::CHARSET);
 }