Commit bf810154 authored by Dries's avatar Dries

- Added a "queue for moderation"-toggle to a node's admin form and
  updated the node modules to support this.
parent 6c69a8bf
......@@ -48,7 +48,12 @@ function blog_save($op, $node) {
}
if ($op == "create") {
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
if (user_access("adminster nodes")) {
return array();
}
else {
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
}
}
if ($op == "decline") {
......
......@@ -48,7 +48,12 @@ function blog_save($op, $node) {
}
if ($op == "create") {
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
if (user_access("adminster nodes")) {
return array();
}
else {
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
}
}
if ($op == "decline") {
......
......@@ -56,7 +56,12 @@ function book_save($op, $node) {
}
if ($op == "create") {
return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight");
if (user_access("adminster nodes")) {
return array("format", "parent", "weight");
}
else {
return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight");
}
}
if ($op == "decline") {
......
......@@ -56,7 +56,12 @@ function book_save($op, $node) {
}
if ($op == "create") {
return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight");
if (user_access("adminster nodes")) {
return array("format", "parent", "weight");
}
else {
return array("format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight");
}
}
if ($op == "decline") {
......
......@@ -708,7 +708,6 @@ function node_validate($node, &$error) {
$node = node_object($node);
/*
** Validate the title field:
*/
......@@ -870,8 +869,9 @@ function node_form($edit) {
$output .= form_textfield(t("Authored on"), "date", $edit->date, 20, 25, $error["date"]);
$output .= "<br />";
$output .= form_select(t("Set public/published"), "status", $edit->status, array("Disabled", "Enabled"));
$output .= form_select(t("Allow users comments"), "comment", $edit->comment, array("Disabled", "Enabled"));
$output .= form_select(t("Queue for moderation"), "moderate", $edit->moderate, array("Disabled", "Enabled"));
$output .= form_select(t("Promote to front page"), "promote", $edit->promote, array("Disabled", "Enabled"));
$output .= form_select(t("Allow users comments"), "comment", $edit->comment, array("Disabled", "Enabled"));
$output .= form_select(t("Create new revision"), "revision", $edit->revision, array("Disabled", "Enabled"));
}
......@@ -973,17 +973,17 @@ function node_preview($node) {
*/
if ($node->nid) {
$node = array_merge($node, module_invoke($node->type, "save", "update", $node));
$view = array_merge($node, module_invoke($node->type, "save", "update", $node));
}
else {
$node = array_merge($node, module_invoke($node->type, "save", "create", $node));
$view = array_merge($node, module_invoke($node->type, "save", "create", $node));
}
/*
** Display a preview of the node:
*/
node_view($node);
node_view($view);
return node_form($node);
}
......
......@@ -708,7 +708,6 @@ function node_validate($node, &$error) {
$node = node_object($node);
/*
** Validate the title field:
*/
......@@ -870,8 +869,9 @@ function node_form($edit) {
$output .= form_textfield(t("Authored on"), "date", $edit->date, 20, 25, $error["date"]);
$output .= "<br />";
$output .= form_select(t("Set public/published"), "status", $edit->status, array("Disabled", "Enabled"));
$output .= form_select(t("Allow users comments"), "comment", $edit->comment, array("Disabled", "Enabled"));
$output .= form_select(t("Queue for moderation"), "moderate", $edit->moderate, array("Disabled", "Enabled"));
$output .= form_select(t("Promote to front page"), "promote", $edit->promote, array("Disabled", "Enabled"));
$output .= form_select(t("Allow users comments"), "comment", $edit->comment, array("Disabled", "Enabled"));
$output .= form_select(t("Create new revision"), "revision", $edit->revision, array("Disabled", "Enabled"));
}
......@@ -973,17 +973,17 @@ function node_preview($node) {
*/
if ($node->nid) {
$node = array_merge($node, module_invoke($node->type, "save", "update", $node));
$view = array_merge($node, module_invoke($node->type, "save", "update", $node));
}
else {
$node = array_merge($node, module_invoke($node->type, "save", "create", $node));
$view = array_merge($node, module_invoke($node->type, "save", "create", $node));
}
/*
** Display a preview of the node:
*/
node_view($node);
node_view($view);
return node_form($node);
}
......
......@@ -10,7 +10,7 @@ function statistics_help() {
$output .= "<p>1. The external referrer log indicates which other sites are linking your website and how many visitors they refer. Each link made to your site - when a user on another site clicks on a link to your site - generates a referral entry in the log.</p>";
$output .= "<p>2. The internal referrer log indicates the referrals within the domain of your site. This log is useful for assessing and evaluating the structure of your website, to learn which pages are being accessed, and to gain insight into the way users are navigating your site.</p>";
$output .= "<p>Drupal automatically rotates the referrer logs after a set period of time. The life-time of the accumulated data can be configured via the settings and filters option under site administration.</p>";
$output .= "<p>Warning: Drupal gets the referrer information from the HTTP_REFERER environment variable. This not always set properly by web browsers.</p>";
$output .= "<p>Warning: Drupal gets the referrer information from the HTTP_REFERER environment variable. This is not always set properly by web browsers.</p>";
return $output;
}
......
......@@ -10,7 +10,7 @@ function statistics_help() {
$output .= "<p>1. The external referrer log indicates which other sites are linking your website and how many visitors they refer. Each link made to your site - when a user on another site clicks on a link to your site - generates a referral entry in the log.</p>";
$output .= "<p>2. The internal referrer log indicates the referrals within the domain of your site. This log is useful for assessing and evaluating the structure of your website, to learn which pages are being accessed, and to gain insight into the way users are navigating your site.</p>";
$output .= "<p>Drupal automatically rotates the referrer logs after a set period of time. The life-time of the accumulated data can be configured via the settings and filters option under site administration.</p>";
$output .= "<p>Warning: Drupal gets the referrer information from the HTTP_REFERER environment variable. This not always set properly by web browsers.</p>";
$output .= "<p>Warning: Drupal gets the referrer information from the HTTP_REFERER environment variable. This is not always set properly by web browsers.</p>";
return $output;
}
......
......@@ -38,6 +38,10 @@ function story_save($op, $node) {
if ($op == "decline") {
return array("status" => 0, "promote" => 0);
}
if ($op == "update") {
return array();
}
}
function story_help() {
......
......@@ -38,6 +38,10 @@ function story_save($op, $node) {
if ($op == "decline") {
return array("status" => 0, "promote" => 0);
}
if ($op == "update") {
return array();
}
}
function story_help() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment