From 0ae667e6cfdd1bcc85bacf85cd93a84f99fa88f8 Mon Sep 17 00:00:00 2001
From: cfoe <cfoe@ispconfig3>
Date: Tue, 22 May 2012 04:08:05 -0400
Subject: [PATCH] added missing language string already present in default theme

---
 server/mods-available/mail_module.inc.php |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/server/mods-available/mail_module.inc.php b/server/mods-available/mail_module.inc.php
index 0f13f05..23e0b8d 100644
--- a/server/mods-available/mail_module.inc.php
+++ b/server/mods-available/mail_module.inc.php
@@ -46,20 +46,43 @@
 									'mail_forwarding_delete',
 									'mail_transport_insert',
 									'mail_transport_update',
-									'mail_transport_delete');
+									'mail_transport_delete',
+									'mail_get_insert',
+									'mail_get_update',
+									'mail_get_delete',
+									'mail_content_filter_insert',
+									'mail_content_filter_update',
+									'mail_content_filter_delete',
+									'mail_mailinglist_insert',
+									'mail_mailinglist_update',
+									'mail_mailinglist_delete');
+	
+	//* This function is called during ispconfig installation to determine
+	//  if a symlink shall be created for this plugin.
+	function onInstall() {
+		global $conf;
+		
+		if($conf['services']['mail'] == true) {
+			return true;
+		} else {
+			return false;
+		}
+		
+	}
 	
 	/*
 	 	This function is called when the module is loaded
 	*/
 	
 	function onLoad() {
+		global $app;
 		
 		/*
 		Annonce the actions that where provided by this module, so plugins 
 		can register on them.
 		*/
 		
-		$app->plugins->registerEvents($this->module_name,$this->actions_available);
+		$app->plugins->announceEvents($this->module_name,$this->actions_available);
 		
 		/*
 		As we want to get notified of any changes on several database tables,
@@ -76,6 +99,9 @@
 		$app->modules->registerTableHook('mail_forwarding','mail_module','process');
 		$app->modules->registerTableHook('mail_transport','mail_module','process');
 		$app->modules->registerTableHook('mail_user','mail_module','process');
+		$app->modules->registerTableHook('mail_get','mail_module','process');
+		$app->modules->registerTableHook('mail_content_filter','mail_module','process');
+		$app->modules->registerTableHook('mail_mailinglist','mail_module','process');
 		
 	}
 	
@@ -113,6 +139,21 @@
 				if($action == 'u') $app->plugins->raiseEvent('mail_user_update',$data);
 				if($action == 'd') $app->plugins->raiseEvent('mail_user_delete',$data);
 			break;
+			case 'mail_get':
+				if($action == 'i') $app->plugins->raiseEvent('mail_get_insert',$data);
+				if($action == 'u') $app->plugins->raiseEvent('mail_get_update',$data);
+				if($action == 'd') $app->plugins->raiseEvent('mail_get_delete',$data);
+			break;
+			case 'mail_content_filter':
+				if($action == 'i') $app->plugins->raiseEvent('mail_content_filter_insert',$data);
+				if($action == 'u') $app->plugins->raiseEvent('mail_content_filter_update',$data);
+				if($action == 'd') $app->plugins->raiseEvent('mail_content_filter_delete',$data);
+			break;
+			case 'mail_mailinglist':
+				if($action == 'i') $app->plugins->raiseEvent('mail_mailinglist_insert',$data);
+				if($action == 'u') $app->plugins->raiseEvent('mail_mailinglist_update',$data);
+				if($action == 'd') $app->plugins->raiseEvent('mail_mailinglist_delete',$data);
+			break;
 		} // end switch
 	} // end function
 

--
Gitblit v1.9.1