diff --git a/digests-email.tpl.php b/digests-email.tpl.php new file mode 100644 index 0000000..a6bcfa8 --- /dev/null +++ b/digests-email.tpl.php @@ -0,0 +1,53 @@ + +
+ + +
+ +
+ + + + + +
+ + + + +
+ +
+ +
diff --git a/digests.admin.inc b/digests.admin.inc new file mode 100644 index 0000000..70aaeb3 --- /dev/null +++ b/digests.admin.inc @@ -0,0 +1,116 @@ + 'select', + '#title' => t('Send digests after'), + '#description' => t('Select an hour of the day'), + '#options' => _digests_get_hours(), + '#default_value' => variable_get('digests_send_time', 18), + '#required' => TRUE, + ); + $form['digests_local'] = array( + '#type' => 'radios', + '#title' => t('Send digests'), + '#default_value' => variable_get('digests_local', 'local'), + '#options' => array( + 'local' => t("using users' local timezones"), + 'site' => t("using the site's timezone"), + ), + '#required' => TRUE, + ); + $form['digests_limit'] = array( + '#type' => 'textfield', + '#title' => t('The maximum number of users to which to send digests each time cron runs'), + '#description' => t('Leave this field blank or enter 0 to process all users.'), + '#default_value' => variable_get('digests_limit', 250), + '#size' => 11, + '#maxlength' => 15, + ); + $form['digests_logo'] = array( + '#type' => 'textfield', + '#title' => t('Logo image'), + '#description' => t('The path to your logo image from your Drupal root.') .' '. + t('If you use this, the logo will appear at the top of digest emails.'), + '#default_value' => variable_get('digests_logo', ''), + ); + if (module_exists('token')) { + $form['token_help'] = array( + '#title' => t('Replacement patterns'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['token_help']['global'] = array( + '#title' => t('Global'), + '#description' => t('You can use these tokens in the email header or footer.'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['token_help']['global']['help'] = array( + '#value' => theme('token_help', 'global'), + ); + $form['token_help']['user'] = array( + '#title' => t('Recipient user'), + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['token_help']['user']['help'] = array( + '#value' => theme('token_help', 'user'), + ); + } + $form['digests_header'] = array( + '#type' => 'textarea', + '#title' => t('Email header'), + '#rows' => 2, + '#default_value' => variable_get('digests_header', ''), + ); + $form['digests_footer'] = array( + '#type' => 'textarea', + '#title' => t('Email footer'), + '#rows' => 2, + '#default_value' => variable_get('digests_footer', ''), + ); + return system_settings_form($form); +} + +/** + * Validates the administrative options. + */ +function digests_admin_validate($form, $form_state) { + $v = $form_state['values']['digests_limit']; + if (!empty($v) && (!is_numeric($v) || $v < 0)) { + form_set_error('digests_limit', t('The maximum number of users to which to send digests per cron run must be a positive integer.')); + } +} + +/** + * Returns a list of the hours of the day formatted by the site's preference. + */ +function _digests_get_hours() { + $range = range(0, 23); + $date_format = variable_get('date_format_long', 'l, F j, Y - H:i'); + $hour_format = 'H'; // e.g. 00 + foreach (array('a', 'A', 'g', 'h') as $c) { + if (strpos($date_format, $c) !== FALSE) { + $hour_format = 'ga'; // e.g. 12am + break; + } + } + $options = array(); + foreach ($range as $num) { + $options[$num] = date($hour_format, mktime($num, 0, 0)); + } + return $options; +} diff --git a/digests.cron.inc b/digests.cron.inc new file mode 100644 index 0000000..81ccced --- /dev/null +++ b/digests.cron.inc @@ -0,0 +1,197 @@ + $send_time + $default_tz || $now < $send_time + $default_tz - 43200; // whether it's past send_time in the site's default timezone + $query = " + SELECT * + FROM {users} u + LEFT JOIN {digests} d + ON u.uid = d.uid + WHERE + status = 1 AND ( /* user is not blocked */ + send_interval IS NULL OR /* user has not set their interval */ + send_interval = 86400". /* user's interval is daily */ + (date('w') == 0 ? ' OR send_interval = 604800' : '') ." /* user's interval is weekly, and it's Sunday */ + ) AND ( + %d > last_sent + (COALESCE(send_interval, 86400) - 43200) OR /* it's been at least (interval - 12 hours) since the last digest email */ + last_sent IS NULL /* the user has never been sent a digest email */ + )"; + if (variable_get('digests_local', 'local') == 'local') { + $query .= " AND ( + %d /* NOW */ > %d /* SEND */ + timezone OR /* it's after send_time today */ + %d /* NOW */ < %d /* SEND */ + timezone - 43200 /* it's more than 12hrs before send_time today, i.e. less than 12hrs since send_time yesterday */ + "; + if ($default) { + $query .= " OR timezone IS NULL /* the user has not set a timezone, fall back to the site default */"; + } + $query .= "\n )"; + if (variable_get('digests_limit', 250)) { + $result = db_query_range($query, $now, $now, $send_time, $now, $send_time, 0, variable_get('digests_limit', 250)); + } + else { + $result = db_query($query, $now, $now, $send_time, $now, $send_time); + } + } + elseif ($default) { + if (variable_get('digests_limit', 250)) { + $result = db_query_range($query, 0, variable_get('digests_limit', 250)); + } + else { + $result = db_query($query); + } + } + + // Step 2: For each selected user, collect all activity that has been updated between 6PM 2 days ago and 6PM yesterday + while ($account = db_fetch_object($result)) { + if (empty($account) || empty($account->uid) || !valid_email_address($account->mail)) { + continue; + } + $account = drupal_unpack($account); + $account->roles = array(); + $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user'; + $rresult = db_query('SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d', $account->uid); + while ($role = db_fetch_object($rresult)) { + $account->roles[$role->rid] = $role->name; + } + if (!user_access('receive digests', $account)) { + continue; + } + $account_tz = $default_tz; + if (isset($account->timezone) && !is_null($account->timezone)) { + $account_tz = $account->timezone; + } + $interval = 86400; + if (isset($account->send_interval) && !is_null($account->send_interval)) { + $interval = $account->send_interval; + } + $send_time_account = $send_time + $account_tz; + $send_time_two_days_ago = $send_time_account - (86400 + $interval); + $send_time_one_day_ago = $send_time_account - 86400; + $mresult = db_query(" + SELECT * + FROM {activity_log_messages} m + LEFT JOIN {activity_log_templates} t + ON m.tid = t.tid + WHERE + display_type = 'email' AND + stream_owner_type = 'user' AND + stream_owner_id = %d AND + last_updated > %d /* 2 days ago */ AND + last_updated < %d /* 1 day ago */ AND ( + viewer_id = %d /* account */ OR + viewer_id = 0 /* everyone */ OR + (viewer_id < 0 AND viewer_id <> -%d) /* everyone except account */ + ) AND + t.pid NOT IN ( + SELECT pid FROM {activity_log_disabled_types} WHERE uid = %d + ) + ORDER BY last_updated DESC + ", $account->uid, $send_time_two_days_ago, $send_time_one_day_ago, $account->uid, $account->uid, $account->uid); + + // Step 3: Render the collected activity messages as HTML + $messages = array(); + while ($record = db_fetch_object($mresult)) { + $messages[] = $record; + } + if (empty($messages)) { + continue; + } + $output = theme('digests_email', $account, $messages, $now); + + // Step 4: Pass the rendered activity stream to the Mime Mail module for delivery + if ($interval == 86400) { + $subject = t('Your @site activity for @date', array( + '@site' => variable_get('site_name', 'Drupal'), + '@date' => date('l, F j'), + )); + } + elseif ($interval == 604800) { + $subject = t('Your @site activity for the week of @date', array( + '@site' => variable_get('site_name', 'Drupal'), + '@date' => date('F j'), + )); + } + mimemail( + variable_get('site_mail', ini_get('sendmail_from')), //sender + $account, // recipient + $subject, // subject + $output, // HTML for body + NULL, // force plaintext only + array(), // headers + NULL, // custom plaintext version + array(), // attachments + 'digests' // mailkey + ); + + // Step 5: Update the "last sent" time for each processed user + db_query("UPDATE {digests} SET last_sent = %d WHERE uid = %d", $now, $account->uid); + if (db_affected_rows() <= 0) { + $insert = (object) array( + 'uid' => $account->uid, + 'last_sent' => $now, + 'send_interval' => 86400, + ); + drupal_write_record('digests', $insert); + } + } +} + +/** + * Preprocess the digest email template variables. + */ +function template_preprocess_digests_email(&$vars) { + $output = ''; + $count = 0; + foreach ($vars['messages'] as $message) { + $count++; + activity_log_record_unpack($message); + $html_message = theme('activity_log_item', $message); + $output .= ''. $html_message ."\n"; + } + $vars['stream'] = $output; + $account = $vars['account']; + $vars['name'] = check_plain($account->name); + $vars['name_link'] = l(check_plain($account->name), 'user/'. $account->uid); + $now = $vars['now']; + $vars['date_small'] = format_date($now, 'small'); + $vars['date_medium'] = format_date($now, 'medium'); + $vars['date_large'] = format_date($now, 'large'); + $vars['logo'] = variable_get('digests_logo', '') ? '' : theme( + 'image', + url(variable_get('digests_logo', ''), array('absolute' => TRUE)), + variable_get('site_name', 'Drupal'), + variable_get('site_name', 'Drupal'), + NULL, + FALSE + ); + $header = variable_get('digests_header', ''); + $footer = variable_get('digests_footer', ''); + if (module_exists('token')) { + $types = array('global' => NULL, 'user' => $account); + $header = token_replace_multiple($header, $types); + $footer = token_replace_multiple($footer, $types); + } + $vars['header'] = filter_xss_admin($header); + $vars['footer'] = filter_xss_admin($footer); + $vars['unsubscribe'] = t('Edit your settings to unsubscribe from activity emails from @site.', array( + '!unsub' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE)), + '@site' => variable_get('site_name', 'Drupal'), + )); +} diff --git a/digests.info b/digests.info new file mode 100644 index 0000000..c8afcb8 --- /dev/null +++ b/digests.info @@ -0,0 +1,6 @@ +name = Activity Log Digests +description = "Sends users regularly-scheduled email digests of recent, relevant site activity in multi-part HTML." +dependencies[] = activity_log +dependencies[] = mimemail +package = Activity Log +core = 6.x diff --git a/digests.install b/digests.install new file mode 100644 index 0000000..5fdfc2b --- /dev/null +++ b/digests.install @@ -0,0 +1,73 @@ + 'Stores log templates.', + 'fields' => array( + 'uid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'unsigned' => TRUE, + 'default' => 0, + 'description' => 'The public name ID.', + ), + 'send_interval' => array( + 'type' => 'int', + 'not null' => TRUE, + 'unsigned' => TRUE, + 'default' => 0, + 'description' => 'The public name ID.', + ), + 'last_sent' => array( + 'type' => 'int', + 'not null' => TRUE, + 'unsigned' => TRUE, + 'default' => 0, + 'description' => 'The public name ID.', + ), + ), + 'indexes' => array( + 'last_sent' => array('last_sent'), + ), + 'primary key' => array('uid'), + ); + return $schema; +} + +/** + * Implementation of hook_install(). + */ +function digests_install() { + drupal_install_schema('digests'); + // Run after Notifications so we can change its user settings form fieldset title. + db_query("UPDATE {system} SET weight = 1 WHERE type = 'module' AND name = 'digests'"); + drupal_set_message( + st('The Activity Log Digests module has been installed.') .' '. + st('You will probably want to configure the digest email settings.', array( + '!configure' => url('admin/settings/digests') + )) + ); +} + +/** + * Implementation of hook_uninstall(). + */ +function digests_uninstall() { + drupal_uninstall_schema('digests'); + variable_del('digests_send_time'); + variable_del('digests_local'); + variable_del('digests_limit'); + variable_del('digests_css'); + variable_del('digests_logo'); + variable_del('digests_header'); + variable_del('digests_footer'); +} diff --git a/digests.module b/digests.module new file mode 100644 index 0000000..f0f0b35 --- /dev/null +++ b/digests.module @@ -0,0 +1,86 @@ + 'Activity Log Digests', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('digests_admin'), + 'access arguments' => array('administer site configuration'), + 'description' => 'Allows administrators to adjust settings for Activity Log Digests.', + 'file' => 'digests.admin.inc', + ); + return $items; +} + +/** + * Implementation of hook_perm(). + */ +function digests_perm() { + return array('receive digests', 'set custom CSS for digests'); +} + +/** + * Implementation of hook_cron(). + */ +function digests_cron() { + module_load_include('inc', 'digests', 'digests.cron'); + _digests_cron(); +} + +/** + * Implementation of hook_user(). + */ +function digests_user($op, &$edit, &$account, $category = NULL) { + if ($op == 'form' && $category == 'account') { + module_load_include('inc', 'digests', 'digests.user_settings'); + return _digests_user_form($account->uid); + } + elseif ($op == 'update' && isset($edit['digests_interval'])) { + module_load_include('inc', 'digests', 'digests.user_settings'); + _digests_user_update($edit, $account->uid); + } +} + +/** + * Implementation of hook_theme(). + */ +function digests_theme($existing, $type, $theme, $path) { + return array( + 'digests_email' => array( + 'arguments' => array( + 'account' => NULL, + 'messages' => array(), + 'now' => time(), + ), + 'template' => 'digests-email', + 'file' => 'digests.cron.inc', + ), + ); +} + +/** + * Override the crazy custom CSS that Mime Mail tries to do. + */ +function digests_preprocess_mimemail_message(&$vars) { + if ($vars['mailkey'] == 'mail-digests') { + $vars['css'] = ''; + } +} + +/** + * Implementation of hook_activity_log_display_types(). + */ +function digests_activity_log_display_types() { + return array( + 'email' => t('Email digests'), + ); +} diff --git a/digests.rules_defaults.inc b/digests.rules_defaults.inc new file mode 100644 index 0000000..78ec99d --- /dev/null +++ b/digests.rules_defaults.inc @@ -0,0 +1,3844 @@ + $rules); +} + +/** + * Node creation + * + * Modified from export: #label, #conditions + */ +function digests_rules_defaults_node_insert() { + $ret = array( + 'rules_activity_log_digests_node_insert' => + array ( + '#type' => 'rule', + '#set' => 'event_node_insert', + '#label' => 'Email: Log activity when a node is created'. (module_exists('og') ? ' (not in a group)' : ''), + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'node', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + 0 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Updated content is published', + 'arguments' => + array ( + 'node' => + array ( + 'type' => 'node', + 'label' => 'Content', + ), + ), + 'module' => 'Node', + ), + '#name' => 'rules_condition_content_is_published', + '#settings' => + array ( + '#argument map' => + array ( + 'node' => 'node', + ), + ), + '#type' => 'condition', + ), + ), + '#actions' => + array ( + 0 => + array ( + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[author:uid]', + 'display_type' => 'email', + 'tid' => '15', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'author', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + '#weight' => 0, + ), + 1 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'node terms' => 'node terms', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '16', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for related taxonomy terms', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + 2 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the acting user\'s relationships', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user relationships' => 'acting user relationships', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '17', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + ), + '#version' => 6003, + ), + ); + if (module_exists('og')) { + $ret['rules_activity_log_digests_node_insert']['#conditions'][] = array ( + '#type' => 'condition', + '#settings' => + array ( + '#argument map' => + array ( + 'group' => 'node', + ), + ), + '#name' => 'og_rules_condition_content_is_group_post', + '#info' => + array ( + 'label' => 'Content is a group post', + 'arguments' => + array ( + 'group' => + array ( + 'type' => 'node', + 'label' => 'Group post', + ), + ), + 'module' => 'Organic groups', + ), + '#negate' => 1, + '#weight' => 0, + ); + } + return $ret; +} + +/** + * Node creation in a group + */ +function digests_rules_defaults_node_insert_og() { + return array( + 'rules_activity_log_digests_node_insert_og' => + array ( + '#type' => 'rule', + '#set' => 'event_node_insert', + '#label' => 'Email: Log activity when a node is created in a group', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'node', + 2 => 'og', + 3 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + 0 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Updated content is published', + 'arguments' => + array ( + 'node' => + array ( + 'type' => 'node', + 'label' => 'Content', + ), + ), + 'module' => 'Node', + ), + '#name' => 'rules_condition_content_is_published', + '#settings' => + array ( + '#argument map' => + array ( + 'node' => 'node', + ), + ), + '#type' => 'condition', + ), + 1 => + array ( + '#type' => 'condition', + '#settings' => + array ( + '#argument map' => + array ( + 'group' => 'node', + ), + ), + '#name' => 'og_rules_condition_content_is_group_post', + '#info' => + array ( + 'label' => 'Content is a group post', + 'arguments' => + array ( + 'group' => + array ( + 'type' => 'node', + 'label' => 'Group post', + ), + ), + 'module' => 'Organic groups', + ), + '#weight' => 0, + ), + ), + '#actions' => + array ( + 0 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title] in [node:ogname-title-link]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[author:uid]', + 'display_type' => 'email', + 'tid' => '15', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'author', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + 1 => + array ( + '#info' => + array ( + 'label' => 'Log activity for active group', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'active group' => 'active group', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '18', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + '#weight' => 0, + ), + 2 => + array ( + '#weight' => 0, + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title] in [node:ogname-title-link]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'active group members' => 'active group members', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '19', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for members of the active group', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + ), + 3 => + array ( + '#info' => + array ( + 'label' => 'Log activity for related taxonomy terms', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[author:user] added the [node:type-name] [node:title] in [node:ogname-title-link]
+
[node:since] ago
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'node terms' => 'node terms', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '20', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'node', + 1 => 'author', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + '#weight' => 0, + ), + ), + '#version' => 6003, + ), + ); +} + +/** + * Self status update + */ +function digests_rules_defaults_facebook_status_insert_user_self() { + return array( + 'rules_activity_log_digests_facebook_status_insert_user_self' => + array ( + '#type' => 'rule', + '#set' => 'event_facebook_status_save', + '#label' => 'Email: Log activity when a user saves a personal status update', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'facebook_status', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + 0 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'User updated their own status', + 'label callback' => false, + 'arguments' => + array ( + 'status' => + array ( + 'type' => 'facebook_status', + 'label' => 'The status', + ), + ), + 'module' => 'Facebook-style Statuses', + ), + '#name' => 'fbss_rules_is_self', + '#settings' => + array ( + '#argument map' => + array ( + 'status' => 'status', + ), + ), + '#type' => 'condition', + ), + ), + '#actions' => + array ( + 0 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'mentioned users' => 'mentioned users', + 'hashtag terms' => 'hashtag terms', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'status recipient' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 0, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '21', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + 1 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the acting user\'s relationships', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user relationships' => 'acting user relationships', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'hashtag terms' => 0, + 'status recipient' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '22', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + ), + '#version' => 6003, + ), + ); +} + +/** + * Other status update + */ +function digests_rules_defaults_facebook_status_insert_other() { + return array ( + 'rules_activity_log_digests_facebook_status_insert_other' => + array ( + '#type' => 'rule', + '#set' => 'event_facebook_status_save', + '#label' => 'Email: Log activity when a user sends a status message', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'facebook_status', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + 0 => + array ( + '#negate' => 1, + '#weight' => 0, + '#type' => 'condition', + '#settings' => + array ( + '#argument map' => + array ( + 'status' => 'status', + ), + ), + '#name' => 'fbss_rules_is_self', + '#info' => + array ( + 'label' => 'User updated their own status', + 'label callback' => false, + 'arguments' => + array ( + 'status' => + array ( + 'type' => 'facebook_status', + 'label' => 'The status', + ), + ), + 'module' => 'Facebook-style Statuses', + ), + ), + ), + '#actions' => + array ( + 0 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the recipient and @mentioned users', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] » [status:recipient-link] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'mentioned users' => 'mentioned users', + 'hashtag terms' => 'hashtag terms', + 'status recipient' => 'status recipient', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '[status:recipient-id]', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 0, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '21', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + 1 => + array ( + '#weight' => 0, + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[status:sender-themed] wrote a message to [status:recipient-link]
+
[status:created]
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'hashtag terms' => 0, + 'status recipient' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '22', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + ), + 2 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for members of the active group', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] » [status:recipient-link] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'active group members' => 'active group members', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'hashtag terms' => 0, + 'status recipient' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '23', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + ), + '#version' => 6003, + ), + ); +} + +/** + * Self status update with attachment + */ +function digests_rules_defaults_fbsmp_insert_user_self() { + return array( + 'rules_activity_log_digests_fbsmp_insert_user_self' => + array ( + '#type' => 'rule', + '#set' => 'event_fbsmp_add_status', + '#label' => 'Email: Log activity when a user saves a personal status update with an attachment', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'fbsmp', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + 0 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'User updated their own status', + 'label callback' => false, + 'arguments' => + array ( + 'status' => + array ( + 'type' => 'facebook_status', + 'label' => 'The status', + ), + ), + 'module' => 'Facebook-style Statuses', + ), + '#name' => 'fbss_rules_is_self', + '#settings' => + array ( + '#argument map' => + array ( + 'status' => 'status', + ), + ), + '#type' => 'condition', + ), + ), + '#actions' => + array ( + 0 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 0, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '21', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + 1 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the acting user\'s relationships', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user relationships' => 'acting user relationships', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '22', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + ), + '#version' => 6003, + ), + ); +} + +/** + * Other status update with attachment + */ +function digests_rules_defaults_fbsmp_insert_other() { + return array( + 'rules_activity_log_digests_fbsmp_insert_other' => + array ( + '#type' => 'rule', + '#set' => 'event_fbsmp_add_status', + '#label' => 'Email: Log activity when a user sends a status message with an attachment', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'fbsmp', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + 0 => + array ( + '#name' => 'fbss_rules_is_self', + '#info' => + array ( + 'label' => 'User updated their own status', + 'label callback' => false, + 'arguments' => + array ( + 'status' => + array ( + 'type' => 'facebook_status', + 'label' => 'The status', + ), + ), + 'module' => 'Facebook-style Statuses', + ), + '#settings' => + array ( + '#argument map' => + array ( + 'status' => 'status', + ), + ), + '#type' => 'condition', + '#weight' => 0, + '#negate' => 1, + ), + ), + '#actions' => + array ( + 0 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] » [status:recipient-link] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'mentioned users' => 'mentioned users', + 'hashtag terms' => 'hashtag terms', + 'status recipient' => 'status recipient', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '[status:recipient-id]', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 0, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '21', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for the recipient and @mentioned users', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + 1 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[status:sender-themed] sent a [attachment:attachment-type] to [status:recipient-link]
+
[status:created]
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[status:sender-uid]', + 'display_type' => 'email', + 'tid' => '22', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => 'attachment', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + 2 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => '', + 'templates' => + array ( + 'en' => + array ( + 'template' => ' + + +
[status:sender-picture] +
[status:sender-themed] » [status:recipient-link] [status:message-formatted]
+
[status:created-small] Reply
+
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'none', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'active group members' => 'active group members', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'hashtag terms' => 0, + 'status recipient' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'mentioned users' => 0, + 'status recipient' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '23', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'status', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for members of the active group', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + ), + '#version' => 6003, + ), + ); +} + +/** + * Join group + */ +function digests_rules_defaults_og_join() { + return array( + 'rules_activity_log_digests_og_join' => + array ( + '#type' => 'rule', + '#set' => 'event_og_user_insert', + '#label' => 'Email: Log activity when a user joins a group', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'og', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + ), + '#actions' => + array ( + 0 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => 'Joining a group', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[account:user] joined the group [group:title-link]
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'user_action', + 'group_interval' => '259200', + 'group_max' => '10', + 'group_summary' => '[group:title-link]', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[account:user] joined the groups [collection]
', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[account:uid]', + 'display_type' => 'email', + 'tid' => '24', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => 'group', + 1 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'account', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'account', + 1 => 'group', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => 'account', + 1 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + 1 => + array ( + '#info' => + array ( + 'label' => 'Log activity for the acting user\'s relationships', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => 'Joining a group', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[account:user] joined the group [group:title-link]
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'user_action', + 'group_interval' => '259200', + 'group_max' => '10', + 'group_summary' => '[group:title-link]', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[account:user] joined the groups [collection]
', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user relationships' => 'acting user relationships', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[account:uid]', + 'display_type' => 'email', + 'tid' => '25', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => 'group', + 1 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'account', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'account', + 1 => 'group', + 2 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => 'account', + 1 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + '#weight' => 0, + ), + 2 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the joined group', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => 'Joining a group', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[account:user] joined the group
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'target_action', + 'group_interval' => '86400', + 'group_max' => '100', + 'group_summary' => '', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[names] joined the group
', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'active group' => 'active group', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + 'node terms' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '', + 'display_type' => 'email', + 'tid' => '26', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'account', + 1 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + ), + '#version' => 6003, + ), + ); +} + +/** + * Request relationship + */ +function digests_rules_defaults_ur_request() { + return array( + 'rules_activity_log_digests_ur_request' => + array ( + '#type' => 'rule', + '#set' => 'event_user_relationships_request', + '#label' => 'Email: Log activity when a user creates a relationship', + '#active' => 1, + '#weight' => '0', + '#categories' => + array ( + 0 => 'activity_log', + 1 => 'user_relationships', + 2 => 'digests', + ), + '#status' => 'custom', + '#conditions' => + array ( + ), + '#actions' => + array ( + 0 => + array ( + '#type' => 'action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => 'New user relationships', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[requester:user] [relationship:relationship-name]ed [requestee:user]
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'user_action', + 'group_interval' => '86400', + 'group_max' => '10', + 'group_summary' => '[requestee:user]', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[requester:user] [relationship:relationship-name]ed [collection]
', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user' => 'acting user', + 'custom' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'everyone' => 'everyone', + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'stream_owner' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[requester:uid]', + 'display_type' => 'email', + 'tid' => '27', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => 'requestee', + 1 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'requester', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'requester', + 1 => 'requestee', + 2 => 'relationship', + 3 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => 'requester', + 1 => 'relationship', + 2 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#name' => 'activity_log_log_action', + '#info' => + array ( + 'label' => 'Log activity for the acting user', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#weight' => 0, + ), + 1 => + array ( + '#weight' => 0, + '#info' => + array ( + 'label' => 'Log activity for the acting user\'s relationships', + 'label callback' => false, + 'module' => 'Activity Log', + 'eval input' => + array ( + 0 => 'placeholder', + 1 => 'grouping|group_summary', + 2 => 'visibility|stream_owner_id', + 3 => 'visibility|viewer_id', + 4 => 'acting_uid', + 5 => 'templates|en|template', + 6 => 'grouping|templates|en|template', + ), + ), + '#name' => 'activity_log_log_action', + '#settings' => + array ( + 'placeholder' => '#!ACTIVITY_LOG_DELIMITER:', + 'public_name' => 'New user relationships', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[requester:user] [relationship:relationship-name]ed [requestee:user]
', + ), + ), + 'grouping' => + array ( + 'group_method' => 'user_action', + 'group_interval' => '86400', + 'group_max' => '10', + 'group_summary' => '[requestee:user]', + 'collapse_method' => 'activity_log_collapse_inline', + 'templates' => + array ( + 'en' => + array ( + 'template' => '
[requester:user] [relationship:relationship-name]ed [collection]
', + ), + ), + ), + 'visibility' => + array ( + 'stream_owner_entity_group' => + array ( + 'acting user relationships' => 'acting user relationships', + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'active group' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'stream_owner_id' => '', + 'stream_owner_type' => 'user', + 'viewer_entity_group' => + array ( + 'stream_owner' => 'stream_owner', + 'everyone' => 0, + 'everyone_except_active' => 0, + 'everyone_except_custom' => 0, + 'custom' => 0, + 'acting user' => 0, + 'target entity' => 0, + 'not_stream_owner' => 0, + 'active group members' => 0, + 'active group admin' => 0, + 'acting user relationships' => 0, + 'custom user relationships' => 0, + 'acting user relationships 1' => 0, + 'custom user relationships 1' => 0, + 'active group relationships acting user' => 0, + 'active group relationships custom user' => 0, + 'active group relationships 1 acting user' => 0, + 'active group relationships 1 custom user' => 0, + ), + 'viewer_id' => '', + ), + 'cache' => + array ( + 'cache' => 1, + 'resources' => '', + ), + 'acting_uid' => '[requester:uid]', + 'display_type' => 'email', + 'tid' => '28', + '#eval input' => + array ( + 'token_rules_input_evaluator' => + array ( + 'placeholder' => + array ( + 0 => ':global', + ), + 'grouping|group_summary' => + array ( + 0 => 'requestee', + 1 => ':global', + ), + 'visibility|stream_owner_id' => + array ( + 0 => ':global', + ), + 'visibility|viewer_id' => + array ( + 0 => ':global', + ), + 'acting_uid' => + array ( + 0 => 'requester', + 1 => ':global', + ), + 'templates|en|template' => + array ( + 0 => 'requester', + 1 => 'requestee', + 2 => 'relationship', + 3 => ':global', + ), + 'grouping|templates|en|template' => + array ( + 0 => 'requester', + 1 => 'relationship', + 2 => ':global', + ), + ), + 'activity_log_input_evaluator_process' => + array ( + 'placeholder' => true, + 'grouping|group_summary' => true, + 'visibility|stream_owner_id' => true, + 'visibility|viewer_id' => true, + 'acting_uid' => true, + 'templates|en|template' => true, + 'grouping|templates|en|template' => true, + ), + ), + ), + '#type' => 'action', + ), + ), + '#version' => 6003, + ), + ); +} diff --git a/digests.user_settings.inc b/digests.user_settings.inc new file mode 100644 index 0000000..a4e32e2 --- /dev/null +++ b/digests.user_settings.inc @@ -0,0 +1,73 @@ + 'value', + '#value' => $interval, + ); + $form['digests'] = array( + '#type' => 'fieldset', + '#title' => t('Activity digest settings'), + '#collapsible' => TRUE, + '#weight' => 5, + ); + $form['digests']['digests_interval'] = array( + '#type' => 'select', + '#title' => t('Receive digests of interesting activity'), + '#default_value' => empty($interval) ? 86400 : $interval, + '#options' => array( + 86400 => t('Daily'), + 604800 => t('Weekly'), + 0 => t('Never'), + ), + ); + return $form; +} + +/** + * Saves users' digest settings. + */ +function _digests_user_update(&$edit, $uid) { + $v = $edit['digests_interval']; + $lv = $edit['digests_last_interval']; + unset($edit['digests_interval'], $edit['digests_last_interval']); + if ($v !== $lv) { + db_query("UPDATE {digests} SET send_interval = %d WHERE uid = %d", $v, $uid); + if (db_affected_rows() <= 0) { + $insert = (object) array( + 'uid' => $uid, + 'last_sent' => 0, + 'send_interval' => $v, + ); + drupal_write_record('digests', $insert); + } + } +}