Completed
Push — delete_old_notif_mob ( 4e0135...909209 )
by
unknown
09:09
created

start.php ➔ delete_old_notif_init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
elgg_register_event_handler('init', 'system', 'delete_old_notif_init');
4
5
/*
6
 * Plugin Init
7
 */
8
9
function delete_old_notif_init() {
10
	elgg_register_library('elgg:old_notification:functions', elgg_get_plugins_path() . 'delete_old_notif/lib/functions.php');
11
	elgg_register_plugin_hook_handler('cron', 'weekly', 'delete_weekly_cron_handler', 100);
12
	elgg_register_event_handler('pagesetup', 'system', 'delete_old_notif_pagesetup');
13
}
14
15
function delete_weekly_cron_handler($hook, $entity_type, $return_value, $params) {
16
	echo "<p>Starting up the cron job for the delete old notification (delete_old_notif plugin)</p>";
17
	elgg_load_library('elgg:old_notification:functions');
18
19
	initialize_queue('weekly');
20
21
	delete_old_notif_handler($hook, $entity_type, $return_value, $params, 'weekly');
22
}
23
24
function delete_old_notif_handler($hook, $entity_type, $return_value, $params, $cron_freq) {
25
	$dbprefix = elgg_get_config('dbprefix');
26
27
	// delete and clean up the notification
28
	$query = "";
29
	$result = delete_data($query);
30
31
}