mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
initial support customizable date format
This commit is contained in:
parent
f482c42db3
commit
6bb4218e44
|
@ -132,6 +132,10 @@ class Settings { /* {{{ */
|
|||
var $_availablelanguages = array();
|
||||
// default language (name of a subfolder in folder "languages")
|
||||
var $_language = "en_GB";
|
||||
// default date format
|
||||
var $_dateformat = "Y-m-d";
|
||||
// default date/time format
|
||||
var $_datetimformat = "Y-m-d H:i:s";
|
||||
// users are notified about document-changes that took place within the last $_updateNotifyTime seconds
|
||||
var $_updateNotifyTime = 86400;
|
||||
// files with one of the following endings can be viewed online
|
||||
|
@ -453,6 +457,8 @@ class Settings { /* {{{ */
|
|||
$this->_footNote = strval($tab["footNote"]);
|
||||
$this->_printDisclaimer = Settings::boolVal($tab["printDisclaimer"]);
|
||||
$this->_language = strval($tab["language"]);
|
||||
$this->_dateformat = strval($tab["dateformat"]);
|
||||
$this->_datetimeformat = strval($tab["datetimeformat"]);
|
||||
if(trim(strval($tab["availablelanguages"])))
|
||||
$this->_availablelanguages = explode(',',strval($tab["availablelanguages"]));
|
||||
$this->_theme = strval($tab["theme"]);
|
||||
|
@ -826,6 +832,8 @@ class Settings { /* {{{ */
|
|||
$this->setXMLAttributValue($node, "footNote", $this->_footNote);
|
||||
$this->setXMLAttributValue($node, "printDisclaimer", $this->_printDisclaimer);
|
||||
$this->setXMLAttributValue($node, "language", $this->_language);
|
||||
$this->setXMLAttributValue($node, "dateformat", $this->_dateformat);
|
||||
$this->setXMLAttributValue($node, "datetimeformat", $this->_datetimeformat);
|
||||
$this->setXMLAttributValue($node, "availablelanguages", implode(',', $this->_availablelanguages));
|
||||
$this->setXMLAttributValue($node, "theme", $this->_theme);
|
||||
$this->setXMLAttributValue($node, "overrideTheme", $this->_overrideTheme);
|
||||
|
|
|
@ -27,11 +27,19 @@ function formatted_size($size_bytes) { /* {{{ */
|
|||
} /* }}} */
|
||||
|
||||
function getReadableDate($timestamp) { /* {{{ */
|
||||
return date("Y-m-d", $timestamp);
|
||||
global $settings;
|
||||
if($settings->_dateformat)
|
||||
return date($settings->_dateformat, $timestamp);
|
||||
else
|
||||
return date("Y-m-d", $timestamp);
|
||||
} /* }}} */
|
||||
|
||||
function getLongReadableDate($timestamp) { /* {{{ */
|
||||
return date("Y-m-d H:i:s", $timestamp);
|
||||
global $settings;
|
||||
if($settings->_datetimeformat)
|
||||
return date($settings->_datetimeformat, $timestamp);
|
||||
else
|
||||
return date("Y-m-d H:i:s", $timestamp);
|
||||
} /* }}} */
|
||||
|
||||
/*
|
||||
|
|
|
@ -59,6 +59,8 @@ if ($action == "saveSettings")
|
|||
$settings->_footNote = $_POST["footNote"];
|
||||
$settings->_printDisclaimer = getBoolValue("printDisclaimer");
|
||||
$settings->_language = $_POST["language"];
|
||||
$settings->_dateformat = $_POST["dateformat"];
|
||||
$settings->_datetimeformat = $_POST["datetimeformat"];
|
||||
if(empty($_POST["availablelanguages"]))
|
||||
$settings->_availablelanguages = array();
|
||||
else
|
||||
|
|
|
@ -284,6 +284,8 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
|
|||
<?php $this->showConfigCheckbox('settings_printDisclaimer', 'printDisclaimer'); ?>
|
||||
<?php $this->showConfigOption('settings_available_languages', 'availablelanguages', getAvailableLanguages(), true, true); ?>
|
||||
<?php $this->showConfigOption('settings_language', 'language', getAvailableLanguages(), false, true); ?>
|
||||
<?php $this->showConfigText('settings_dateformat', 'dateformat'); ?>
|
||||
<?php $this->showConfigText('settings_datetimeformat', 'datetimeformat'); ?>
|
||||
<?php $this->showConfigOption('settings_theme', 'theme', UI::getStyles(), false, false); ?>
|
||||
<?php $this->showConfigCheckbox('settings_overrideTheme', 'overrideTheme'); ?>
|
||||
<?php $this->showConfigCheckbox('settings_onePageMode', 'onePageMode'); ?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user