Index: og.module =================================================================== --- og.module (.../vendor/contributions/modules/og/og.module) (revision 104) +++ og.module (.../trunk/modules/og/og.module) (revision 104) @@ -833,7 +833,7 @@ else { $where = "n.type NOT IN ('" . implode("','", variable_get('og_node_types', array('og'))) . "')"; } - + if (NULL == $group_by) $group_by = 'group by n.nid'; // we LEFT JOIN to node_comment_stats in case comment.module is disabled. return "SELECT n.nid, n.title, n.uid, u.name, u.picture, n.created, l.comment_count, l.last_comment_timestamp FROM {node} n LEFT JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.status=1 AND $where $group_by ORDER BY n.sticky DESC, l.last_comment_timestamp DESC"; } @@ -1495,17 +1495,20 @@ // public nodes to display on the home page for non subscribers // we INSERT a broad grant here but og_node_grants() only issues it selectively for a given operation if (is_array($node->og_groups)) { + $groups = array(); foreach ($node->og_groups as $gid => $checked) { if ($checked) { $sql = "INSERT INTO {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, 'og_subscriber', 1, 1, 1)"; db_query($sql, $node->nid, $gid); - + $groups[] = node_load($gid); if ($node->og_public) { $sql = "INSERT INTO {node_access} (nid, gid, realm, grant_view) VALUES (%d, 0, 'og_public', %d)"; db_query($sql, $node->nid, $gid); } } } + $msg = theme('og_post_message',$node,$groups); + if ($msg) drupal_set_message($msg); } // if the public checkbox was selected, give a universal grant for this node @@ -1529,6 +1532,13 @@ } } +function theme_og_post_message($node,$groups) { + if (!count($groups)) return; + foreach ($groups as $group) { + $titles[] = $group->title; + } + return t('Posted to %groups.',array('%groups' => implode(', ',$titles))); +} // delete all existing grants for this module function og_delete_grants(&$node) { @@ -1808,7 +1818,7 @@ else { $links[] = t('This is a %closed group. The group administrators add/remove subscribers as needed.', array('%closed' => theme('placeholder', t('closed')))); } - $output .= theme('item_list', $links); + $output .= theme('og_item_list', array('gid' => $node->nid, 'type' => $node->type, 'region' => 'block_details'), $links); $block['content'] = $output; $block['subject'] = $node->title; @@ -1816,12 +1826,16 @@ } } +function theme_og_item_list($context,$links) { + return theme_item_list($links); +} + // $group is an object containing the group node function og_og_create_links($group) { foreach (node_get_types() as $type => $name) { $exempt = array_merge(variable_get('og_node_types', array('og')), variable_get('og_omitted', array())); if (!in_array($type, $exempt) && node_access('create', $type)) { - $links[] = l(t('create %type', array('%type' => $name)), "node/add/$type", array('title' => t('Add a new %s in this group.', array('%s' => $name))), "edit[og_groups][]=$group->nid"); + $links[$type] = l(t('create %type', array('%type' => $name)), "node/add/$type", array('title' => t('Add a new %s in this group.', array('%s' => $name))), "edit[og_groups][]=$group->nid"); } } return $links ? $links : array();