-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessaging_voip.install
31 lines (27 loc) · 1.13 KB
/
messaging_voip.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* Implementation of hook_install().
*/
function messaging_voip_install() {
messaging_voip_install_templates();
}
/**
* Implementation of hook_uninstall().
*/
function messaging_voip_uninstall() {
messaging_voip_uninstall_templates();
}
function messaging_voip_install_templates(){
//Clean up
messaging_voip_uninstall_templates();
//Insert templates
db_query("INSERT INTO {messaging_message_parts} (type,method,msgkey,message) VALUES('notifications-event','voip_message','footer','<none>')");
db_query("INSERT INTO {messaging_message_parts} (type,method,msgkey,message) VALUES('notifications-event','voip_inform','footer','<none>')");
db_query("INSERT INTO {messaging_message_parts} (type,method,msgkey,message) VALUES('notifications-digest','voip_message','footer','<none>')");
db_query("INSERT INTO {messaging_message_parts} (type,method,msgkey,message) VALUES('notifications-digest','voip_inform','footer','<none>')");
}
function messaging_voip_uninstall_templates(){
if(db_table_exists('messaging_message_parts')){
db_query("DELETE FROM {messaging_message_parts} WHERE method IN('voip_message','voip_inform')");
}
}