--- bookmarks.module Thu Apr 13 17:45:06 2006
+++ bookmarks.module Sun May 27 11:21:20 2007
@@ -97,10 +98,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 .= '
'. theme("links", $links) .'
';
return array(
@@ -125,7 +134,7 @@
global $user;
$query = 'url=' . urlencode($url). '&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 +150,7 @@
function bookmarks_page() {
global $user;
- $edit = $_POST['edit'];
+ $edit = $_POST;
$op = $_POST['op'];
switch (($op ? $op : arg(2))) {
@@ -154,12 +163,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 +182,7 @@
drupal_goto("bookmarks/$user->uid");
}
else {
- $output .= bookmarks_form($edit);
+ $output = drupal_get_form('bookmarks_form', $edit);
}
break;
@@ -232,7 +241,7 @@
'#type' => 'submit',
'#value' => t('Save'),
);
- return drupal_get_form('bookmarks_form', $form);
+ return $form;
}
function bookmarks_load($url) {