diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/book.module | 20 | ||||
-rw-r--r-- | modules/book/book.module | 20 | ||||
-rw-r--r-- | modules/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/poll.module | 4 | ||||
-rw-r--r-- | modules/poll/poll.module | 4 |
6 files changed, 30 insertions, 22 deletions
diff --git a/modules/book.module b/modules/book.module index f23ba1d06..56203777a 100644 --- a/modules/book.module +++ b/modules/book.module @@ -57,10 +57,10 @@ function book_save($op, $node) { if ($op == "create") { if (user_access("administer nodes")) { - return array("format", "parent", "weight"); + return array("format", "parent", "weight", "log"); } else { - return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight"); + return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight", "log"); } } @@ -75,7 +75,7 @@ function book_save($op, $node) { ** new revision unless we are explicitly instructed to. */ - return array("format", "parent", "weight"); + return array("format", "parent", "weight", "log"); } else { /* @@ -84,7 +84,7 @@ function book_save($op, $node) { ** and are not promoted by default. See also: book_load(). */ - return array("created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight"); + return array("created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight", "log"); } } @@ -113,7 +113,7 @@ function book_link($type, $node = 0, $main = 0) { function book_load($node) { global $user, $REQUEST_URI; - $book = db_fetch_object(db_query("SELECT format, parent, weight FROM book WHERE nid = '$node->nid'")); + $book = db_fetch_object(db_query("SELECT format, parent, weight, log FROM book WHERE nid = '$node->nid'")); if (strstr($REQUEST_URI, "module.php?mod=node&op=edit")) { @@ -151,7 +151,7 @@ function book_insert($node) { $node->weight = 0; } - db_query("INSERT INTO book (nid, format, parent, weight) VALUES ('$node->nid', '$node->format', '$node->parent', '$node->weight')"); + db_query("INSERT INTO book (nid, format, parent, weight, log) VALUES ('$node->nid', '$node->format', '$node->parent', '$node->weight', '$node->log')"); } function book_update($node) { @@ -160,7 +160,7 @@ function book_update($node) { $node->weight = 0; } - db_query("UPDATE book SET format = '$node->format', parent = '$node->parent', weight = '$node->weight' WHERE nid = '$node->nid'"); + db_query("UPDATE book SET format = '$node->format', parent = '$node->parent', weight = '$node->weight', log = '$node->log' WHERE nid = '$node->nid'"); } function book_delete(&$node) { @@ -184,7 +184,7 @@ function book_form(&$node, &$help, &$error) { } $output .= form_textarea(t("Body"), "body", $node->body, 60, 20, t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", ""))); - $output .= form_textarea(t("Log message"), "history", $node->history, 60, 5, t("An explanation of the additions or updates being made to help the group understand your motivations.")); + $output .= form_textarea(t("Log message"), "log", $node->log, 60, 5, t("An explanation of the additions or updates being made to help the group understand your motivations.")); if (user_access("administer nodes")) { $output .= form_select(t("Weight"), "weight", $node->weight, array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30), t("The heavier pages will sink and the lighter pages will be positioned nearer the top.")); @@ -397,6 +397,10 @@ function book_view($node, $main = 0) { $output .= " <tr><td colspan=\"3\"><br />$node->body</td></tr>"; } + if ($node->moderate) { + $output .= " <tr><td colspan=\"3\"><hr /><b>". t("Log") .":</b><br />$node->log</td></tr>"; + } + if ($node->nid) { $output .= " <tr><td colspan=\"3\"><br />". book_tree($node->nid) ."</td></tr>"; } diff --git a/modules/book/book.module b/modules/book/book.module index f23ba1d06..56203777a 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -57,10 +57,10 @@ function book_save($op, $node) { if ($op == "create") { if (user_access("administer nodes")) { - return array("format", "parent", "weight"); + return array("format", "parent", "weight", "log"); } else { - return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight"); + return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight", "log"); } } @@ -75,7 +75,7 @@ function book_save($op, $node) { ** new revision unless we are explicitly instructed to. */ - return array("format", "parent", "weight"); + return array("format", "parent", "weight", "log"); } else { /* @@ -84,7 +84,7 @@ function book_save($op, $node) { ** and are not promoted by default. See also: book_load(). */ - return array("created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight"); + return array("created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight", "log"); } } @@ -113,7 +113,7 @@ function book_link($type, $node = 0, $main = 0) { function book_load($node) { global $user, $REQUEST_URI; - $book = db_fetch_object(db_query("SELECT format, parent, weight FROM book WHERE nid = '$node->nid'")); + $book = db_fetch_object(db_query("SELECT format, parent, weight, log FROM book WHERE nid = '$node->nid'")); if (strstr($REQUEST_URI, "module.php?mod=node&op=edit")) { @@ -151,7 +151,7 @@ function book_insert($node) { $node->weight = 0; } - db_query("INSERT INTO book (nid, format, parent, weight) VALUES ('$node->nid', '$node->format', '$node->parent', '$node->weight')"); + db_query("INSERT INTO book (nid, format, parent, weight, log) VALUES ('$node->nid', '$node->format', '$node->parent', '$node->weight', '$node->log')"); } function book_update($node) { @@ -160,7 +160,7 @@ function book_update($node) { $node->weight = 0; } - db_query("UPDATE book SET format = '$node->format', parent = '$node->parent', weight = '$node->weight' WHERE nid = '$node->nid'"); + db_query("UPDATE book SET format = '$node->format', parent = '$node->parent', weight = '$node->weight', log = '$node->log' WHERE nid = '$node->nid'"); } function book_delete(&$node) { @@ -184,7 +184,7 @@ function book_form(&$node, &$help, &$error) { } $output .= form_textarea(t("Body"), "body", $node->body, 60, 20, t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", ""))); - $output .= form_textarea(t("Log message"), "history", $node->history, 60, 5, t("An explanation of the additions or updates being made to help the group understand your motivations.")); + $output .= form_textarea(t("Log message"), "log", $node->log, 60, 5, t("An explanation of the additions or updates being made to help the group understand your motivations.")); if (user_access("administer nodes")) { $output .= form_select(t("Weight"), "weight", $node->weight, array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30), t("The heavier pages will sink and the lighter pages will be positioned nearer the top.")); @@ -397,6 +397,10 @@ function book_view($node, $main = 0) { $output .= " <tr><td colspan=\"3\"><br />$node->body</td></tr>"; } + if ($node->moderate) { + $output .= " <tr><td colspan=\"3\"><hr /><b>". t("Log") .":</b><br />$node->log</td></tr>"; + } + if ($node->nid) { $output .= " <tr><td colspan=\"3\"><br />". book_tree($node->nid) ."</td></tr>"; } diff --git a/modules/node.module b/modules/node.module index 069d6eeaf..cda4d98e3 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1226,7 +1226,7 @@ function node_page() { // this is an AND $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } else { - $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, changed DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } while ($node = db_fetch_object($result)) { diff --git a/modules/node/node.module b/modules/node/node.module index 069d6eeaf..cda4d98e3 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1226,7 +1226,7 @@ function node_page() { // this is an AND $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } else { - $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, changed DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } while ($node = db_fetch_object($result)) { diff --git a/modules/poll.module b/modules/poll.module index 769b1d067..d08d949dc 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -20,9 +20,9 @@ function poll_block() { poll_view($poll, 0, 1); } } - $blocks[0][subject] = "Latest poll"; + $blocks[0][subject] = strtr(t("Latest poll: %t"), array("%t" => $poll->title)); $blocks[0][content] = $poll->body; - $blocks[0][info] = "Most recent poll"; + $blocks[0][info] = t("Most recent poll"); return $blocks; } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 769b1d067..d08d949dc 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -20,9 +20,9 @@ function poll_block() { poll_view($poll, 0, 1); } } - $blocks[0][subject] = "Latest poll"; + $blocks[0][subject] = strtr(t("Latest poll: %t"), array("%t" => $poll->title)); $blocks[0][content] = $poll->body; - $blocks[0][info] = "Most recent poll"; + $blocks[0][info] = t("Most recent poll"); return $blocks; } |