--- og.cvs.module 2008-03-05 15:56:27.000000000 -0500 +++ og.cvs.themed.module 2008-03-05 16:29:52.000000000 -0500 @@ -2522,38 +2522,50 @@ function og_og_block_details($node) { if ($subscription == 'active' || user_access('administer nodes')) { $links = module_invoke_all('og_create_links', $node); if ($node->og_selective < OG_INVITE_ONLY) { - $links[] = l(t('Invite friend'), "og/invite/$node->nid"); + $links['invite'] = l(t('Invite friend'), "og/invite/$node->nid"); } - $links[] = $txt; - $links[] = t('Manager: '). theme('username', $node); + $links['members'] = $txt; + $links['manager'] = t('Manager: '). theme('username', $node); $subscribe = isset($subscription) ? l(t('My membership'), "og/manage/$node->nid") : og_subscribe_link($node); if(isset($subscribe)) { - $links[] = $subscribe; + $links['my-membership'] = $subscribe; } if (module_exists('search') && user_access('search content')) { $post = drupal_get_form('og_search_form', $node); } } elseif ($subscription == 'requested') { - $links[] = t('Your membership request awaits approval.'); - $links[] = l(t('delete request'), "og/unsubscribe/$node->nid", array(), 'destination=og'); + $links['request-message'] = t('Your membership request awaits approval.'); + $links['request-delete'] = l(t('delete request'), "og/unsubscribe/$node->nid", array(), 'destination=og'); } elseif (!$user->uid) { $dest = drupal_get_destination(); - $links[] = t('You must register/login in order to post into this group.', array('!register' => url("user/register", $dest), '!login' => url("user/login", $dest))); + $links['register-needed'] = t('You must register/login in order to post into this group.', array('!register' => url("user/register", $dest), '!login' => url("user/login", $dest))); } elseif ($node->og_selective < OG_INVITE_ONLY) { - $links[] = og_subscribe_link($node); + $links['suscribe'] = og_subscribe_link($node); } else { - $links[] = t('This is a @closed group. The group administrators add/remove members as needed.', array('@closed' => t('closed'))); + $links['closed-message'] = t('This is a @closed group. The group administrators add/remove members as needed.', array('@closed' => t('closed'))); } - $block['content'] = theme('item_list', $links). $post; + $block['content'] = theme('og_og_block_details', $links, $post); $block['subject'] = $node->title; return $block; } +function theme_og_og_block_details($links, $post) { + // assign the last default order + $keys_order = array('invite', 'menbers', 'manager', 'my-membership', 'request-message', 'request-delete', 'register-needed', 'suscribe', 'closed-message'); + foreach ($keys_order as $link_name) { + if (isset($links[$link_name])) { + $processed_links[] = $links[$link_name]; + } + } + // include the post variable like the last default order + return theme('item_list', $processed_links). $post; +} + /** * Determine the number of active and pending members and the current user's membership state. * @@ -2601,7 +2613,7 @@ function og_og_create_links($group) { foreach (node_get_types() as $type) { // we used to check for node_access(create) but then node admins would get a false positive and see node types that they could not create if (!in_array($type->type, $exempt) && module_invoke(node_get_types('module', $type), 'access', 'create', $type)) { - $links[] = l(t('Create !type', array('!type' => $type->name)), "node/add/$type->type", array('title' => t('Add a new !s in this group.', array('!s' => $type->name))), "gids[]=$group->nid"); + $links["create-$type->name"] = l(t('Create !type', array('!type' => $type->name)), "node/add/$type->type", array('title' => t('Add a new !s in this group.', array('!s' => $type->name))), "gids[]=$group->nid"); } } return $links ? $links : array();