Index: blogroll.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/blogroll/blogroll.module,v retrieving revision 1.3 diff -u -w -b -r1.3 blogroll.module --- blogroll.module 4 Jan 2005 03:03:47 -0000 1.3 +++ blogroll.module 9 Jan 2005 03:47:02 -0000 @@ -25,14 +25,16 @@ $items = array(); if ($may_cache) { - $items[] = array('path' => 'blogroll/edit', 'title' => t('edit blogroll'), - 'callback' => 'blogroll_edit', - 'access' => user_access('edit own blog'), // depends on blog.module - 'type' => MENU_CALLBACK); $items[] = array('path' => 'blogroll/script', 'title' => t('blogroll'), 'callback' => 'blogroll_script', 'access' => TRUE, 'type' => MENU_CALLBACK); + } else { + if ((arg(0) == 'user') and (is_numeric(arg(1)))) { + $items[] = array('path' => 'user/'. arg(1) .'/edit/blogroll', 'title' => t('blogroll'), + 'callback' => 'blogroll_edit', 'access' => $access || $user->uid == arg(1), + 'type' => MENU_LOCAL_TASK); + } } return $items; } @@ -40,7 +42,7 @@ /** * Menu callback; form for editing one's blogroll. */ -function blogroll_edit($uid = 0) { +function blogroll_edit() { global $user; $edit = $_POST['edit']; @@ -68,7 +70,7 @@ array('data' => ''. $roll->name .'', 'class' => 'rolled_blogs'), array('data' => $roll->weight, 'class' => 'weight'), // weight: +-10 , see modules/block.module for how to do it well. - array('data' => form($form, 'post', url('blogroll/edit')), 'class' => 'actions') + array('data' => form($form, 'post', url('user/'. arg(1) .'/edit/blogroll')), 'class' => 'actions') ); } if (!$rows) { @@ -86,7 +88,7 @@ $form .= form_textfield(t('Blog name'), 'name', $edit['name'], 64, 64); $form .= form_submit(t('Add blog')); $form .= "\n"; - $output .= form($form, 'post', url('blogroll/edit')); + $output .= form($form, 'post', url('user/'. arg(1) .'/edit/blogroll')); print theme('page', $output); } @@ -110,7 +112,7 @@ } $output .= t(''); if ($user->uid == $request_uid) { // owner viewing own blog - $output .= ''; + $output .= ''; } $block['subject'] = t('Blogroll'); $block['content'] = $output; ***** CVS exited normally with code 1 *****