? files
? hook_link_as_array_1.diff
? hook_link_as_array_2.diff
? update.log
? database/database.prefixed.mysql
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.263
diff -u -F^f -u -r1.263 theme.inc
--- includes/theme.inc 22 Oct 2005 15:14:46 -0000 1.263
+++ includes/theme.inc 23 Oct 2005 11:06:29 -0000
@@ -237,7 +237,6 @@ function theme_get_settings($key = NULL)
}
}
$settings = array_merge($defaults, variable_get('theme_settings', array()));
-
if ($key) {
$settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_'. $key .'_settings'), array()));
}
@@ -325,20 +324,16 @@ function theme_get_setting($setting_name
unset($attributes);
if (!empty($value['text'][$i])) {
if (!empty($value['description'][$i])) {
- $attributes['title'] = $value['description'][$i];
- }
- $text = $value['text'][$i];
- $link = $value['link'][$i];
- if (substr($link, 0, 7) == 'http://') {
- $settings[$type .'_links'][] = ''. check_plain($text) .'';
- }
- else {
- $settings[$type .'_links'][] = l($text, $link, $attributes);
+ $settings[$type .'_links'][$type .'_links_'. $i] = $value['description'][$i];
}
+ $settings[$type .'_links'][$type .'_links_'. $i]->title = $value['text'][$i];
+ $settings[$type .'_links'][$type .'_links_'. $i]->link = $value['link'][$i];
+ $settings[$type .'_links'][$type .'_links_'. $i]->attributes = $attributes;
}
}
- if ($settings[$type .'_links'] == array()) {
- $settings[$type .'_links'] = array(l(t('edit %type links', array('%type' => $type)),'admin/themes/settings'));
+ if ($settings[$type .'_links'][$type .'_links_'. $i]->title != '') {
+ $settings[$type .'_links'][$type .'_links_default']->title = t('edit %type links', array('%type' => $type));
+ $settings[$type .'_links'][$type .'_links_default']->link = 'admin/themes/settings';
}
}
}
@@ -502,14 +497,26 @@ function theme_status_messages() {
* Return a themed set of links.
*
* @param $links
- * An array of links to be themed.
+ * An keyed array of link objects.
* @param $delimiter
* A string used to separate the links.
* @return
* A string containing the themed links.
*/
function theme_links($links, $delimiter = ' | ') {
- return implode($delimiter, $links);
+ foreach ($links as $link) {
+ if ($link->link && substr($link->link, 0, 7) == 'http://') {
+ $output[] = 'attributes) .'>'. check_plain($link->text) .'';
+ }
+ elseif ($link->link) {
+ $output[] = l($link->title, $link->link, $link->attributes, $link->query, $link->fraction);
+ }
+ elseif ($link->title) {
+ //Some links are actually not links ...
+ $output[] = $link->title;
+ }
+ }
+ return $output ? implode($delimiter, $output) : NULL;
}
/**
Index: modules/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog.module,v
retrieving revision 1.233
diff -u -F^f -u -r1.233 blog.module
--- modules/blog.module 11 Oct 2005 19:44:34 -0000 1.233
+++ modules/blog.module 23 Oct 2005 11:06:29 -0000
@@ -247,7 +247,9 @@ function blog_link($type, $node = 0, $ma
if ($type == 'node' && $node->type == 'blog') {
if (arg(0) != 'blog' || arg(1) != $node->uid) {
- $links[] = l(t("%username's blog", array('%username' => $node->name)), "blog/$node->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name))));
+ $links['blog_usersblog']->title = t("%username's blog", array('%username' => $node->name));
+ $links['blog_usersblog']->link = "blog/$node->uid";
+ $links['blog_usersblog']->attributes = array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name)));
}
}
Index: modules/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book.module,v
retrieving revision 1.323
diff -u -F^f -u -r1.323 book.module
--- modules/book.module 11 Oct 2005 19:44:34 -0000 1.323
+++ modules/book.module 23 Oct 2005 11:06:30 -0000
@@ -17,7 +17,7 @@ function book_node_info() {
* Implementation of hook_perm().
*/
function book_perm() {
- return array('create book pages', 'maintain books', 'edit own book pages', 'export books', 'see printer-friendly version');
+ return array('create book pages', 'maintain books', 'edit own book pages');
}
/**
@@ -52,21 +52,23 @@ function book_access($op, $node) {
* Implementation of hook_link().
*/
function book_link($type, $node = 0, $main = 0) {
-
$links = array();
if ($type == 'node' && isset($node->parent)) {
if (!$main) {
if (book_access('create', $node)) {
- $links[] = l(t('add child page'), "node/add/book/parent/$node->nid");
- }
- if (user_access('see printer-friendly version')) {
- $links[] = l(t('printer-friendly version'), 'book/export/html/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));
- }
- if (user_access('export books')) {
- $links[] = l(t('export DocBook XML'), 'book/export/docbook/'. $node->nid, array('title' => t('Export this book page and its sub-pages as DocBook XML.')));
- $links[] = l(t('export OPML'), 'book/export/opml/'. $node->nid, array('title' => t('Export this book page and its sub-pages as OPML.')));
+ $links['book_add_child']->title = t('add child page');
+ $links['book_add_child']->link = "node/add/book/parent/$node->nid";
}
+ $links['book_export_html']->title = t('export plain HTML');
+ $links['book_export_html']->link = "book/export/html/$node->nid";
+ $links['book_export_html']->attributes = array('title' => t('Export this book page and its sub-pages as a plain HTML page.'));
+ $links['book_export_docbook']->title = t('export DocBook XML');
+ $links['book_export_docbook']->link = "book/export/docbook/$node->nid";
+ $links['book_export_docbook']->attributes = array('title' => t('Export this book page and its sub-pages as DocBook XML.'));
+ $links['book_export_opml']->title = t('export OPML');
+ $links['book_export_opml']->link = "book/export/opml/$node->nid";
+ $links['book_export_opml']->attributes = array('title' => t('Export this book page and its sub-pages as OPML.'));
}
}
@@ -114,7 +116,7 @@ function book_menu($may_cache) {
$items[] = array(
'path' => 'book/export',
'callback' => 'book_export',
- 'access' => (user_access('export books') || user_access('see printer-friendly version')) && user_access('access content'),
+ 'access' => user_access('access content'),
'type' => MENU_CALLBACK);
}
else {
Index: modules/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment.module,v
retrieving revision 1.384
diff -u -F^f -u -r1.384 comment.module
--- modules/comment.module 20 Oct 2005 09:27:36 -0000 1.384
+++ modules/comment.module 23 Oct 2005 11:06:32 -0000
@@ -157,19 +157,27 @@ function comment_link($type, $node = 0,
$new = comment_num_new($node->nid);
if ($all) {
- $links[] = l(format_plural($all, '1 comment', '%count comments'), "node/$node->nid", array('title' => t('Jump to the first comment of this posting.')), NULL, 'comment');
+ $links['comment_comments']->title = format_plural($all, '1 comment', '%count comments');
+ $links['comment_comments']->link = "node/$node->nid";
+ $links['comment_comments']->attributes = array('title' => t('Jump to the first comment of this posting.'));
+ $links['comment_comments']->fraction = 'comment';
if ($new) {
- $links[] = l(format_plural($new, '1 new comment', '%count new comments'), "node/$node->nid", array('title' => t('Jump to the first new comment of this posting.')), NULL, 'new');
+ $links['comment_comments_new']->title = format_plural($new, '1 new comment', '%count new comments');
+ $links['comment_comments_new']->link = "node/$node->nid";
+ $links['comment_comments_new']->attributes = array('title' => t('Jump to the first new comment of this posting.'));
+ $links['comment_comments_new']->fraction = 'new';
}
}
else {
if ($node->comment == 2) {
if (user_access('post comments')) {
- $links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Add a new comment to this page.')));
+ $links['comment_add']->title = t('add new comment');
+ $links['comment_add']->link = "comment/reply/$node->nid";
+ $links['comment_add']->attributes = array('title' => t('Add a new comment to this page.'));
}
else {
- $links[] = theme('comment_post_forbidden');
+ $links['comment_forbidden']->title = theme('comment_post_forbidden');
}
}
}
@@ -181,10 +189,13 @@ function comment_link($type, $node = 0,
if ($node->comment == 2 && variable_get('comment_form_location', 0) == 0) {
if (user_access('post comments')) {
- $links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Share your thoughts and opinions related to this posting.')), NULL, 'comment');
+ $links['comment_add']->title = t('add new comment');
+ $links['comment_add']->link = "comment/reply/$node->nid";
+ $links['comment_add']->attributes = array('title' => t('Share your thoughts and opinions related to this posting.'));
+ $links['comment_add']->fraction = 'comment';
}
else {
- $links[] = theme('comment_post_forbidden');
+ $links['comment_forbidden']->title = theme('comment_post_forbidden');
}
}
}
@@ -702,23 +713,30 @@ function comment_links($comment, $return
// If we are viewing just this comment, we link back to the node.
if ($return) {
- $links[] = l(t('parent'), comment_node_url(), NULL, NULL, "comment-$comment->cid");
+ $links['comment_parent']->title = t('parent');
+ $links['comment_parent']->link = comment_node_url();
+ $links['comment_parent']->fraction = "comment-$comment->cid";
}
if (node_comment_mode($comment->nid) == 2) {
if (user_access('administer comments') && user_access('access administration pages')) {
- $links[] = l(t('delete'), "comment/delete/$comment->cid");
- $links[] = l(t('edit'), "comment/edit/$comment->cid");
- $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid");
+ $links['comment_delete']->title = t('delete');
+ $links['comment_delete']->link = "comment/delete/$comment->cid";
+ $links['comment_edit']->title = t('edit');
+ $links['comment_delete']->link = "comment/edit/$comment->cid";
+ $links['comment_reply']->title = t('reply');
+ $links['comment_delete']->link = "comment/reply/$comment->nid/$comment->cid";
}
else if (user_access('post comments')) {
if (comment_access('edit', $comment)) {
- $links[] = l(t('edit'), "comment/edit/$comment->cid");
+ $links['comment_edit']->title = t('edit');
+ $links['comment_edit']->link = "comment/edit/$comment->cid";
}
- $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid");
+ $links['comment_reply']->title = t('reply');
+ $links['comment_reply']->link = "comment/reply/$comment->nid/$comment->cid";
}
else {
- $links[] = theme('comment_post_forbidden');
+ $links['comment_forbidden']->title = theme('comment_post_forbidden');
}
}
Index: modules/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum.module,v
retrieving revision 1.277
diff -u -F^f -u -r1.277 forum.module
--- modules/forum.module 21 Oct 2005 11:12:46 -0000 1.277
+++ modules/forum.module 23 Oct 2005 11:06:33 -0000
@@ -423,11 +423,15 @@ function forum_link($type, $node = 0, $m
}
if ($prev) {
- $links[] = l(t('previous forum topic'), "node/$prev->nid", array('title' => check_plain($prev->title)));
+ $links['forum_previous']->title = t('previous forum topic');
+ $links['forum_previous']->link = "node/$prev->nid";
+ $links['forum_previous']->attributes = array('title' => check_plain($prev->title));
}
if ($next) {
- $links[] = l(t('next forum topic'), "node/$next->nid", array('title' => check_plain($next->title)));
+ $links['forum_next']->title = t('next forum topic');
+ $links['forum_next']->link = "node/$next->nid";
+ $links['forum_next']->attributes = array('title' => check_plain($next->title));
}
}
Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.538
diff -u -F^f -u -r1.538 node.module
--- modules/node.module 22 Oct 2005 15:14:46 -0000 1.538
+++ modules/node.module 23 Oct 2005 11:06:35 -0000
@@ -847,7 +847,9 @@ function node_link($type, $node = 0, $ma
}
if ($main == 1 && $node->teaser && $node->readmore) {
- $links[] = l(t('read more'), "node/$node->nid", array('title' => t('Read the rest of this posting.'), 'class' => 'read-more'));
+ $links['node_readmore']->title = t('read more');
+ $links['node_readmore']->link = "node/$node->nid";
+ $links['node_readmore']->attributes = array('title' => t('Read the rest of this posting.'), 'class' => 'read-more');
}
}
Index: modules/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics.module,v
retrieving revision 1.210
diff -u -F^f -u -r1.210 statistics.module
--- modules/statistics.module 12 Oct 2005 01:00:24 -0000 1.210
+++ modules/statistics.module 23 Oct 2005 11:06:36 -0000
@@ -96,7 +96,7 @@ function statistics_link($type, $node =
if ($type != 'comment' && variable_get('statistics_display_counter', 0)) {
$statistics = statistics_get($node->nid);
if ($statistics) {
- $links[] = format_plural($statistics['totalcount'], '1 read', '%count reads');
+ $links['statistics_count']->title = format_plural($statistics['totalcount'], '1 read', '%count reads');
}
}
return $links;
Index: modules/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v
retrieving revision 1.232
diff -u -F^f -u -r1.232 taxonomy.module
--- modules/taxonomy.module 21 Oct 2005 11:12:46 -0000 1.232
+++ modules/taxonomy.module 23 Oct 2005 11:06:37 -0000
@@ -30,12 +30,14 @@ function taxonomy_link($type, $node = NU
if (array_key_exists('taxonomy', $node)) {
foreach ($node->taxonomy as $tid) {
$term = taxonomy_get_term($tid);
- $links[] = l($term->name, taxonomy_term_path($term));
+ $links['taxonomy_term_'. $tid]->title = $term->name;
+ $links['taxonomy_term_'. $tid]->link = "taxonomy/term/$term->tid";
}
}
else {
foreach (taxonomy_node_get_terms($node->nid) as $term) {
- $links[] = l($term->name, taxonomy_term_path($term));
+ $links['taxonomy_term_'. $tid]->title = $term->name;
+ $links['taxonomy_term_'. $tid]->link = "taxonomy/term/$term->tid";
}
}
return $links;
Index: modules/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload.module,v
retrieving revision 1.55
diff -u -F^f -u -r1.55 upload.module
--- modules/upload.module 11 Oct 2005 19:44:35 -0000 1.55
+++ modules/upload.module 23 Oct 2005 11:06:38 -0000
@@ -40,7 +40,10 @@ function upload_link($type, $node = 0, $
}
}
if ($num_files) {
- $links[] = l(format_plural($num_files, '1 attachment', '%count attachments'), "node/$node->nid", array('title' => t('Read full article to view attachments.')), NULL, 'attachments');
+ $links['upload_attachments']->title = format_plural($num_files, '1 attachment', '%count attachments');
+ $links['upload_attachments']->link = "node/$node->nid";
+ $links['upload_attachments']->attributes = array('title' => t('Read full article to view attachments.'));
+ $links['upload_attachments']->fraction = 'attachments';
}
}