The remove links currently include content such as parenthesis and a description of the relationship being altered. In some cases (such as in the Commons distribution) we want to simplify the text and markup here and present this button as a link. Simply styling the link isn't sufficient because the text describing the relationship is still present. As an example of this issue:
https://skitch.com/ezra-g/gdqps/bill-commons1
My initial thought was to add a configurable option to the settings for each relationship that make the description text optional in the unfollow links and then export the setting. However, since these settings are stored in {user_relationships}, adding a setting requires altering schema and I don't believe there is exportability of these settings.
As an alternative, let's make it possible to alter these links.
Here's a patch that defines a new hook_user_relationships_remove_link(), along with an example of how the Commons_core module would implement it to remove the undesired text:
/**
* Implementation of hook_user_relationships_remove_link_alter().
*/
function commons_core_user_relationships_remove_link_alter(&$list, $args) {
// Remove extra markup around the "remove" link so that it can be styled
// as a button.
foreach ($args[3] as $rid => $relationship) {
// TODO: Consider having a constant for the relationship ID.
if ($relationship->rtid == 1) {
$list[$relationship->rid] = theme('user_relationships_remove_link', $args[0]->uid, $relationship->rid);
}
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| ur_alter_remove_links.patch | 1.54 KB | ezra-g |
Comments
Comment #1
ezra-g commentedComment #3
ezra-g commentedSeems like the test-bot had an unrelated error trying to review this patch.
Comment #4
ezra-g commentedur_alter_remove_links.patch queued for re-testing.