1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8/**
9 * Class for image_gallery_changed events
10 */
11class Reports_Send_EmailBuilder_ImageGalleryChanged extends Reports_Send_EmailBuilder_Abstract
12{
13	public function getTitle()
14	{
15		return tr('Image galleries changed:');
16	}
17
18	public function getOutput(array $change)
19	{
20		$base_url = $change['data']['base_url'];
21
22		if (empty($change['data']['action'])) {
23			$output = $change['data']['user'] . ' ' . tra('changed the picture gallery') .
24							" <a href=\"{$base_url}tiki-browse_gallery.php?galleryId=" .
25							$change['data']['galleryId'] . "&offset=0&sort_mode=created_desc\">" . $change['data']['galleryName'] . '</a>.';
26		} elseif ($change['data']['action'] == 'upload image') {
27			$output = '<u>' . $change['data']['user'] . '</u> ' . tra('uploaded the picture') .
28								" <a href=\"{$base_url}tiki-browse_image.php?imageId=" . $change['data']['imageId'] . "\">" .
29								$change['data']['imageName'] . '</a> ' . tra('onto') .
30								" <a href=\"{$base_url}tiki-browse_gallery.php?galleryId=" .
31								$change['data']['galleryId'] . "&offset=0&sort_mode=created_desc\">" . $change['data']['galleryName'] . '</a>.';
32		} elseif ($change['data']['action'] == "remove image") {
33			$output = '<u>' . $change['data']['user'] . '</u> ' . tra('removed the picture') .
34								" <a href=\"{$base_url}tiki-browse_image.php?imageId=" . $change['data']['imageId'] . "\">" .
35								$change['data']['imageName'] . '</a> ' . tra('from') .
36								" <a href=\"{$base_url}tiki-browse_gallery.php?galleryId=" . $change['data']['galleryId'] .
37								"&offset=0&sort_mode=created_desc\">" . $change['data']['galleryName'] . '</a>.';
38		}
39
40		return $output;
41	}
42}
43