From 59e81a438d23d92b656fe57878dab0e4b1560b73 Mon Sep 17 00:00:00 2001 From: Kate Arzamastseva <pshns@ukr.net> Date: Thu, 14 Jul 2011 23:55:03 +0300 Subject: [PATCH] media diff event --- inc/media.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/inc/media.php b/inc/media.php index ebdde0ec9..e0bf9bd62 100644 --- a/inc/media.php +++ b/inc/media.php @@ -722,6 +722,7 @@ function media_tab_view($image, $ns, $auth=null, $rev=false) { $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); $class = 'select mediafile mf_'.$class; echo '<a class="'.$class.'" >'.$image.'</a>'; + //echo '<span style="background: url(/lib/images/fileicons/pdf.png) 0 0 no-repeat; padding-left: 20px;">'.$image.'</span>'; echo '</div>'; echo '<div class="scroll-container">'; @@ -854,7 +855,7 @@ function media_preview($image, $auth, $rev=false, $meta=false) { * @author Kate Arzamastseva <pshns@ukr.net> */ function media_details($image, $auth, $rev=false, $meta=false) { - global $lang, $config_cascade;; + global $lang, $config_cascade; if (!$image) return ''; if ($auth < AUTH_READ) { @@ -944,6 +945,32 @@ function media_diff($image, $ns, $auth) { $l_rev = $revs[0]; } + // prepare event data + $data[0] = $image; + $data[1] = $l_rev; + $data[2] = $r_rev; + $data[3] = $ns; + $data[4] = $auth; + + // trigger event + return trigger_event('MEDIA_DIFF', $data, '_media_image_diff', true); + +} + +function _media_image_diff($data) { + if(is_array($data) && count($data)===5) { + return media_image_diff($data[0], $data[1], $data[2], $data[3], $data[4]); + } else { + return false; + } +} + +/** + * Shows difference between two revisions of image + * + * @author Kate Arzamastseva <pshns@ukr.net> + */ +function media_image_diff($image, $l_rev, $r_rev, $ns, $auth){ $l_meta = new JpegMeta(mediaFN($image, $l_rev)); $r_meta = new JpegMeta(mediaFN($image, $r_rev)); -- GitLab