Commit 5598417c authored by Dries's avatar Dries
Browse files

- Some small improvements/fixes to the node system.  Suggested by Marco.
parent 0475d4fb
......@@ -637,7 +637,7 @@ function node_admin() {
print node_admin_edit($id);
break;
case t("Preview"):
$edit = object2array(node_validate($edit, $error));
$edit = node_validate($edit, $error);
print node_preview($edit);
break;
case t("Submit"):
......@@ -954,6 +954,8 @@ function node_preview($node, $error = NULL) {
$node = array2object($node);
if (node_access("create", $node) || node_access("update", $node)) {
/*
** Load the user's name when needed:
*/
......@@ -1020,6 +1022,7 @@ function node_preview($node, $error = NULL) {
}
return node_form($node, $error);
}
}
function node_submit($node) {
......@@ -1085,11 +1088,6 @@ function node_submit($node) {
watchdog("special", "$node->type: updated '$node->title'");
$output = t("The node has been updated.");
}
else {
watchdog("warning", "$node->type: not authorized to update node");
$output = t("You are not authorized to update this node.");
}
}
else {
......@@ -1132,10 +1130,6 @@ function node_submit($node) {
watchdog("special", "$node->type: added '$node->title'");
$output = t("Thanks for your submission.");
}
else {
watchdog("warning", "$node->type: not authorized to create node");
$output = t("You are not authorized to create this node.");
}
}
/*
......@@ -1210,10 +1204,6 @@ function node_delete($edit) {
$output = form($output);
}
}
else {
watchdog("warning", "$node->type: not authorized to remove node");
$output = t("You are not authorized to remove this node.");
}
return $output;
}
......
......@@ -637,7 +637,7 @@ function node_admin() {
print node_admin_edit($id);
break;
case t("Preview"):
$edit = object2array(node_validate($edit, $error));
$edit = node_validate($edit, $error);
print node_preview($edit);
break;
case t("Submit"):
......@@ -954,6 +954,8 @@ function node_preview($node, $error = NULL) {
$node = array2object($node);
if (node_access("create", $node) || node_access("update", $node)) {
/*
** Load the user's name when needed:
*/
......@@ -1020,6 +1022,7 @@ function node_preview($node, $error = NULL) {
}
return node_form($node, $error);
}
}
function node_submit($node) {
......@@ -1085,11 +1088,6 @@ function node_submit($node) {
watchdog("special", "$node->type: updated '$node->title'");
$output = t("The node has been updated.");
}
else {
watchdog("warning", "$node->type: not authorized to update node");
$output = t("You are not authorized to update this node.");
}
}
else {
......@@ -1132,10 +1130,6 @@ function node_submit($node) {
watchdog("special", "$node->type: added '$node->title'");
$output = t("Thanks for your submission.");
}
else {
watchdog("warning", "$node->type: not authorized to create node");
$output = t("You are not authorized to create this node.");
}
}
/*
......@@ -1210,10 +1204,6 @@ function node_delete($edit) {
$output = form($output);
}
}
else {
watchdog("warning", "$node->type: not authorized to remove node");
$output = t("You are not authorized to remove this node.");
}
return $output;
}
......
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