From dc5843bd30a614cb074f70750ba2f631e61f8cb8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 15 Feb 2007 11:40:19 +0000 Subject: - Patch #111347 by Steven: refactor url() and l(). --- modules/aggregator/aggregator.module | 6 +++--- modules/blog/blog.module | 4 ++-- modules/blogapi/blogapi.module | 12 ++++++------ modules/comment/comment.module | 24 ++++++++++++------------ modules/contact/contact.module | 8 ++++---- modules/forum/forum.module | 6 +++--- modules/node/node.module | 12 ++++++------ modules/path/path.module | 6 +++--- modules/statistics/statistics.module | 4 ++-- modules/system/system.module | 12 ++++++------ modules/taxonomy/taxonomy.module | 15 ++++++++------- modules/tracker/tracker.module | 2 +- modules/upload/upload.module | 2 +- modules/user/user.module | 14 +++++++------- modules/watchdog/watchdog.module | 2 +- 15 files changed, 65 insertions(+), 64 deletions(-) (limited to 'modules') diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 51fa8ddb8..397e3650d 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -1212,7 +1212,7 @@ function aggregator_page_rss() { $output .= "\n"; $output .= "\n"; - $output .= format_rss_channel(variable_get('site_name', 'Drupal') . ' ' . t('aggregator'), url('aggregator' . $url, NULL, NULL, TRUE), variable_get('site_name', 'Drupal') . ' - ' . t('aggregated feeds') . $title, $items, 'en'); + $output .= format_rss_channel(variable_get('site_name', 'Drupal') . ' ' . t('aggregator'), url('aggregator' . $url, array('absolute' => TRUE)), variable_get('site_name', 'Drupal') . ' - ' . t('aggregated feeds') . $title, $items, 'en'); $output .= "\n"; drupal_set_header('Content-Type: application/rss+xml; charset=utf-8'); @@ -1290,7 +1290,7 @@ function theme_aggregator_feed($feed) { $output .= theme('feed_icon', $feed->url) ."\n"; $output .= $feed->image; $output .= '
'. aggregator_filter_xss($feed->description) ."
\n"; - $output .= '
'. t('URL:') .' '. l($feed->link, $feed->link, array(), NULL, NULL, TRUE) ."
\n"; + $output .= '
'. t('URL:') .' '. l($feed->link, $feed->link, array('absolute' => TRUE)) ."
\n"; if ($feed->checked) { $updated = t('@time ago', array('@time' => format_interval(time() - $feed->checked))); @@ -1355,7 +1355,7 @@ function theme_aggregator_page_item($item) { $source = ''; if ($item->ftitle && $item->fid) { - $source = l($item->ftitle, "aggregator/sources/$item->fid", array('class' => 'feed-item-source')) . ' -'; + $source = l($item->ftitle, "aggregator/sources/$item->fid", array('attributes' => array('class' => 'feed-item-source'))) . ' -'; } if (date('Ymd', $item->timestamp) == date('Ymd')) { diff --git a/modules/blog/blog.module b/modules/blog/blog.module index ffdeeedec..6969dbd16 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -85,7 +85,7 @@ function blog_feed_user($uid = 0) { $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $uid, 0, variable_get('feed_default_items', 10)); $channel['title'] = $account->name ."'s blog"; - $channel['link'] = url("blog/$uid", NULL, NULL, TRUE); + $channel['link'] = url("blog/$uid", array('absolute' => TRUE)); $channel['description'] = $term->description; node_feed($result, $channel); } @@ -96,7 +96,7 @@ function blog_feed_user($uid = 0) { function blog_feed_last() { $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10)); $channel['title'] = variable_get('site_name', 'Drupal') .' blogs'; - $channel['link'] = url('blog', NULL, NULL, TRUE); + $channel['link'] = url('blog', array('absolute' => TRUE)); $channel['description'] = $term->description; node_feed($result, $channel); } diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index f55b54ce3..e78c30b2f 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -138,7 +138,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) { $types = _blogapi_get_node_types(); $structs = array(); foreach ($types as $type) { - $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, TRUE), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); + $structs[] = array('url' => url('blog/' . $user->uid, array('absolute' => TRUE)), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); } return $structs; } @@ -161,7 +161,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) { 'firstname' => $name[0], 'nickname' => $user->name, 'email' => $user->mail, - 'url' => url('blog/' . $user->uid, NULL, NULL, TRUE)); + 'url' => url('blog/' . $user->uid, array('absolute' => TRUE))); } else { return blogapi_error($user); @@ -575,7 +575,7 @@ function blogapi_init() { drupal_add_link(array('rel' => 'EditURI', 'type' => 'application/rsd+xml', 'title' => t('RSD'), - 'href' => url('blogapi/rsd', NULL, NULL, TRUE))); + 'href' => url('blogapi/rsd', array('absolute' => TRUE)))); } } @@ -583,7 +583,7 @@ function blogapi_rsd() { global $base_url; $xmlrpc = $base_url .'/'. 'xmlrpc.php'; - $base = url('', NULL, NULL, TRUE); + $base = url('', array('absolute' => TRUE)); $blogid = 1; # until we figure out how to handle multiple bloggers drupal_set_header('Content-Type: application/rsd+xml; charset=utf-8'); @@ -658,8 +658,8 @@ function _blogapi_get_post($node, $bodies = TRUE) { 'dateCreated' => xmlrpc_date($node->created), 'title' => $node->title, 'postid' => $node->nid, - 'link' => url('node/'.$node->nid, NULL, NULL, TRUE), - 'permaLink' => url('node/'.$node->nid, NULL, NULL, TRUE), + 'link' => url('node/'.$node->nid, array('absolute' => TRUE)), + 'permaLink' => url('node/'.$node->nid, array('absolute' => TRUE)), ); if ($bodies) { if ($node->comment == 1) { 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) .'
'. t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); + $items[] = l($comment->subject, 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)) .'
'. 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 permissions page.', 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 permissions page.', 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 = '
'; - $output .= '
'. l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") .' '. theme('mark', $comment->new) ."
\n"; + $output .= '
'. l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) . ' ' . theme('mark', $comment->new) ."
\n"; $output .= '
'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."
\n"; $output .= '
'. $comment->comment .'
'; $output .= ''; @@ -1782,7 +1782,7 @@ function theme_comment($comment, $links = array()) { function theme_comment_folded($comment) { $output = "
\n"; - $output .= ' '. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") .' '. theme('mark', $comment->new) .' '; + $output .= ' '. l($comment->subject, comment_node_url() .'/'. $comment->cid, array('fragment' => "comment-$comment->cid")) . ' '. theme('mark', $comment->new) .' '; $output .= ''. t('by') .' '. theme('username', $comment) ."\n"; $output .= "
\n"; return $output; @@ -1822,10 +1822,10 @@ function theme_comment_post_forbidden($nid) { } if (variable_get('user_register', 1)) { - return t('Login or register to post comments', array('@login' => url('user/login', $destination), '@register' => url('user/register', $destination))); + return t('Login or register to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination)))); } else { - return t('Login to post comments', array('@login' => url('user/login', $destination))); + return t('Login to post comments', array('@login' => url('user/login', array('query' => $destination)))); } } } diff --git a/modules/contact/contact.module b/modules/contact/contact.module index 9fa22df51..e00423d8e 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -16,7 +16,7 @@ function contact_help($section) { $output .= '

'. t("Users can activate/deactivate their personal contact forms in their account settings. Upon activation, a contact tab will appear in their user profiles. Privileged users such as site administrators are able to contact users even if they have chosen not to enable this feature.") .'

'; $output .= '

'. t("Note that the contact tab will not appear when a user views his or her own profile; only when viewing another user's profile, if that user's contact form is enabled.") .'

'; $output .= '

'. t('If the menu module is enabled, a menu item linking to the site-wide contact page is added to the navigation block. It is disabled by default, but can be enabled via the menu management page. Links to the contact page may also be added to the primary and secondary links using the same page.', array('@menu-module' => url('admin/build/menu'))) .'

'; - $output .= '

'. t('For more information, please read the configuration and customization handbook page for the contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', NULL, NULL, TRUE))) .'

'; + $output .= '

'. t('For more information, please read the configuration and customization handbook page for the contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) .'

'; return $output; case 'admin/build/contact': $output = '

'. t('This page lets you setup your site-wide contact form. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the settings page, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'))) .'

'; @@ -345,8 +345,8 @@ function contact_mail_user_submit($form_id, $form_values) { $account = user_load(array('uid' => arg(1), 'status' => 1)); // Compose the body: $message[] = "$account->name,"; - $message[] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", NULL, NULL, TRUE), '!form-url' => url($_GET['q'], NULL, NULL, TRUE), '!site' => variable_get('site_name', 'Drupal'))); - $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", NULL, NULL, TRUE))); + $message[] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", array('absolute' => TRUE)), '!form-url' => url($_GET['q'], array('absolute' => TRUE)), '!site' => variable_get('site_name', 'Drupal'))); + $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE)))); $message[] = t('Message:'); $message[] = $form_values['message']; @@ -494,7 +494,7 @@ function contact_mail_page_submit($form_id, $form_values) { $from = $form_values['mail']; // Compose the body: - $message[] = t("!name sent a message using the contact form at !form.", array('!name' => $form_values['name'], '!form' => url($_GET['q'], NULL, NULL, TRUE))); + $message[] = t("!name sent a message using the contact form at !form.", array('!name' => $form_values['name'], '!form' => url($_GET['q'], array('absolute' => TRUE)))); $message[] = $form_values['message']; // Tidy up the body: diff --git a/modules/forum/forum.module b/modules/forum/forum.module index c3cf18cf3..15da94ece 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -915,7 +915,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output .= '
  • '. t('You are not allowed to post a new forum topic.') .'
  • '; } else { - $output .= '
  • '. t('Login to post a new forum topic.', array('@login' => url('user/login', drupal_get_destination()))) .'
  • '; + $output .= '
  • '. t('Login to post a new forum topic.', array('@login' => url('user/login', array('query' => drupal_get_destination())))) .'
  • '; } $output .= ''; @@ -977,7 +977,7 @@ function theme_forum_list($forums, $parents, $tid) { $row = array( 'data' => array( array('data' => $description, 'class' => 'forum'), - array('data' => $forum->num_topics . ($new_topics ? '
    '. l(format_plural($new_topics, '1 new', '@count new'), "forum/$forum->tid", NULL, NULL, 'new') : ''), 'class' => 'topics'), + array('data' => $forum->num_topics . ($new_topics ? '
    '. l(format_plural($new_topics, '1 new', '@count new'), "forum/$forum->tid", array('fragment' => 'new')) : ''), 'class' => 'topics'), array('data' => $forum->num_posts, 'class' => 'posts'), array('data' => _forum_format($forum->last_post), 'class' => 'last-reply'), ), @@ -1018,7 +1018,7 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page) { $rows[] = array( array('data' => theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky), 'class' => 'icon'), array('data' => l($topic->title, "node/$topic->nid"), 'class' => 'topic'), - array('data' => $topic->num_comments . ($topic->new_replies ? '
    '. l(format_plural($topic->new_replies, '1 new', '@count new'), "node/$topic->nid", NULL, NULL, 'new') : ''), 'class' => 'replies'), + array('data' => $topic->num_comments . ($topic->new_replies ? '
    '. l(format_plural($topic->new_replies, '1 new', '@count new'), "node/$topic->nid", array('fragment' => 'new')) : ''), 'class' => 'replies'), array('data' => _forum_format($topic), 'class' => 'created'), array('data' => _forum_format(isset($topic->last_reply) ? $topic->last_reply : NULL), 'class' => 'last-reply') ); diff --git a/modules/node/node.module b/modules/node/node.module index cc9a3cf6f..98eae0e42 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -922,7 +922,7 @@ function node_search($op = 'search', $keys = NULL) { $node->body .= module_invoke('taxonomy', 'nodeapi', $node, 'update index'); $extra = node_invoke_nodeapi($node, 'search result'); - $results[] = array('link' => url('node/'. $item->sid, NULL, NULL, TRUE), + $results[] = array('link' => url('node/'. $item->sid, array('absolute' => TRUE)), 'type' => node_get_types('name', $node), 'title' => $node->title, 'user' => theme('username', $node), @@ -1530,7 +1530,7 @@ function node_admin_nodes() { $form['name'][$node->nid] = array('#value' => node_get_types('name', $node)); $form['username'][$node->nid] = array('#value' => theme('username', $node)); $form['status'][$node->nid] = array('#value' => ($node->status ? t('published') : t('not published'))); - $form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/'. $node->nid .'/edit', array(), $destination)); + $form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/'. $node->nid .'/edit', array('query' => $destination))); } $form['nodes'] = array('#type' => 'checkboxes', '#options' => $nodes); $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); @@ -1764,7 +1764,7 @@ function node_feed($nodes = 0, $channel = array()) { while ($node = db_fetch_object($nodes)) { // Load the specified node: $item = node_load($node->nid); - $link = url("node/$node->nid", NULL, NULL, 1); + $link = url("node/$node->nid", array('absolute' => TRUE)); if ($item_length != 'title') { $teaser = ($item_length == 'teaser') ? TRUE : FALSE; @@ -1798,7 +1798,7 @@ function node_feed($nodes = 0, $channel = array()) { case 'teaser': $item_text = $item->teaser; if ($item->readmore) { - $item_text .= '

    '. l(t('read more'), 'node/'. $item->nid, NULL, NULL, NULL, TRUE) .'

    '; + $item_text .= '

    '. l(t('read more'), 'node/'. $item->nid, array('absolute' => TRUE)) .'

    '; } break; case 'title': @@ -2128,7 +2128,7 @@ function node_add($type = NULL) { if (function_exists($type->module .'_form') && node_access('create', $type->type)) { $type_url_str = str_replace('_', '-', $type->type); $title = t('Add a new @s.', array('@s' => $type->name)); - $out = '
    '. l(drupal_ucfirst($type->name), "node/add/$type_url_str", array('title' => $title)) .'
    '; + $out = '
    '. l(drupal_ucfirst($type->name), "node/add/$type_url_str", array('attributes' => array('title' => $title))) .'
    '; $out .= '
    '. filter_xss_admin($type->description) .'
    '; $item[$type->type] = $out; } @@ -2348,7 +2348,7 @@ function node_page_default() { $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10)); if (db_num_rows($result)) { - $feed_url = url('rss.xml', NULL, NULL, TRUE); + $feed_url = url('rss.xml', array('absolute' => TRUE)); drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') .' '. t('RSS')); $output = ''; diff --git a/modules/path/path.module b/modules/path/path.module index 7c6b5480b..372ff5e05 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -187,7 +187,7 @@ function path_form($edit = '') { '#maxlength' => 64, '#size' => 45, '#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); $form['dst'] = array( '#type' => 'textfield', @@ -195,7 +195,7 @@ function path_form($edit = '') { '#maxlength' => 64, '#size' => 45, '#description' => t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); if ($edit['pid']) { @@ -312,7 +312,7 @@ function path_overview() { $rows = array(); $destination = drupal_get_destination(); while ($data = db_fetch_object($result)) { - $rows[] = array(check_plain($data->dst), check_plain($data->src), l(t('edit'), "admin/build/path/edit/$data->pid", array(), $destination), l(t('delete'), "admin/build/path/delete/$data->pid", array(), $destination)); + $rows[] = array(check_plain($data->dst), check_plain($data->src), l(t('edit'), "admin/build/path/edit/$data->pid", array('query' => $destination)), l(t('delete'), "admin/build/path/delete/$data->pid", array('query' => $destination))); } if (empty($rows)) { diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 82de6c73a..4ccbb2006 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -176,7 +176,7 @@ function statistics_access_log($aid) { $result = db_query('SELECT a.*, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE aid = %d', $aid); if ($access = db_fetch_object($result)) { $output = ''; - $output .= ' "; + $output .= ' "; $output .= ' '; // safe because it comes from drupal_get_title() $output .= ' "; $output .= ' '; @@ -318,7 +318,7 @@ function statistics_top_visitors() { $rows = array(); while ($account = db_fetch_object($result)) { $qs = drupal_get_destination(); - $ban_link = $account->aid ? l(t('unban'), "admin/user/rules/delete/$account->aid", array(), $qs) : l(t('ban'), "admin/user/rules/add/$account->hostname/host", array(), $qs); + $ban_link = $account->aid ? l(t('unban'), "admin/user/rules/delete/$account->aid", array('query' => $qs)) : l(t('ban'), "admin/user/rules/add/$account->hostname/host", array('query' => $qs)); $rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), $ban_link); } diff --git a/modules/system/system.module b/modules/system/system.module index 7282e156c..e77483f51 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -565,7 +565,7 @@ function system_site_information_settings() { '#default_value' => variable_get('site_frontpage', 'node'), '#size' => 40, '#description' => t('The home page displays content from this relative URL. If unsure, specify "node".'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); return system_settings_form($form); @@ -614,7 +614,7 @@ function system_error_reporting_settings() { '#default_value' => variable_get('site_403', ''), '#size' => 40, '#description' => t('This page is displayed when the requested document is denied to the current user. If unsure, specify nothing.'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); $form['site_404'] = array( @@ -623,7 +623,7 @@ function system_error_reporting_settings() { '#default_value' => variable_get('site_404', ''), '#size' => 40, '#description' => t('This page is displayed when no other content matches the requested document. If unsure, specify nothing.'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); $form['error_level'] = array( @@ -2150,7 +2150,7 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $fragment = isset($path['fragment']) ? $path['fragment'] : NULL; $path = isset($path['path']) ? $path['path'] : NULL; } - $cancel = l($no ? $no : t('Cancel'), $path, array(), $query, $fragment); + $cancel = l($no ? $no : t('Cancel'), $path, array('query' => $query, 'fragment' => $fragment)); drupal_set_title($question); $form['#attributes'] = array('class' => 'confirmation'); @@ -2261,7 +2261,7 @@ function theme_admin_block_content($content) { if (system_admin_compact_mode()) { $output = ''; } @@ -2316,7 +2316,7 @@ function system_get_module_admin_tasks($module) { // Check for permissions. if (module_hook($module, 'perm') && $admin_access) { - $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/access', NULL, NULL, 'module-'. $module); + $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/access', array('fragment' => 'module-'. $module)); } // Check for menu items that are admin links. diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index b6f370a51..9bbe24ee4 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -190,7 +190,7 @@ function taxonomy_overview_terms($vocabulary) { if (($start_from && ($start_from * $page_increment) >= $total_entries) || ($displayed_count == $page_increment)) { continue; } - $rows[] = array(str_repeat('--', $term->depth) .' '. l($term->name, "taxonomy/term/$term->tid"), l(t('edit'), "admin/content/taxonomy/edit/term/$term->tid", array(), $destination)); + $rows[] = array(str_repeat('--', $term->depth) . ' ' . l($term->name, "taxonomy/term/$term->tid"), l(t('edit'), "admin/content/taxonomy/edit/term/$term->tid", array('query' => $destination))); $displayed_count++; // we're counting tids displayed } @@ -240,12 +240,12 @@ function taxonomy_form_vocabulary($edit = array()) { '#title' => t('Hierarchy'), '#default_value' => $edit['hierarchy'], '#options' => array(t('Disabled'), t('Single'), t('Multiple')), - '#description' => t('Allows a tree-like hierarchy between terms of this vocabulary.', array('@help-url' => url('admin/help/taxonomy', NULL, NULL, 'hierarchy'))), + '#description' => t('Allows a tree-like hierarchy between terms of this vocabulary.', array('@help-url' => url('admin/help/taxonomy', array('absolute' => TRUE)))), ); $form['relations'] = array('#type' => 'checkbox', '#title' => t('Related terms'), '#default_value' => $edit['relations'], - '#description' => t('Allows related terms in this vocabulary.', array('@help-url' => url('admin/help/taxonomy', NULL, NULL, 'related-terms'))), + '#description' => t('Allows related terms in this vocabulary.', array('@help-url' => url('admin/help/taxonomy', array('absolute' => TRUE)))), ); $form['tags'] = array('#type' => 'checkbox', '#title' => t('Free tagging'), @@ -396,10 +396,11 @@ function taxonomy_form_term($vocabulary, $edit = array()) { $exclude[] = $edit['tid']; if ($vocabulary->hierarchy == 1) { + $form['parent'] = _taxonomy_term_select(t('Parent'), 'parent', $parent, $vocabulary_id, l(t('Parent term'), 'admin/help/taxonomy', array('fragment' => 'parent')) .'.', 0, '<'. t('root') .'>', $exclude); $form['parent'] = _taxonomy_term_select(t('Parent'), 'parent', $parent, $vocabulary->vid, l(t('Parent term'), 'admin/help/taxonomy', NULL, NULL, 'parent') .'.', 0, '<'. t('root') .'>', $exclude); } elseif ($vocabulary->hierarchy == 2) { - $form['parent'] = _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary->vid, l(t('Parent terms'), 'admin/help/taxonomy', NULL, NULL, 'parent') .'.', 1, '<'. t('root') .'>', $exclude); + $form['parent'] = _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary_id, l(t('Parent terms'), 'admin/help/taxonomy', array('fragment' => 'parent')) .'.', 1, '<'. t('root') .'>', $exclude); } } @@ -411,7 +412,7 @@ function taxonomy_form_term($vocabulary, $edit = array()) { '#type' => 'textarea', '#title' => t('Synonyms'), '#default_value' => implode("\n", taxonomy_get_synonyms($edit['tid'])), - '#description' => t('Synonyms of this term, one synonym per line.', array('@help-url' => url('admin/help/taxonomy', NULL, NULL, 'synonyms')))); + '#description' => t('Synonyms of this term, one synonym per line.', array('@help-url' => url('admin/help/taxonomy', array('absolute' => TRUE))))); $form['weight'] = array( '#type' => 'weight', '#title' => t('Weight'), @@ -1385,7 +1386,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { case 'feed': $term = taxonomy_get_term($tids[0]); - $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, NULL, NULL, TRUE); + $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, array('absolute' => TRUE)); $channel['title'] = variable_get('site_name', 'Drupal') .' - '. $title; $channel['description'] = $term->description; @@ -1433,7 +1434,7 @@ function taxonomy_rss_item($node) { foreach ($node->taxonomy as $term) { $output[] = array('key' => 'category', 'value' => check_plain($term->name), - 'attributes' => array('domain' => url('taxonomy/term/'. $term->tid, NULL, NULL, TRUE))); + 'attributes' => array('domain' => url('taxonomy/term/'. $term->tid, array('absolute' => TRUE)))); } return $output; } diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 51d6f6d3a..9f924d649 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -107,7 +107,7 @@ function tracker_page($uid = 0) { if ($new = comment_num_new($node->nid)) { $comments .= '
    '; - $comments .= l(format_plural($new, '1 new', '@count new'), "node/$node->nid", NULL, NULL, 'new'); + $comments .= l(format_plural($new, '1 new', '@count new'), "node/$node->nid", array('fragment' => 'new')); } } diff --git a/modules/upload/upload.module b/modules/upload/upload.module index c85df433c..82c7eb6d9 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -795,7 +795,7 @@ function _upload_form($node) { $form['new']['upload'] = array('#type' => 'file', '#title' => t('Attach new file'), '#size' => 40); $form['new']['attach'] = array('#type' => 'button', '#value' => t('Attach'), '#name' => 'attach', '#id' => 'attach-button'); // The class triggers the js upload behaviour. - $form['attach-url'] = array('#type' => 'hidden', '#value' => url('upload/js', NULL, NULL, TRUE), '#attributes' => array('class' => 'upload')); + $form['attach-url'] = array('#type' => 'hidden', '#value' => url('upload/js', array('absolute' => TRUE)), '#attributes' => array('class' => 'upload')); } // Needed for JS diff --git a/modules/user/user.module b/modules/user/user.module index ff92c54fd..5c3fff7ce 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -440,7 +440,7 @@ function user_search($op = 'search', $keys = NULL, $skip_access_check = FALSE) { $keys = preg_replace('!\*+!', '%', $keys); $result = pager_query("SELECT * FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); while ($account = db_fetch_object($result)) { - $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, NULL, NULL, TRUE)); + $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE))); } return $find; } @@ -478,7 +478,7 @@ function user_user($type, &$edit, &$user, $category = NULL) { function user_login_block() { $form = array( - '#action' => url($_GET['q'], drupal_get_destination()), + '#action' => url($_GET['q'], array('query' => drupal_get_destination())), '#id' => 'user-login-form', '#base' => 'user_login', ); @@ -965,7 +965,7 @@ function user_auth_help_links() { $links = array(); foreach (module_list() as $module) { if (module_hook($module, 'auth')) { - $links[] = l(module_invoke($module, 'info', 'name'), 'user/help', array(), NULL, $module); + $links[] = l(module_invoke($module, 'info', 'name'), 'user/help', array('fragment' => $module)); } } return $links; @@ -1158,7 +1158,7 @@ function user_pass_submit($form_id, $form_values) { $from = variable_get('site_mail', ini_get('sendmail_from')); // Mail one time login URL and instructions. - $variables = array('!username' => $account->name, '!site' => variable_get('site_name', 'Drupal'), '!login_url' => user_pass_reset_url($account), '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen('http://')), '!mailto' => $account->mail, '!date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE), '!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE)); + $variables = array('!username' => $account->name, '!site' => variable_get('site_name', 'Drupal'), '!login_url' => user_pass_reset_url($account), '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen('http://')), '!mailto' => $account->mail, '!date' => format_date(time()), '!login_uri' => url('user', array('absolute' => TRUE)), '!edit_uri' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE))); $subject = _user_mail_text('pass_subject', $variables); $body = _user_mail_text('pass_body', $variables); $mail_success = drupal_mail('user-pass', $account->mail, $subject, $body, $from); @@ -1234,7 +1234,7 @@ function user_pass_reset($uid, $timestamp, $hashed_pass, $action = NULL) { function user_pass_reset_url($account) { $timestamp = time(); - return url("user/reset/$account->uid/$timestamp/".user_pass_rehash($account->pass, $timestamp, $account->login), NULL, NULL, TRUE); + return url("user/reset/$account->uid/$timestamp/".user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE)); } function user_pass_rehash($password, $timestamp, $login) { @@ -1332,7 +1332,7 @@ function user_register_submit($form_id, $form_values) { $account = user_save('', array_merge($form_values, $merge_data)); watchdog('user', t('New user: %name %email.', array('%name' => $name, '%email' => '<'. $mail .'>')), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit')); - $variables = array('!username' => $name, '!site' => variable_get('site_name', 'Drupal'), '!password' => $pass, '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen('http://')), '!mailto' => $mail, '!date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE), '!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE), '!login_url' => user_pass_reset_url($account)); + $variables = array('!username' => $name, '!site' => variable_get('site_name', 'Drupal'), '!password' => $pass, '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen('http://')), '!mailto' => $mail, '!date' => format_date(time()), '!login_uri' => url('user', array('absolute' => TRUE)), '!edit_uri' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE)), '!login_url' => user_pass_reset_url($account)); // The first user may login immediately, and receives a customized welcome e-mail. if ($account->uid == 1) { @@ -2136,7 +2136,7 @@ function user_admin_account() { $form['roles'][$account->uid][0] = array('#value' => theme('item_list', $users_roles)); $form['member_for'][$account->uid] = array('#value' => format_interval(time() - $account->created)); $form['last_access'][$account->uid] = array('#value' => $account->access ? t('@time ago', array('@time' => format_interval(time() - $account->access))) : t('never')); - $form['operations'][$account->uid] = array('#value' => l(t('edit'), "user/$account->uid/edit", array(), $destination)); + $form['operations'][$account->uid] = array('#value' => l(t('edit'), "user/$account->uid/edit", array('query' => $destination))); } $form['accounts'] = array( '#type' => 'checkboxes', diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index e26f48a64..9c584cd86 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -142,7 +142,7 @@ function watchdog_overview() { $icons[$watchdog->severity], t($watchdog->type), format_date($watchdog->timestamp, 'small'), - l(truncate_utf8($watchdog->message, 56, TRUE, TRUE), 'admin/logs/event/'. $watchdog->wid, array(), NULL, NULL, FALSE, TRUE), + l(truncate_utf8($watchdog->message, 56, TRUE, TRUE), 'admin/logs/event/'. $watchdog->wid, array('html' => TRUE)), theme('username', $watchdog), $watchdog->link, ), -- cgit v1.2.3
    '. t('URL') ."". l(url($access->path, NULL, NULL, TRUE), $access->path) ."
    '. t('URL') ."". l(url($access->path, array('absolute' => TRUE)), $access->path) ."
    '. t('Title') .''. $access->title .'
    '. t('Referrer') ."". ($access->url ? l($access->url, $access->url) : '') ."
    '. t('Date') .''. format_date($access->timestamp, 'large') .'