Ejemplo n.º 1
0
function backupbuddy_sync_add_notices($arguments, $urgent = false)
{
    require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
    $notifications = backupbuddy_core::getNotifications();
    foreach ($notifications as &$notification) {
        // Skip if in the inapplicable mode.
        if (false === $urgent && true === $notification['urgent']) {
            // If NOT seeking urgents, skip urgents.
            continue;
        }
        if (true === $urgent && false === $notification['urgent']) {
            // If seeking urgents, skip non-urgents.
            continue;
        }
        if (true === $notification['syncSent']) {
            // Only send once.
            continue;
        }
        $notification['syncSent'] = true;
        $notification['data']['datestamp'] = date('Y-m-d', $notification['time']);
        // Added v6.3.3.10.
        // Send notice.
        if (false === $urgent) {
            ithemes_sync_add_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $notification['data']);
        } elseif (true === $urgent) {
            ithemes_sync_send_urgent_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $notification['data']);
        }
    }
    backupbuddy_core::replaceNotifications($notifications);
    // Save with syncSent updates for all notifications.
    return true;
}
Ejemplo n.º 2
0
function backupbuddy_sync_add_notices($arguments, $urgent = false)
{
    require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
    $notifications = backupbuddy_core::getNotifications();
    foreach ($notifications as &$notification) {
        // Skip if in the inapplicable mode.
        if (false === $urgent && true === $notification['urgent']) {
            // If NOT seeking urgents, skip urgents.
            continue;
        }
        if (true === $urgent && false === $notification['urgent']) {
            // If seeking urgents, skip non-urgents.
            continue;
        }
        if (true === $notification['syncSent']) {
            // Only send once.
            continue;
        }
        $notification['syncSent'] = true;
        // Compile data.
        //$data = array();
        $data = $notification['data'];
        /*
        if ( ! empty( $arguments['verbose'] ) ) { // The verbose argument can be checked for in order to provide additional information that may not always be necessary.
        	$data = $notification['data'];
        }
        */
        // Send notice.
        if (false === $urgent) {
            ithemes_sync_add_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $data);
        } elseif (true === $urgent) {
            ithemes_sync_send_urgent_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $data);
        }
    }
    backupbuddy_core::replaceNotifications($notifications);
    // Save with syncSent updates for all notifications.
    return true;
}