function _add_posts_from_status($st, $prefixmatch, $stage, $stageflag)
{
global $muxed_posts;
if (isset($st[$stage])) {
foreach ($st[$stage] as $name => $t) {
if (substr($name, 0, strlen($prefixmatch)) !== $prefixmatch) {
continue;
}
$status = is_array($t) ? $t['status'] : '';
$post = GBPost::findByName($name, $status === 'deleted' ? null : 'work', false);
if ($post) {
if (!isset($muxed_posts[$post->name])) {
$muxed_posts[$post->name] = array();
}
$muxed_posts[$post->name][] = array($post, $stageflag . _mkflags($post, $status));
}
}
}
}