feed editor: show purge interval correctly if FORCE_ARTICLE_PURGE is set
This commit is contained in:
parent
0868ff9d64
commit
33a5ecd2ce
|
@ -636,14 +636,20 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
|
|
||||||
print "<label>" . __('Article purging:') . "</label> ";
|
print "<label>" . __('Article purging:') . "</label> ";
|
||||||
|
|
||||||
|
if (FORCE_ARTICLE_PURGE == 0) {
|
||||||
$local_purge_intervals = $purge_intervals;
|
$local_purge_intervals = $purge_intervals;
|
||||||
$default_purge_interval = get_pref("PURGE_OLD_DAYS");
|
$default_purge_interval = get_pref("PURGE_OLD_DAYS");
|
||||||
|
|
||||||
if ($default_purge_interval > 0)
|
if ($default_purge_interval > 0)
|
||||||
$local_purge_intervals[0] .= " " . T_sprintf("(%d days)", $default_purge_interval);
|
$local_purge_intervals[0] .= " " . T_nsprintf('(%d day)', '(%d days)', $default_purge_interval, $default_purge_interval);
|
||||||
else
|
else
|
||||||
$local_purge_intervals[0] .= " " . sprintf("(%s)", __("Disabled"));
|
$local_purge_intervals[0] .= " " . sprintf("(%s)", __("Disabled"));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$purge_interval = FORCE_ARTICLE_PURGE;
|
||||||
|
$local_purge_intervals = [ T_nsprintf('%d day', '%d days', $purge_interval, $purge_interval) ];
|
||||||
|
}
|
||||||
|
|
||||||
print_select_hash("purge_interval", $purge_interval, $local_purge_intervals,
|
print_select_hash("purge_interval", $purge_interval, $local_purge_intervals,
|
||||||
'dojoType="fox.form.Select" ' .
|
'dojoType="fox.form.Select" ' .
|
||||||
((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
|
((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
|
||||||
|
|
|
@ -401,6 +401,11 @@
|
||||||
return vsprintf(__(array_shift($args)), $args);
|
return vsprintf(__(array_shift($args)), $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function T_nsprintf() {
|
||||||
|
$args = func_get_args();
|
||||||
|
return vsprintf(_ngettext(array_shift($args), array_shift($args), array_shift($args)), $args);
|
||||||
|
}
|
||||||
|
|
||||||
function is_server_https() {
|
function is_server_https() {
|
||||||
return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
|
return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue