show expiration date in options of preselected dates

This commit is contained in:
Uwe Steinmann 2023-09-29 14:31:35 +02:00
parent 2c01243ec5
commit 520515303a

View File

@ -68,14 +68,16 @@ $(document).ready( function() {
<?php echo createHiddenFieldWithKey('setexpires'); ?>
<?php
$this->contentContainerStart();
$df = !empty($settings->_datetimeformat) ? $settings->_datetimeformat : 'Y-m-d H:i:s';
$options = array();
$options[] = array('never', getMLText('does_not_expire'));
$options[] = array('date', getMLText('expire_by_date'), $expdate != '');
$options[] = array('1w', getMLText('expire_in_1w'));
$options[] = array('1m', getMLText('expire_in_1m'));
$options[] = array('1y', getMLText('expire_in_1y'));
$options[] = array('2y', getMLText('expire_in_2y'));
$options[] = array('3y', getMLText('expire_in_3y'));
$options[] = array('tomorrow', getMLText('expire_tomorrow').' ('.date($df, getTsByPeriod('tomorrow', 's')).')');
$options[] = array('1w', getMLText('expire_in_1w').' ('.date($df, getTsByPeriod('1w', 's')).')');
$options[] = array('1m', getMLText('expire_in_1m').' ('.date($df, getTsByPeriod('1m', 's')).')');
$options[] = array('1y', getMLText('expire_in_1y').' ('.date($df, getTsByPeriod('1y', 's')).')');
$options[] = array('2y', getMLText('expire_in_2y').' ('.date($df, getTsByPeriod('2y', 's')).')');
$options[] = array('3y', getMLText('expire_in_3y').' ('.date($df, getTsByPeriod('3y', 's')).')');
$this->formField(
getMLText("preset_expires"),
array(