% /* $Revision$ $Id$ File: shared/header.inc Description: Generieke serverside header functie. Stelt de HTML header samen op basis van de meegegeven eisen. Parameters: params: title outputmode (default 0=screen) plugins [] js [] Context: Eenmalig per ASP, automatisch via shared.inc Result: Note: Gebruikt veel de globale rooturl die tegenwoordig autodetect is Deprecated aanroepen als volgt kunnen gewoon verwijderd worden FCLTHeader.Generate({ root: "../../appl/" }); FCLTHeader.Set({root: "../../../appl/"}); */ /************************************************************/ // Huidige jQuery versie: 3.6.0 // Huidige jQuery versie gebruikt voor mobile: 2.2.4 (!= jquery.mobile versie) // (nog) geen nieuwere versie ivm incompatibiliteit tussen laatste stable jQuery-mobile (1.4.5) & jQuery 3.x+ // Huidige jQuery-ui versie: 1.13.0 if (typeof FCLTHeader != "undefined") { Response.Write("common.inc is indirect dubbel included. Dat mag niet.") Response.End; } FCLTHeader = { filters: null, advfilters: null, _plugins : [], _params: { title: getQParam("_titel_", null), outputmode: 0, plugins: [], js: [], css: [], extrahead: [] }, _myPush: function (arr, itm) { var j; for (j = 0; j < arr.length; j++) { if (typeof itm == "string" && arr[j].toLowerCase() == itm.toLowerCase() || arr[j] == itm) return; // hij is er al } arr.push(itm); }, Title: function(title) { // TODO: Titel van het tabje zetten. FCLTHeader._params.title = title; }, Set: function(params) { var i; for (i in params) FCLTHeader._params[i] = params[i]; }, Requires: function(params) { if (JSON_Result) __SafeLog("JSON_Result staat aan, dan is FCLTHeader.Requires erg onlogisch."); if (!params) params = {}; var i, j; // 'Explodeer' de plugins naar onderdelen if (params.plugins) for (i = 0; i < params.plugins.length; i++) { this._plugins[params.plugins[i]] = true; var i; switch (params.plugins[i]) { case "bootstrap": FCLTHeader.Requires({js: [rooturl + "/appl/localscripts/bootstrap/js/bootstrap.min.js"], css: [rooturl + "/appl/localscripts/bootstrap/css/bootstrap.min.css"]}); case "masonry": FCLTHeader.Requires({js: [rooturl + "/appl/localscripts/masonry/masonry.min.js"]}); case "jQuery": FCLTHeader.Requires({js: ["jQuery.js", "FcltJquery.js"]}); FCLTHeader.Requires({js: ["jquery.toast.min.js"], css: [rooturl + "/appl/localscripts/jquery.toast.min.css"]}); break; case "suggest": FCLTHeader.Requires({js: [rooturl + "/appl/shared/suggest/suggest.js"], css: [rooturl + "/appl/shared/suggest/suggest.css"]}); break; case "kenmerk": FCLTHeader.Requires({js: ["jquery-ui.js", "modal_kenmerken.js", "date.js", rooturl + "/appl/shared/kenmerk_js.asp", "jquery.timepicker-table.js"], css: ["timePicker-table.css"]}); break; case "modernizr": FCLTHeader.Requires({js: [rooturl + "/appl/pda/modernizr.js"]}); break; default: _AiAi("INTERNAL_ERROR_PLUGIN_"+params.plugins[i]+"_IS_ONBEKEND"); } } if (params.js) for (i = 0; i < params.js.length; i++) { if (params.js[i].toLowerCase() != "fcltmgr.js") FCLTHeader._myPush(FCLTHeader._params.js, params.js[i]); }; if (params.css) for (i = 0; i < params.css.length; i++) { FCLTHeader._myPush(FCLTHeader._params.css, params.css[i]); }; if (params.extrahead) FCLTHeader._myPush(FCLTHeader._params.extrahead, params.extrahead); }, _fso:Server.CreateObject("Scripting.FileSystemObject"), AddTimeStamp: function(fPath, isOptional) { fPath = fPath.toLowerCase(); // canonical can improve caching if (fPath.indexOf(rooturl.toLowerCase()) == 0) fPath = rooturl + fPath.substring(rooturl.length); // Afblijven van rooturl-deel, cookies verdwijnen anders try { var f = this._fso.GetFile(Server.MapPath(fPath)); var ts=new Date(f.DateLastModified); return fPath + "?" + Math.floor(ts.getTime()/1000); } catch(e) { if (isOptional) return false; // niet erg Response.Write("\">
Internal error: kan bestand " + fPath + " niet vinden/openen
"); Response.Write(e.description); Response.End; } }, AddStylesheet: function(fPath, isOptional) { var timedpath = this.AddTimeStamp(fPath, isOptional); if (timedpath) { %> <% } }, _templateCss: rooturl + "/cache/" + customerId + ".css", _mobileTemplateCss: rooturl + "/cache/m" + customerId + ".css", _webAppManifest: rooturl + "/cache/mf" + customerId + ".json", // params // cssmode: 0: is normale customer css // 1: is default css // 2: concept css uit params.csstemplate Generate: function (params) { if (!params) params = {}; if (params.outputmode == 2 || params.outputmode == 6) // Excel (incl. flex) { if (S("excel_mode") == 1) { params.outputmode = 4; } else { Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader ("content-disposition", "inline; filename=facilitor.xls"); %> <% return; // Excel is heel kaal } } if (params.outputmode == 4) // csv { Response.ContentType = "text.csv"; Response.AddHeader ("content-disposition", "attachment; filename=facilitor.csv"); return; // csv is heel kaal } if (params.mobile) // mobile { var themeColor = S("csstemplate")["theme_color"] || this.defaultTemplate["theme_color"]; %> <% } %> <%=S("http_meta_head")%> <% // FSN#14103 Voorkom back-button problemen // user_lang en rooturl resp. voor date.js en FcltMgr.js %> "); FCLTHeader.AddStylesheet(rooturl + "/appl/fontawesome/css/fontawesome.min.css"); FCLTHeader.AddStylesheet(rooturl + "/appl/fontawesome/css/thin.min.css"); FCLTHeader.AddStylesheet(rooturl + "/appl/fontawesome/css/light.min.css"); FCLTHeader.AddStylesheet(rooturl + "/appl/fontawesome/css/regular.min.css"); FCLTHeader.AddStylesheet(rooturl + "/appl/fontawesome/css/solid.min.css"); FCLTHeader.AddStylesheet(rooturl + "/appl/fontawesome/css/brands.min.css"); Response.Write("" + L("lcl_shared_pin_removed_error") + "