Commit ded0d669 authored by Gábor Hojtsy's avatar Gábor Hojtsy

- Set node status to 0 (depublish) in case of the user specified

  a publishing date (so she really would not like to publish the
  stuff yet)
- Provide one more example date
- Use real English date/times when putting the date back to
  the input field, strtotime() only understands that
parent 94688afd
......@@ -64,7 +64,9 @@
if ($node->timestamp_posted) {
if (strtotime($node->timestamp_posted) === -1) {
$error["timestamp_posted"] = theme("theme_error", t("Invalid date format"));
}
} else {
$node->status = 0;
}
}
if ($node->timestamp_hidden) {
......@@ -83,19 +85,20 @@
break;
case "form admin":
if ($node->nid) {
$date_format = "m/d/y H:i";
$sql = "SELECT timestamp_hidden, timestamp_posted FROM scheduler WHERE nid = '$node->nid'";
$result = db_query($sql);
$schedule = db_fetch_object($result);
if ($schedule->timestamp_posted) {
$node->timestamp_posted = format_date($schedule->timestamp_posted);
$node->timestamp_posted = date($date_format, $schedule->timestamp_posted);
}
if ($schedule->timestamp_hidden) {
$node->timestamp_hidden = format_date($schedule->timestamp_hidden);
$node->timestamp_hidden = date($date_format, $schedule->timestamp_hidden);
}
}
$form .= form_textfield(t("Automatically post document"), "timestamp_posted", ($node->timestamp_posted ? $node->timestamp_posted : ""), 30, 55, $error["timestamp_posted"] ? $error["timestamp_posted"] : sprintf(t("The date at which your document will be automatically posted. Leave empty if you don't want to schedule this document, or enter an English date format. Example input: '%s', '%s', '%s', '%s' ..."), date("j F Y G:i"), date("m/d/y H:i"), date("F j, Y H:i"), "1 week"));
$form .= form_textfield(t("Automatically hide document"), "timestamp_hidden", ($node->timestamp_hidden ? $node->timestamp_hidden : ""), 30, 55, $error["timestamp_hidden"] ? $error["timestamp_hidden"] : sprintf(t("The date at which your document will be automatically hidden. Leave empty if you don't want to schedule this document, or enter an English date format. Example input: '%s', '%s', '%s', '%s' ..."), date("j F Y G:i"), date("m/d/y H:i"), date("F j, Y H:i"), "next Thursday"));
$form .= form_textfield(t("Automatically post document"), "timestamp_posted", ($node->timestamp_posted ? $node->timestamp_posted : ""), 30, 55, $error["timestamp_posted"] ? $error["timestamp_posted"] : sprintf(t("The date at which your document will be automatically posted. Leave empty if you don't want to schedule this document, or enter an English date format. Example input: '%s', '%s', '%s', '%s', '%s' ..."), date("j F Y G:i"), date("m/d/y H:i"), date("F j, Y H:i"), "1 week", "+1 day"));
$form .= form_textfield(t("Automatically hide document"), "timestamp_hidden", ($node->timestamp_hidden ? $node->timestamp_hidden : ""), 30, 55, $error["timestamp_hidden"] ? $error["timestamp_hidden"] : sprintf(t("The date at which your document will be automatically hidden. Leave empty if you don't want to schedule this document, or enter an English date format. Example input: '%s', '%s', '%s', '%s', '%s' ..."), date("j F Y G:i"), date("m/d/y H:i"), date("F j, Y H:i"), "next Thursday", "+1 week"));
return $form;
}
}
......
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