- Added an option to make "node previews" optional. Patch by n8. See

"site configuration > modules > node".
4.2.x
Dries Buytaert 2003-05-10 13:54:38 +00:00
parent c886dfd05e
commit 7aa28ea114
2 changed files with 8 additions and 0 deletions

View File

@ -450,6 +450,7 @@ function node_search($keys) {
function node_settings() {
$output .= form_select(t("Number of posts on main page"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of posts to display on overview pages such as the main page."));
$output .= form_select(t("Length of trimmed posts"), "teaser_length", variable_get("teaser_length", 600), array(0 => t("Unlimited"), 200 => t("200 characters"), 400 => t("400 characters"), 600 => t("600 characters"), 800 => t("800 characters"), 1000 => t("1000 characters"), 1200 => t("1200 characters"), 1400 => t("1400 characters"), 1600 => t("1600 characters"), 1800 => t("1800 characters"), 2000 => t("2000 characters")), t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'."));
$output .= form_select(t("Preview post"), "node_preview", variable_get("node_preview", 0), array(t("Optional"), t("Required")), t("Must users preview posts before submitting?"));
return $output;
}
@ -1060,6 +1061,9 @@ function node_form($edit, $error = NULL) {
if ($edit->title && $edit->type && !$error) {
$output .= form_submit(t("Submit"));
}
elseif (!variable_get("node_preview", 0)) {
$output .= form_submit(t("Submit"));
}
if ($edit->nid && node_access("delete", $edit)) {
$output .= form_submit(t("Delete"));

View File

@ -450,6 +450,7 @@ function node_search($keys) {
function node_settings() {
$output .= form_select(t("Number of posts on main page"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of posts to display on overview pages such as the main page."));
$output .= form_select(t("Length of trimmed posts"), "teaser_length", variable_get("teaser_length", 600), array(0 => t("Unlimited"), 200 => t("200 characters"), 400 => t("400 characters"), 600 => t("600 characters"), 800 => t("800 characters"), 1000 => t("1000 characters"), 1200 => t("1200 characters"), 1400 => t("1400 characters"), 1600 => t("1600 characters"), 1800 => t("1800 characters"), 2000 => t("2000 characters")), t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'."));
$output .= form_select(t("Preview post"), "node_preview", variable_get("node_preview", 0), array(t("Optional"), t("Required")), t("Must users preview posts before submitting?"));
return $output;
}
@ -1060,6 +1061,9 @@ function node_form($edit, $error = NULL) {
if ($edit->title && $edit->type && !$error) {
$output .= form_submit(t("Submit"));
}
elseif (!variable_get("node_preview", 0)) {
$output .= form_submit(t("Submit"));
}
if ($edit->nid && node_access("delete", $edit)) {
$output .= form_submit(t("Delete"));