mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
use new function getTsByPeriod()
This commit is contained in:
parent
01fd55832f
commit
2c01243ec5
|
@ -53,36 +53,20 @@ if (!isset($_POST["presetexpdate"]) || $_POST["presetexpdate"] == "") {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_expiration_date"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_expiration_date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_POST["presetexpdate"] == 'date' && $_POST["expdate"] == "") {
|
||||||
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_expiration_date"));
|
||||||
|
}
|
||||||
|
|
||||||
switch($_POST["presetexpdate"]) {
|
switch($_POST["presetexpdate"]) {
|
||||||
case "date":
|
case "date":
|
||||||
$expires = makeTsFromDate($_POST["expdate"]);
|
$expires = makeTsFromDate($_POST["expdate"]);
|
||||||
// $tmp = explode('-', $_POST["expdate"]);
|
|
||||||
// $expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
|
|
||||||
break;
|
|
||||||
case "1w":
|
|
||||||
$tmp = explode('-', date('Y-m-d'));
|
|
||||||
$expires = mktime(0,0,0, $tmp[1], $tmp[2]+7, $tmp[0]);
|
|
||||||
break;
|
|
||||||
case "1m":
|
|
||||||
$tmp = explode('-', date('Y-m-d'));
|
|
||||||
$expires = mktime(0,0,0, $tmp[1]+1, $tmp[2], $tmp[0]);
|
|
||||||
break;
|
|
||||||
case "1y":
|
|
||||||
$tmp = explode('-', date('Y-m-d'));
|
|
||||||
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+1);
|
|
||||||
break;
|
|
||||||
case "2y":
|
|
||||||
$tmp = explode('-', date('Y-m-d'));
|
|
||||||
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+2);
|
|
||||||
break;
|
|
||||||
case "3y":
|
|
||||||
$tmp = explode('-', date('Y-m-d'));
|
|
||||||
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+3);
|
|
||||||
break;
|
break;
|
||||||
case "never":
|
case "never":
|
||||||
default:
|
|
||||||
$expires = null;
|
$expires = null;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
$expires = getTsByPeriod($_POST["presetexpdate"], 's');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user