summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/node.module13
-rw-r--r--modules/node/node.module13
-rw-r--r--modules/poll.module2
-rw-r--r--modules/poll/poll.module2
-rw-r--r--modules/statistics.module3
-rw-r--r--modules/statistics/statistics.module3
6 files changed, 22 insertions, 14 deletions
diff --git a/modules/node.module b/modules/node.module
index 741a946f0..718e34ac2 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -507,11 +507,13 @@ function node_save($node) {
* Whether to display only the teaser for the node.
* @param $page
* Whether the node is being displayed by itself as a page.
+ * @param $links
+ * Whether or not to display node links. Links are omitted for node previews.
*
* @return
* An HTML representation of the themed node.
*/
-function node_view($node, $teaser = FALSE, $page = FALSE) {
+function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
$node = array2object($node);
// Remove the delimiter (if any) that separates the teaser from the body.
@@ -528,6 +530,9 @@ function node_view($node, $teaser = FALSE, $page = FALSE) {
}
// Allow modules to change $node->body before viewing.
node_invoke_nodeapi($node, 'view', $teaser, $page);
+ if ($links) {
+ $node->links = module_invoke_all('link', 'node', $node, !$page);
+ }
return theme('node', $node, $teaser, $page);
}
@@ -1354,13 +1359,13 @@ function node_preview($node) {
// Display a preview of the node:
if ($node->teaser && $node->teaser != $node->body) {
$output = '<h3>'. t('Preview trimmed version') .'</h3>';
- $output .= node_view($node, 1);
+ $output .= node_view($node, 1, FALSE, 0);
$output .= '<p><em>'. t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.') .'</em></p>';
$output .= '<h3>'. t('Preview full version') .'</h3>';
- $output .= node_view($node, 0);
+ $output .= node_view($node, 0, FALSE, 0);
}
else {
- $output .= node_view($node, 0);
+ $output .= node_view($node, 0, FALSE, 0);
}
$output .= node_form($node);
diff --git a/modules/node/node.module b/modules/node/node.module
index 741a946f0..718e34ac2 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -507,11 +507,13 @@ function node_save($node) {
* Whether to display only the teaser for the node.
* @param $page
* Whether the node is being displayed by itself as a page.
+ * @param $links
+ * Whether or not to display node links. Links are omitted for node previews.
*
* @return
* An HTML representation of the themed node.
*/
-function node_view($node, $teaser = FALSE, $page = FALSE) {
+function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
$node = array2object($node);
// Remove the delimiter (if any) that separates the teaser from the body.
@@ -528,6 +530,9 @@ function node_view($node, $teaser = FALSE, $page = FALSE) {
}
// Allow modules to change $node->body before viewing.
node_invoke_nodeapi($node, 'view', $teaser, $page);
+ if ($links) {
+ $node->links = module_invoke_all('link', 'node', $node, !$page);
+ }
return theme('node', $node, $teaser, $page);
}
@@ -1354,13 +1359,13 @@ function node_preview($node) {
// Display a preview of the node:
if ($node->teaser && $node->teaser != $node->body) {
$output = '<h3>'. t('Preview trimmed version') .'</h3>';
- $output .= node_view($node, 1);
+ $output .= node_view($node, 1, FALSE, 0);
$output .= '<p><em>'. t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.') .'</em></p>';
$output .= '<h3>'. t('Preview full version') .'</h3>';
- $output .= node_view($node, 0);
+ $output .= node_view($node, 0, FALSE, 0);
}
else {
- $output .= node_view($node, 0);
+ $output .= node_view($node, 0, FALSE, 0);
}
$output .= node_form($node);
diff --git a/modules/poll.module b/modules/poll.module
index 2c078f629..f55cacabf 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -435,7 +435,7 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
// No 'read more' link
$node->body = $node->teaser = '';
- $links = link_node($node, $main);
+ $links = module_invoke_all('link', 'node', $node, 0);
$links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.')));
if ($node->allowvotes && $block) {
$links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.')));
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 2c078f629..f55cacabf 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -435,7 +435,7 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
// No 'read more' link
$node->body = $node->teaser = '';
- $links = link_node($node, $main);
+ $links = module_invoke_all('link', 'node', $node, 0);
$links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.')));
if ($node->allowvotes && $block) {
$links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.')));
diff --git a/modules/statistics.module b/modules/statistics.module
index 568ee805b..40791bc19 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -629,7 +629,6 @@ function statistics_summary($dbfield, $dbrows) {
$result = db_query_range('SELECT n.nid, n.title FROM {node_counter} s INNER JOIN {node} n ON s.nid = n.nid ORDER BY %s DESC', $dbfield, 0, $dbrows);
while ($nid = db_fetch_array($result)) {
$content = node_load(array('nid' => $nid['nid']));
- $links = link_node($content, 1);
// Filter and prepare node teaser
if (node_hook($content, 'view')) {
@@ -641,7 +640,7 @@ function statistics_summary($dbfield, $dbrows) {
$output .= '<tr><td><strong>'. l($nid['title'], 'node/'. $nid['nid'], array('title' => t('View this posting.'))) .'</strong></td><td style="text-align: right;"><small>'. t('Submitted by %a on %b', array('%a' => format_name($content), '%b' => format_date($content->created, 'large'))) .'</small></td></tr>';
$output .= '<tr><td colspan="2"><div style="margin-left: 20px;">'. $content->teaser .'</div></td></tr>';
- $output .= '<tr><td style="text-align: right;" colspan="2">[ '. theme('links', $links) .' ]<br /><br /></td></tr>';
+ $output .= '<tr><td style="text-align: right;" colspan="2">[ '. theme('links', $content->links) .' ]<br /><br /></td></tr>';
}
return $output;
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 568ee805b..40791bc19 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -629,7 +629,6 @@ function statistics_summary($dbfield, $dbrows) {
$result = db_query_range('SELECT n.nid, n.title FROM {node_counter} s INNER JOIN {node} n ON s.nid = n.nid ORDER BY %s DESC', $dbfield, 0, $dbrows);
while ($nid = db_fetch_array($result)) {
$content = node_load(array('nid' => $nid['nid']));
- $links = link_node($content, 1);
// Filter and prepare node teaser
if (node_hook($content, 'view')) {
@@ -641,7 +640,7 @@ function statistics_summary($dbfield, $dbrows) {
$output .= '<tr><td><strong>'. l($nid['title'], 'node/'. $nid['nid'], array('title' => t('View this posting.'))) .'</strong></td><td style="text-align: right;"><small>'. t('Submitted by %a on %b', array('%a' => format_name($content), '%b' => format_date($content->created, 'large'))) .'</small></td></tr>';
$output .= '<tr><td colspan="2"><div style="margin-left: 20px;">'. $content->teaser .'</div></td></tr>';
- $output .= '<tr><td style="text-align: right;" colspan="2">[ '. theme('links', $links) .' ]<br /><br /></td></tr>';
+ $output .= '<tr><td style="text-align: right;" colspan="2">[ '. theme('links', $content->links) .' ]<br /><br /></td></tr>';
}
return $output;