aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-10-03 18:42:21 +0000
committerCash Costello <cash.costello@gmail.com>2009-10-03 18:42:21 +0000
commitbdf9f7fe79f5c8077d20dbb1029903ed90e77d36 (patch)
tree4b8835cd5edf789c5a38102ba816f7f5d39ba6d3 /lib
parent29da1ff8d4e70f81c401730117a832a1238399dc (diff)
downloadelgg-bdf9f7fe79f5c8077d20dbb1029903ed90e77d36.tar.gz
elgg-bdf9f7fe79f5c8077d20dbb1029903ed90e77d36.tar.bz2
added watermark plugin hooks
Diffstat (limited to 'lib')
-rw-r--r--lib/watermark.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/watermark.php b/lib/watermark.php
index 896be72fa..c7b8503c5 100644
--- a/lib/watermark.php
+++ b/lib/watermark.php
@@ -27,6 +27,10 @@ function tp_gd_watermark($image) {
if (!$watermark_text)
return;
+ // plugins can do their own watermark and return false to prevent this function from running
+ if (trigger_plugin_hook('tp_watermark', 'gd', $image, true) === false)
+ return;
+
global $CONFIG;
$owner = get_loggedin_user();
@@ -60,6 +64,10 @@ function tp_imagick_watermark($filename) {
if (!$watermark_text)
return;
+ // plugins can do their own watermark and return false to prevent this function from running
+ if (trigger_plugin_hook('tp_watermark', 'imagick', $filename, true) === false)
+ return;
+
$owner = get_loggedin_user();
$watermark_text = tp_process_watermark_text($watermark_text, $owner);
@@ -96,7 +104,10 @@ function tp_im_cmdline_watermark($filename) {
if (!$watermark_text)
return;
-
+ // plugins can do their own watermark and return false to prevent this function from running
+ if (trigger_plugin_hook('tp_watermark', 'imagemagick', $filename, true) === false)
+ return;
+
$im_path = get_plugin_setting('im_path', 'tidypics');
if (!$im_path) {
$im_path = "/usr/bin/";