t("OG: Group ID"), 'keyword' => 'group', 'description' => t('Creates a group context from a group ID argument.'), 'context' => 'og_argument_gid_context', 'placeholder form' => array( '#type' => 'textfield', '#description' => t('Enter the group ID of a group for this argument'), ), ); /** * Discover if this argument gives us the group we crave. */ function og_argument_gid_context($arg = NULL, $conf = NULL, $empty = FALSE) { // If unset it wants a generic, unfilled context. if ($empty) { return ctools_context_create_empty('og_group'); } // We can accept either a group object or a pure gid. if (is_object($arg)) { return ctools_context_create('og_group', $arg); } if (!is_numeric($arg)) { return FALSE; } $group = og_get_group('group', $arg); if (!$group) { return FALSE; } return ctools_context_create('og_group', $group); }