function heartbeat_messages_export_messages in Heartbeat 6.4
Same name and namespace in other branches
- 6.3 heartbeat.admin.inc \heartbeat_messages_export_messages()
Function to export messages to use as default
1 call to heartbeat_messages_export_messages()
- heartbeat_messages_export in ./
heartbeat.admin.inc - Function to export messages to use as default
File
- ./
heartbeat.admin.inc, line 1446 - Admnistration tasks for heartbeat.
Code
function heartbeat_messages_export_messages($selected_messages) {
$messages = heartbeat_messages('all', TRUE, FALSE);
if (count($messages) == 0) {
return t('There are not heartbeat messages to export.');
}
$info = array();
foreach ($messages as $message) {
$message = (object) $message;
if (!$selected_messages['m_' . $message->hid]) {
continue;
// Leave if not selected
}
$concat_args = heartbeat_decode_message_variables($message->concat_args);
$variables = heartbeat_decode_message_variables($message->variables);
$attachments = unserialize($message->attachments);
$info[$message->hid] = array(
'message' => $message->message,
'message_concat' => $message->message_concat,
'message_id' => $message->message_id,
'concat_args' => $concat_args,
'description' => $message->description,
'perms' => $message->perms,
'custom' => HEARTBEAT_MESSAGE_DEFAULT,
'variables' => $variables,
'attachments' => $attachments,
);
}
return $info;
}