Created
February 26, 2015 16:21
-
-
Save pcave/6385f4943ad8a5ee337e to your computer and use it in GitHub Desktop.
Message action load, attaching messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sba_message_action_node_load($nodes, $types) { | |
// If no message_action nodes are loaded no need to continue. | |
if (!in_array('sba_message_action', $types)) { | |
return; | |
} | |
// Add full messages to each node so we can utilize them later. | |
foreach ($nodes as $nid => $node) { | |
if ($node->type == 'sba_message_action') { | |
$messages = entity_load('sba_message', $node->message_ids); | |
$node->messages = $messages; | |
// Probably do some other stuff here, like look at the messages and | |
// determine if they're edtiable, etc. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment