? bookmarks_4.patch
? bookmarks_5.patch
Index: bookmarks.info
===================================================================
RCS file: bookmarks.info
diff -N bookmarks.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bookmarks.info	7 Nov 2007 21:24:34 -0000
@@ -0,0 +1,3 @@
+name = "Bookmarks"
+description = "Bookmarks any URL on your site"
+version = "5.x-1.x-dev"
\ No newline at end of file
Index: bookmarks.install
===================================================================
RCS file: bookmarks.install
diff -N bookmarks.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bookmarks.install	7 Nov 2007 21:24:34 -0000
@@ -0,0 +1,26 @@
+<?php
+function bookmarks_install() {
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      $result = db_query("CREATE TABLE {bookmarks} (
+                  uid int UNSIGNED NOT NULL,
+                  url varchar(128) NOT NULL,
+                  title varchar(128) NOT NULL
+      )");
+     
+      $result = db_query("ALTER TABLE bookmarks ADD INDEX (uid);");
+      break;
+    case 'pgsql': 
+        $result = db_query("CREATE TABLE {bookmarks} (
+                    uid SERIAL PRIMARY KEY,
+                    url VARCHAR(255) NOT NULL,
+                    title VARCHAR(255) NOT NULL
+        )");
+      break;
+  } 
+}
+
+function bookmarks_uninstall() {
+  $result = db_query("DROP TABLE {bookmarks}");
+}
Index: bookmarks.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bookmarks/bookmarks.module,v
retrieving revision 1.37.2.3
diff -u -r1.37.2.3 bookmarks.module
--- bookmarks.module	13 Apr 2006 15:45:05 -0000	1.37.2.3
+++ bookmarks.module	7 Nov 2007 21:24:34 -0000
@@ -97,10 +97,17 @@
 
     // Print bookmarks list as an item list
     $output = (count($bookmarks) ? theme('item_list', $bookmarks) : t('You have no bookmarks.'));
-    $links = array(
-      l(t('quick link'), "bookmarks/$user->uid/add/quick", array('title' => t('Bookmark the current page.')), 'title='. urlencode(drupal_get_title())),
-      l(t('manage'), "bookmarks/$user->uid")
+    $links['bookmarks_quick_link'] = array(
+      'title' => t("quick link"),
+      'href' => "bookmarks/$user->uid/add/quick",
+      'attributes' => array('title' => t('Bookmark the current page.')), 'title='. urlencode(drupal_get_title())
     );
+
+    $links['bookmarks_manage'] = array (
+      'title' => t("manage"),
+      'href' => "bookmarks/$user->uid"
+    );
+
     $output .= '<div class="links">'. theme("links", $links) .'</div>';
 
     return array(
@@ -125,7 +132,7 @@
   global $user;
 
   $query = 'url=' . urlencode($url). '&amp;block=1';
-  return l(theme('image', 'modules/bookmarks/trash.gif', t('delete')), "bookmarks/$user->uid/delete", array("title" => t("Delete this bookmark from your list.")), $query, NULL, FALSE, TRUE);
+  return l(theme('image', drupal_get_path("module","bookmarks") .'/trash.gif', t('delete')), "bookmarks/$user->uid/delete", array("title" => t("Delete this bookmark from your list.")), $query, NULL, FALSE, TRUE);
 }
 /**  @} End of addtogroup themeable **/
 
@@ -141,7 +148,7 @@
 function bookmarks_page() {
   global $user;
 
-  $edit = $_POST['edit'];
+  $edit = $_POST;
   $op   = $_POST['op'];
 
   switch (($op ? $op : arg(2))) {
@@ -154,12 +161,12 @@
       elseif (arg(3) == 'weblink') {
         $edit = bookmarks_load_weblink(arg(4));
       }
-      $output = bookmarks_form($edit);
+      $output = drupal_get_form('bookmarks_form', $edit);
       break;
 
     case 'edit':
       $title = t('Edit bookmark');
-      $output = ($url = urldecode($_GET['url'])) ? bookmarks_form(bookmarks_load($url)) : drupal_set_message(t('Bookmark cannot be edited, because it is not in your list.'), 'error');
+      $output = ($url = urldecode($_GET['url'])) ? drupal_get_form('bookmarks_form',bookmarks_load($url)) : drupal_set_message(t('Bookmark cannot be edited, because it is not in your list.'), 'error');
       break;
 
     case 'delete':
@@ -173,7 +180,7 @@
         drupal_goto("bookmarks/$user->uid");
       }
       else {
-        $output .= bookmarks_form($edit);
+        $output = drupal_get_form('bookmarks_form', $edit);
       }
       break;
 
@@ -232,7 +239,7 @@
     '#type' => 'submit',
     '#value' => t('Save'),
   );
-  return drupal_get_form('bookmarks_form', $form);
+  return $form;
 }
 
 function bookmarks_load($url) {
