diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-02-15 11:40:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-02-15 11:40:19 +0000 |
commit | dc5843bd30a614cb074f70750ba2f631e61f8cb8 (patch) | |
tree | cd977b194f73b16e3dc1dfb40c9c9c5c1988f47f /modules/comment/comment.module | |
parent | e57b926e8d4385e399731159bd90f862962a86ab (diff) | |
download | brdo-dc5843bd30a614cb074f70750ba2f631e61f8cb8.tar.gz brdo-dc5843bd30a614cb074f70750ba2f631e61f8cb8.tar.bz2 |
- Patch #111347 by Steven: refactor url() and l().
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index f922d300e..91b7601fc 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -284,7 +284,7 @@ function comment_get_recent($number = 10) { function theme_comment_block() { $items = array(); foreach (comment_get_recent() as $comment) { - $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); + $items[] = l($comment->subject, 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)) .'<br />'. t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); } if ($items) { return theme('item_list', $items); @@ -443,7 +443,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) { case 'rss item': if ($node->comment != COMMENT_NODE_DISABLED) { - return array(array('key' => 'comments', 'value' => url('node/'. $node->nid, NULL, 'comments', TRUE))); + return array(array('key' => 'comments', 'value' => url('node/'. $node->nid, array('fragment' => 'comments', 'absolute' => TRUE)))); } else { return array(); @@ -538,7 +538,7 @@ function comment_admin_settings() { COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'), COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'), COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information')), - '#description' => t('This option is enabled when anonymous users have permission to post comments on the <a href="@url">permissions page</a>.', array('@url' => url('admin/user/access', NULL, 'module-comment'))), + '#description' => t('This option is enabled when anonymous users have permission to post comments on the <a href="@url">permissions page</a>.', array('@url' => url('admin/user/access', array('fragment' => 'module-comment')))), ); if (!user_access('post comments', user_load(array('uid' => 0)))) { $form['posting_settings']['comment_anonymous']['#disabled'] = TRUE; @@ -718,7 +718,7 @@ function comment_save($edit) { comment_invoke_comment($edit, 'update'); // Add an entry to the watchdog log. - watchdog('content', t('Comment: updated %subject.', array('%subject' => $edit['subject'])), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid'])); + watchdog('content', t('Comment: updated %subject.', array('%subject' => $edit['subject'])), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid']))); } else { // Check for duplicate comments. Note that we have to use the @@ -799,7 +799,7 @@ function comment_save($edit) { comment_invoke_comment($edit, 'insert'); // Add an entry to the watchdog log. - watchdog('content', t('Comment: added %subject.', array('%subject' => $edit['subject'])), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid'])); + watchdog('content', t('Comment: added %subject.', array('%subject' => $edit['subject'])), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid']))); } // Clear the cache so an anonymous user can see his comment being added. @@ -1187,10 +1187,10 @@ function comment_admin_overview($type = 'new', $arg) { while ($comment = db_fetch_object($result)) { $comments[$comment->cid] = ''; $comment->name = $comment->uid ? $comment->registered_name : $comment->name; - $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/'. $comment->nid, array('title' => truncate_utf8($comment->comment, 128)), NULL, 'comment-'. $comment->cid)); + $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/'. $comment->nid, array('title' => truncate_utf8($comment->comment, 128), 'fragment' => 'comment-'. $comment->cid))); $form['username'][$comment->cid] = array('#value' => theme('username', $comment)); $form['timestamp'][$comment->cid] = array('#value' => format_date($comment->timestamp, 'small')); - $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array(), $destination)); + $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array('query' => $destination))); } $form['comments'] = array('#type' => 'checkboxes', '#options' => isset($comments) ? $comments: array()); $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); @@ -1226,7 +1226,7 @@ function comment_admin_overview_submit($form_id, $form_values) { // Allow modules to respond to the updating of a comment. comment_invoke_comment($comment, $form_values['operation']); // Add an entry to the watchdog log. - watchdog('content', t('Comment: updated %subject.', array('%subject' => $comment->subject)), WATCHDOG_NOTICE, l(t('view'), 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid)); + watchdog('content', t('Comment: updated %subject.', array('%subject' => $comment->subject)), WATCHDOG_NOTICE, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid))); } } cache_clear_all(); @@ -1772,7 +1772,7 @@ function comment_controls_submit($form_id, $form_values) { function theme_comment($comment, $links = array()) { $output = '<div class="comment'. ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') .'">'; - $output .= '<div class="subject">'. l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") .' '. theme('mark', $comment->new) ."</div>\n"; + $output .= '<div class="subject">'. l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) . ' ' . theme('mark', $comment->new) ."</div>\n"; $output .= '<div class="credit">'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."</div>\n"; $output .= '<div class="body">'. $comment->comment .'</div>'; $output .= '<div class="links">'. theme('links', $links) .'</div>'; @@ -1782,7 +1782,7 @@ function theme_comment($comment, $links = array()) { function theme_comment_folded($comment) { $output = "<div class=\"comment-folded\">\n"; - $output .= ' <span class="subject">'. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") .' '. theme('mark', $comment->new) .'</span> '; + $output .= ' <span class="subject">'. l($comment->subject, comment_node_url() .'/'. $comment->cid, array('fragment' => "comment-$comment->cid")) . ' '. theme('mark', $comment->new) .'</span> '; $output .= '<span class="credit">'. t('by') .' '. theme('username', $comment) ."</span>\n"; $output .= "</div>\n"; return $output; @@ -1822,10 +1822,10 @@ function theme_comment_post_forbidden($nid) { } if (variable_get('user_register', 1)) { - return t('<a href="@login">Login</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', $destination), '@register' => url('user/register', $destination))); + return t('<a href="@login">Login</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination)))); } else { - return t('<a href="@login">Login</a> to post comments', array('@login' => url('user/login', $destination))); + return t('<a href="@login">Login</a> to post comments', array('@login' => url('user/login', array('query' => $destination)))); } } } |