--- og.5.4.module 2008-03-06 09:17:37.000000000 -0500
+++ og.5.4.themed.module 2008-03-06 09:15:50.000000000 -0500
@@ -2514,38 +2514,53 @@ 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['suscriptors'] = $txt;
+ $links['manager'] = t('Manager: '). theme('username', $node);
$subscribe = isset($subscription) ? l(t('My subscription'), "og/manage/$node->nid") : og_subscribe_link($node);
if(isset($subscribe)) {
- $links[] = $subscribe;
+ $links['my-subscription'] = $subscribe;
}
if (module_exists('search') && user_access('search content')) {
$post = drupal_get_form('og_search_form', $node);
}
}
elseif ($subscription == 'requested') {
- $links[] = t('Your subscription request awaits approval.');
- $links[] = l(t('delete request'), "og/unsubscribe/$node->nid", array(), 'destination=og');
+ $links['request-message'] = t('Your subscription 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 subscribers as needed.', array('@closed' => t('closed')));
+ $links['closed-message'] = t('This is a @closed group. The group administrators add/remove subscribers 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) {
+ // do not assign any order by default
+ $keys_order = array_keys($links);
+ // Maybe you want to do something like:
+ //$keys_order = array('create-', 'invite', 'suscriptors', 'manager', 'my-subscription', '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 subscribers and the current user's subscription state.
*
@@ -2593,7 +2608,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->type"] = 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();