FCLT#90519 .css verversen als S(csstemplate) of S(csscust) aangepast worden
svn path=/Website/trunk/; revision=70588
This commit is contained in:
@@ -603,21 +603,48 @@ FCLTHeader =
|
||||
outFile.Close();
|
||||
}
|
||||
},
|
||||
// Kijk of default.csx nieuwer is dan onze temp-css. Dan verversen
|
||||
testTemplateCssRefresh: function ()
|
||||
{
|
||||
if (this._fso.FileExists(Server.MapPath(this._custCssPath()))) {
|
||||
var fcss = this._fso.GetFile(Server.MapPath(this._custCssPath()));
|
||||
var tcss = new Date(fcss.DateLastModified);
|
||||
}
|
||||
else
|
||||
tcss = 0;
|
||||
|
||||
var hinc = this._fso.GetFile(Server.MapPath(rooturl + "/appl/shared/header.inc"));
|
||||
var tinc = new Date(hinc.DateLastModified);
|
||||
if (tinc > tcss)
|
||||
{
|
||||
__Log("{0} is older ({1}) than header.inc ({2}), refreshing it.".format(this._custCssPath(), toISODateTimeString(tcss, true), toISODateTimeString(tinc, true)));
|
||||
// Purpose : Checks if the custom CSS file is outdated and regenerates it.
|
||||
// Logic : Compares timestamps of the CSS file, header.inc, and the latest
|
||||
// setting change. If either is newer, CSS is rebuilt.
|
||||
testTemplateCssRefresh: function () {
|
||||
// Initialize timestamps
|
||||
var tset = 0;
|
||||
var tcss = 0;
|
||||
|
||||
// Resolve file paths
|
||||
var cssPath = Server.MapPath(this._custCssPath());
|
||||
var headerPath = Server.MapPath(rooturl + "/appl/shared/header.inc");
|
||||
|
||||
// Check if custom CSS file exists
|
||||
if (this._fso.FileExists(cssPath)) {
|
||||
var fcss = this._fso.GetFile(cssPath);
|
||||
tcss = new Date(fcss.DateLastModified).getTime();
|
||||
}
|
||||
|
||||
// Get header.inc last modified time (for possible changes to this.defaultTemplate)
|
||||
var hinc = this._fso.GetFile(headerPath);
|
||||
var tinc = new Date(hinc.DateLastModified).getTime();
|
||||
|
||||
// Check settings if header is not newer (for possible styling changes)
|
||||
if (tinc <= tcss) {
|
||||
var sql = "SELECT MAX(fa.fac_audit_datum) AS last_changed"
|
||||
+ " FROM fac_audit fa"
|
||||
+ " JOIN fac_setting fs ON fs.fac_setting_key = fa.fac_audit_tabelkey"
|
||||
+ " WHERE fa.fac_audit_tabelnaam = 'fac_setting'"
|
||||
+ " AND fa.fac_audit_veldnaam = 'fac_setting_pvalue'"
|
||||
+ " AND fs.fac_setting_name IN ('csstemplate', 'custcss')";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var lastChanged = oRs("last_changed").Value;
|
||||
if (lastChanged === null) {
|
||||
lastChanged = 0;
|
||||
}
|
||||
tset = new Date(lastChanged).getTime();
|
||||
oRs.Close();
|
||||
}
|
||||
|
||||
// Regenerate CSS if outdated
|
||||
if (tinc > tcss || tset > tcss) {
|
||||
this.generateTemplateCss(undefined, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user