? permalink-434952-screenshot.png
? permalink-434952.patch
Index: permalink.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/permalink/permalink.module,v
retrieving revision 1.3.2.1
diff -u -p -r1.3.2.1 permalink.module
--- permalink.module	11 Apr 2009 21:34:02 -0000	1.3.2.1
+++ permalink.module	16 Apr 2009 01:32:55 -0000
@@ -124,6 +124,7 @@ function permalink_admin_settings() {
   }
 
   // All permalinks
+  // nofollow link relation
   $form['permalink_nofollow'] = array(
     '#type' => 'checkbox',
     '#title'=> t('Make link nofollow'),
@@ -131,6 +132,14 @@ function permalink_admin_settings() {
     '#description' => t('Adds %nofollow to the permalink\'s attributes. Often used for search engine optimization purposes.', array('%nofollow' => 'rel="nofollow"')),
   );
 
+  // bookmark link relation
+  $form['permalink_bookmark'] = array(
+    '#type' => 'checkbox',
+    '#title'=> t('Make link bookmark'),
+    '#default_value' => variable_get('permalink_bookmark', FALSE),
+    '#description' => t('Adds %bookmark to the permalink\'s attributes.', array('%bookmark' => 'rel="bookmark"')),
+  );
+
   return system_settings_form($form);
 }
 
@@ -264,9 +273,26 @@ function permalink_link_render($type, $o
   // Stop Drupal from looking up the alias to the path
   $link['alias'] = TRUE;
 
-  // Add rel="nofollow" to link if the option is enabled
-  if (variable_get('permalink_nofollow', TRUE)) {
-    $link['attributes']['rel'] = 'nofollow';
+  // Add link relations if enabled
+  if (variable_get('permalink_nofollow', TRUE) || variable_get('permalink_bookmark', FALSE)) {
+    $relations = '';
+
+    // Add nofollow link relation if the option is enabled
+    if (variable_get('permalink_nofollow', TRUE)) {
+      $relations .= 'nofollow';
+    }
+
+    // Ensure rel attribute is a whitespace-separated list
+    if (variable_get('permalink_nofollow', TRUE) && variable_get('permalink_bookmark', FALSE)) {
+      $relations .= ' ';
+    }
+
+    // Add bookmark link relation if the option is enabled
+    if (variable_get('permalink_bookmark', FALSE)) {
+      $relations .= 'bookmark';
+    }
+
+    $link['attributes']['rel'] = $relations;
   }
 
   return $link;
