From 2c91a7e9ced0d2134682450dc1713b8e1b239dae Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 25 Dec 2008 23:43:44 +0000 Subject: Rework log and message helpers to be parallel, but separate. 1) they now have their own matching severity constants 2) they both have convenience functions success(), info(), warning() and error() 3) they both have severity_class() --- modules/watermark/controllers/admin_watermarks.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/watermark/controllers') diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php index d1c9026d..fa17ba8c 100644 --- a/modules/watermark/controllers/admin_watermarks.php +++ b/modules/watermark/controllers/admin_watermarks.php @@ -25,15 +25,15 @@ class Admin_Watermarks_Controller extends Admin_Controller { $pathinfo = pathinfo($file); $name = preg_replace("/uploadfile-[^-]+-(.*)/", '$1', $pathinfo["basename"]); if (ORM::factory("watermark")->where("name", $name)->count_all() > 0) { - message::add(_("There is already a watermark with that name"), log::WARNING); + message::error(_("There is already a watermark with that name")); } else if (!($image_info = getimagesize($file))) { - message::add(_("An error occurred while saving this watermark"), log::WARNING); + message::warning(_("An error occurred while saving this watermark")); } else { if (empty($pathinfo["extension"])) { $name .= "." . image_type_to_extension($image_info[2]); } if (!rename($file, VARPATH . "modules/watermark/$name")) { - message::add(_("An error occurred while saving this watermark"), log::WARNING); + message::warning(_("An error occurred while saving this watermark")); } else { $watermark = ORM::factory("watermark"); $watermark->name = $name; @@ -42,7 +42,7 @@ class Admin_Watermarks_Controller extends Admin_Controller { $watermark->mime_type = $image_info["mime"]; $watermark->save(); - message::add(_("Watermark saved")); + message::success(_("Watermark saved")); url::redirect("admin/watermarks"); } } -- cgit v1.2.3