aboutsummaryrefslogtreecommitdiff
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
parent29da1ff8d4e70f81c401730117a832a1238399dc (diff)
downloadelgg-bdf9f7fe79f5c8077d20dbb1029903ed90e77d36.tar.gz
elgg-bdf9f7fe79f5c8077d20dbb1029903ed90e77d36.tar.bz2
added watermark plugin hooks
-rw-r--r--docs/extending_tidypics.txt15
-rw-r--r--languages/en.php2
-rw-r--r--lib/watermark.php13
3 files changed, 26 insertions, 4 deletions
diff --git a/docs/extending_tidypics.txt b/docs/extending_tidypics.txt
index 0fd544119..916cfa4ee 100644
--- a/docs/extending_tidypics.txt
+++ b/docs/extending_tidypics.txt
@@ -10,7 +10,7 @@ the custom front page tutorial plugin from Curverider.
*** MAKING TIDYPICS MATCH YOUR THEME ***
-Please check the css guid found in this directory. This will list the
+Please check the css guide found in this directory. This will list the
different css elements and where they are used.
@@ -23,4 +23,15 @@ different css elements and where they are used.
6. photo deleted: 'delete', 'tp_image'
*** TIDYPICS PLUGIN HOOKS ***
-1. album slideshow: 'tp_slideshow', 'album' - return false to not have a slideshow, otherwise return link to slideshow \ No newline at end of file
+1. album slideshow: 'tp_slideshow', 'album' - return false to not have a slideshow, otherwise return link to slideshow
+2. watermark - return false to prevent default watermark
+ 'tp_watermark', 'gd'
+ 'tp_watermark', 'imagick'
+ 'tp_watermark', 'imagemagick'
+
+
+*** IMAGE MENU EXTENSIONS ***
+Below an image is a div called tidypics_controls. By default it contains controls
+like tagging or downloading an image. You can change what is shown there by overridding
+or extending the tidypics/image_menu view.
+
diff --git a/languages/en.php b/languages/en.php
index 4b0d3e746..7dd7636dd 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -24,7 +24,7 @@
'album:group' => "Group albums",
'item:object:image' => "Photos",
'item:object:album' => "Albums",
- 'tidypics:uploading:images' => "Please wait. Uploading images",
+ 'tidypics:uploading:images' => "Please wait. Uploading images...",
'tidypics:enablephotos' => 'Enable group photo albums',
'tidypics:editprops' => 'Edit Image Properties',
'tidypics:mostcommented' => 'Most commented images',
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/";