Index: modules/weblink/weblink.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/weblink/weblink.module,v
retrieving revision 1.63
diff -u -F^f -r1.63 weblink.module
--- modules/weblink/weblink.module	19 Jun 2004 10:53:37 -0000	1.63
+++ modules/weblink/weblink.module	24 Jun 2004 23:37:25 -0000
@@ -40,16 +40,6 @@ function weblink_help($section = "admin/
 function weblink_link($type, $node = 0) {
   $links = array();
   
-  // System menu items
-  if ($type == "system") {
-    if (user_access("create weblinks")) {
-      menu("node/add/weblink", t("weblink"), "node_page");
-    }
-    menu("weblink/blogmark/js", t("blogmark"), "weblink_blogmark_js", 0, MENU_HIDE);
-    menu("weblink/blogmark", t("blogmark"), "weblink_blogmark", 0, MENU_HIDE);
-    menu("weblink", t("weblink"), "weblink_page", 0, MENU_HIDE);
-  }
-
   // Node links for a weblink
   if ($type == "node" && $node->type == "weblink") {
     
@@ -216,7 +206,7 @@ function weblink_blogmark() {
     // Save node and note in the watchdog log
     $nid = node_save($node);
     if ($nid) {
-      watchdog("special", "{$node->type}: added '{$node->title}' blogmark", l(t("view post"), "node/view/$nid"));
+      watchdog("special", "{$node->type}: added '{$node->title}' blogmark", l(t("view post"), "node/$nid"));
       print theme("page", t("Thanks for your contribution to our blogmark collection. Now feel free to browse on or close this window."), t("Blogmark added"));
       return;
     }
@@ -412,10 +402,34 @@ function weblink_validate(&$node) {
   if (db_num_rows($result) > 0) {
     $weblink = db_fetch_object($result);
     $othernode = node_load(array("nid" => $weblink->nid));
-    return array("weblink" => theme("error", t("A weblink %link-to-existing with that link already exists", array("%link-to-existing" => l($othernode->title, "admin/node/edit/$othernode->nid")))));
+    return array("weblink" => theme("error", t("A weblink %link-to-existing with that link already exists", array("%link-to-existing" => l($othernode->title, "node/$othernode->nid/edit")))));
   }
 }
 
+/**
+ * Implementation of hook_menu().
+ */
+function weblink_menu() {
+  $items = array();
+
+  $items[] = array('path' => 'node/add/weblink', 'title' => t('weblink'),
+    'access' => user_access('create weblinks'));
+  $items[] = array('path' => 'weblink/blogmark/js', 'title' => t('blogmark'),
+    'access' => TRUE,
+    'callback' => 'weblink_blogmark_js',
+    'type' => MENU_CALLBACK);
+  $items[] = array('path' => 'weblink/blogmark', 'title' => t('blogmark'),
+    'access' => TRUE,
+    'callback' => 'weblink_blogmark',
+    'type' => MENU_CALLBACK);
+  $items[] = array('path' => 'weblink', 'title' => t('weblink'),
+    'access' => TRUE,
+    'callback' => 'weblink_page',
+    'type' => MENU_CALLBACK);
+
+  return $items;
+}
+
 function weblink_load($node) {
   return db_fetch_object(db_query("SELECT * FROM {weblink} WHERE nid = '%d'", $node->nid));
 }
@@ -491,7 +505,7 @@ function weblink_block_blogmarks($tid, $
   while($node = db_fetch_object($result)) {
     $node->body = htmlspecialchars($node->body);
     $comments = (int) module_invoke('comment', 'num_all', $node->nid);
-    $links[] = l($node->title, "weblink/goto/$node->nid", _weblink_attributes($node, 'body')) . " " . l("($comments)", "node/view/$node->nid", array('title' => format_plural($comments, '1 comment', '%count comments'), 'class' => "comment-count"));
+    $links[] = l($node->title, "weblink/goto/$node->nid", _weblink_attributes($node, 'body')) . " " . l("($comments)", "node/$node->nid", array('title' => format_plural($comments, '1 comment', '%count comments'), 'class' => "comment-count"));
   }
   
   $navlinks = array(l(t('read more'), "weblink/view/$tid"));
@@ -532,13 +546,13 @@ function weblink_monitor($site) {
 
   $url = "";
   if (!ereg("^http://|https://|ftp://", $node->weblink)) {
-    watchdog("warning", t("weblink") . ": " . t("invalid or missing URL for '%node'", array("%node" => $node->title)), l(t("edit site"), "admin/node/edit/". $node->nid));
+    watchdog("warning", t("weblink") . ": " . t("invalid or missing URL for '%node'", array("%node" => $node->title)), l(t("edit site"), "node/". $node->nid . "/edit"));
   } else {
     $url = $node->weblink;
   }
 
   if (!ereg("^http://|https://|ftp://", $node->feed) && !$url) {
-    watchdog("warning", t("weblink") . ": " . t("invalid or missing URL to monitor for '%node'", array("%node" => $node->title)), l(t("edit site"), "admin/node/edit/". $node->nid));
+    watchdog("warning", t("weblink") . ": " . t("invalid or missing URL to monitor for '%node'", array("%node" => $node->title)), l(t("edit site"), "node/". $node->nid ."/edit"));
   } else {
     // Overwrite previously set link
     $url = $node->weblink;
@@ -764,9 +778,9 @@ function theme_weblink_node_short($node)
   $output .= " - ". $node->weblink ."</dt>";
   $output .= "<dd>" . $node->teaser;
   $output .= "<div class=\"links\">(". format_plural($node->click, "1 hit", "%count hits") . " - ";
-  $output .= l(t("detail"), "node/view/$node->nid", array("title" => t("Read details, read and add comments.")));
+  $output .= l(t("detail"), "node/$node->nid", array("title" => t("Read details, read and add comments.")));
   if (user_access("administer nodes")) {
-    $output .=  " - " . l(t("administer"), "admin/node/edit/$node->nid", array("title" => t("Administer this node.")));  
+    $output .=  " - " . l(t("administer"), "node/$node->nid/edit", array("title" => t("Administer this node.")));  
   }
   $output .= ")</div>";
   $output .= "</dd>";
