Error executing template "Designs/Tjlaan_Iris/_parsed/Ansoegningsblanket-Sendt.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_6a30fac9fed641cfa27297021419771b.Ansoegningsblanket.HexToBytes(String hex) in D:\home\site\wwwroot\Files\Templates\Designs\Tjlaan_Iris\_parsed\Ansoegningsblanket-Sendt.parsed.cshtml:line 525
   at CompiledRazorTemplates.Dynamic.RazorEngine_6a30fac9fed641cfa27297021419771b.Ansoegningsblanket.XorDecrypt(String value) in D:\home\site\wwwroot\Files\Templates\Designs\Tjlaan_Iris\_parsed\Ansoegningsblanket-Sendt.parsed.cshtml:line 561
   at CompiledRazorTemplates.Dynamic.RazorEngine_6a30fac9fed641cfa27297021419771b.Execute() in D:\home\site\wwwroot\Files\Templates\Designs\Tjlaan_Iris\_parsed\Ansoegningsblanket-Sendt.parsed.cshtml:line 590
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Web; 2 @using System.IO; 3 @using System.Linq; 4 @using Dynamicweb.Environment 5 6 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- COOKIE -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 7 @{ 8 IList<string> AllowedCookieCategories = new List<string>() { "Essential" }; 9 foreach (string s in CookieManager.GetCategories()) 10 { 11 if (s == "Essential") 12 { 13 continue; 14 } 15 else if (CookieManager.CookieOptInLevelExists && (CookieManager.GetCookieOptInLevel() == CookieOptInLevel.All || (CookieManager.CookieOptInLevelExists && System.Web.HttpContext.Current.Request.Cookies.Get("Dynamicweb.CookieOptInLevel").Value.IndexOf(s) > -1))) 16 { 17 AllowedCookieCategories.Add(s); 18 } 19 } 20 } 21 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 22 23 <!DOCTYPE html> 24 @{ 25 var thecssfile = new FileInfo(HttpContext.Current.Server.MapPath("~" + @GetString("Template:DesignBaseUrl") + "/css/i_app.css")); 26 var thecssstamp = thecssfile.LastWriteTime.ToString("yyyyMMddhhmmss"); 27 var thejsfile = new FileInfo(HttpContext.Current.Server.MapPath("~" + @GetString("Template:DesignBaseUrl") + "/javascript/compressed/i_compressed.js")); 28 var thejsstamp = thejsfile.LastWriteTime.ToString("yyyyMMddhhmmss"); 29 30 var url = GetGlobalValue("Global:Request.Host"); 31 var imagetag = GetString("Item.OpenGraphImage.Value"); 32 var cookieText = ""; 33 if (!string.IsNullOrEmpty(GetString("DwCookieWarning"))) 34 { 35 cookieText = GetString("Item.Area.CookieText").Replace("\"", "'").Replace(Environment.NewLine, ""); 36 } 37 var headerSettings = ""; 38 if (GetString("Item.Area.FixedHeader") == "False") 39 { 40 headerSettings = "content-after-header"; 41 } 42 else 43 { 44 headerSettings = "content-behind-header"; 45 } 46 47 string maxWidth = ""; 48 if (GetBoolean("Item.Area.ContentMaxWidth")) 49 { 50 maxWidth = "max"; 51 } 52 } 53 <html lang='@GetGlobalValue("Global:Area.LongLang")'> 54 <head> 55 <meta charset="UTF-8"> 56 <title>@GetValue("Title")</title> 57 @GetValue("MetaTags") 58 @GetValue("CopyRightNotice") 59 60 61 <meta name="format-detection" content="telephone=no"> 62 <meta name="Generator" content="Dynamicweb 9"> 63 64 @if (!string.IsNullOrEmpty(GetString("Title"))) 65 { 66 <meta property="og:title" content='@GetString("Title")'> 67 } 68 @if (!string.IsNullOrEmpty(GetString("Meta.Description"))) 69 { 70 <meta property="og:description" content='@GetString("Meta.Description")'> 71 } 72 @if (!string.IsNullOrEmpty(GetString("Item.OpenGraphImage"))) 73 { 74 <meta property="og:image" content='http://@url/@imagetag'> 75 } 76 77 <meta property="og:site_name" content='@GetValue("Item.Area.CompanyName")'> 78 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 79 <link rel="stylesheet" href="/Files/Templates/Designs/Tjlaan_Iris/css/i_app.css?v=@thecssstamp"> 80 81 @* 82 Go to https://realfavicongenerator.net/ and create your favicon code and insert it below instead of the- 83 REMEMBER to set the color so they match the style of the site and set the favicon path to images/favicon - AND upload the generated files to that folder in the IRIS theme in the Designs folder 84 *@ 85 86 @* -- -- -- ER INDSAT FOR AT FÅ DE GAMLE FORMULARER "FOR DATALISTER" TIL AT VIRKE -- -- -- *@ 87 @*<link href="/Files/Templates/Designs/Tjlaan_Iris/javascript/validation-2013/formValidation.min.css" rel="stylesheet"> 88 <script src="/Files/Templates/Designs/Tjlaan_Iris/javascript/validation-2013/formValidation.min.js"></script>*@ 89 90 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> 91 92 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 93 94 @GetValue("Item.Area.ScriptsHead") 95 <style> 96 #loading-overlay { 97 background: #fff; 98 position: fixed; 99 height: 100%; 100 width: 100%; 101 z-index: 9999; 102 top: 0; 103 left: 0; 104 float: left; 105 text-align: center; 106 padding-top: 25%; 107 } 108 109 .datepicker.dropdown-menu { 110 position: absolute; 111 } 112 </style> 113 @GetValue("Stylesheets") 114 @GetValue("Javascripts") 115 </head> 116 117 <body class='@GetGlobalValue("Global:Page.NavigationTag") @headerSettings'> 118 119 120 @GetValue("Item.Area.ScriptsBodyBegin") 121 <div id="loading-overlay"></div> 122 <div class="page-wrap @maxWidth" id="page-wrap"> 123 124 @if (GetBoolean("Item.Area.ShowMetaHeader")) { 125 <header class="container-fluid header Fixed"> 126 <div class="meta-header hidden-xs hidden-sm"> 127 @if (GetString("Item.Area.HeaderContentWidth") != "full") 128 { 129 @:<div class="container"> 130 } 131 <div class="row"> 132 @{ 133 string hasLangs = ""; 134 135 if (GetLoop("Item.Area.AreaLanguages").Any()) { 136 hasLangs = "has-langs"; 137 } 138 } 139 <div class="pull-right"> 140 141 @RenderNavigation(new 142 { 143 StartLevel = 1, 144 EndLevel = 1, 145 Template = "I_MetaMenu.xslt" 146 }) 147 @*<div class="search-btn @hasLangs"><i class="fa fa-search"></i> @Translate("Search","Søg")</div>*@ 148 @if (GetLoop("Item.Area.AreaLanguages").Any()) { 149 150 string langLayout = GetString("Item.Area.LanguageLayout"); 151 string langNavClass = ""; 152 if(langLayout == "dropdown" || langLayout == "dropdown-icon-text"){ 153 langNavClass = "language-picker-dropdown"; 154 } else { 155 langNavClass = "language-picker-row"; 156 } 157 <nav class="@langNavClass hidden-xs"> 158 @if(langNavClass == "language-picker-dropdown"){ 159 <ul class="list-unstyled"> 160 <li> 161 <a> 162 @if(GetString("Item.Area.LanguageDropdownIcon") == "globe") 163 { 164 <i class="fa fa-globe"></i> 165 } else { 166 foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 167 { 168 169 if(l.GetBoolean("Item.Area.AreaLanguages.LanguageActive")){ 170 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 171 <img class="active-flag" src="@langIcon"> 172 } 173 } 174 } 175 </a> 176 <ul class="list-unstyled"> 177 @foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 178 { 179 string langActive = l.GetBoolean("Item.Area.AreaLanguages.LanguageActive") == true ? "activeitem" : ""; 180 string langUrl = l.GetString("Item.Area.AreaLanguages.LanguageURL"); 181 string langName = l.GetString("Item.Area.AreaLanguages.LanguageName"); 182 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 183 string langIconPresent = ""; 184 185 if(langLayout == "dropdown-icon-text"){ 186 langIconPresent = "lang-icon"; 187 } 188 <li class="@langActive"> 189 <a href="@langUrl" class="@langActive @langIconPresent" title="@langName">@if(langLayout == "dropdown-icon-text"){<img src="@langIcon">}@langName</a> 190 </li> 191 } 192 </ul> 193 </li> 194 </ul> 195 } else { 196 <ul class="list-unstyled @langNavClass"> 197 @foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 198 { 199 string langActive = l.GetBoolean("Item.Area.AreaLanguages.LanguageActive") == true ? "activeitem" : ""; 200 string langUrl = l.GetString("Item.Area.AreaLanguages.LanguageURL"); 201 string langName = l.GetString("Item.Area.AreaLanguages.LanguageName"); 202 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 203 204 <li class="@langActive"> 205 <a href="@langUrl" class="@langActive" title="@langName"><img src="@langIcon" alt="@langName"></a> 206 </li> 207 208 } 209 </ul> 210 } 211 </nav> 212 } 213 </div> 214 </div> 215 216 @if (GetString("Item.Area.HeaderContentWidth") != "full") 217 { 218 @:</div> 219 } 220 </div> 221 @if (!string.IsNullOrEmpty(GetString("DwAreaSearchPageID"))) 222 { 223 <div class="search-bar meta-search closed"> 224 <div class="container-fluid closed"> 225 <div class="container"> 226 <div class="row"> 227 <div class="col-xs-12 col-md-8 center-col"> 228 <form method="get" action="/Default.aspx"> 229 <fieldset> 230 <div class="input-group input-group-md"> 231 <input type="hidden" name="ID" value='@GetValue("DwAreaSearchPageID")'> 232 <span class="input-group-addon close-search"><i class="fa fa-times"></i></span> 233 <input type="text" class="form-control placeholder" name="q" id="search-field" placeholder='@Translate("searchfor","Søg efter")...' value=""> 234 <span class="input-group-btn"> 235 <input type="submit" class="btn btn-base-color-2" id="search" value='@Translate("SEARCH", "Søg")'> 236 </span> 237 </div> 238 </fieldset> 239 </form> 240 </div> 241 </div> 242 </div> 243 </div> 244 </div> 245 } 246 247 @if (GetString("Item.Area.HeaderContentWidth") != "full") 248 { 249 @:<div class="container main-header-container"> 250 } 251 <div class="row main-header"> 252 <a href="/" class="logo" title='@GetValue("Item.Area.CompanyName")'> 253 @*<img src="/Files/Templates/Designs/Tjlaan_Iris/images/logo.png">*@ 254 <img src='@GetValue("Item.Area.LogoWebsite")' title='@GetValue("Item.Area.CompanyName")' alt='@GetValue("Item.Area.CompanyName")'> 255 </a> 256 257 <div class="top-nav-wrap"> 258 <nav class="top-nav hidden-xs hidden-sm" id="top-nav" role="navigation"> 259 @RenderNavigation(new 260 { 261 StartLevel = 1, 262 EndLevel = 3, 263 ExpandMode = "All", 264 Template = "I_TopNav_Omit_MetaMenu.xslt" 265 }) 266 267 </nav> 268 <div class="search-btn @hasLangs visible-xs-block visible-sm-block"><i></i></div> 269 <a href="#mmenu" class="mobile-nav visible-xs-block visible-sm-block"><i class="fa fa-bars"></i></a> 270 </div> 271 </div> 272 @if (GetString("Item.Area.HeaderContentWidth") != "full") 273 { 274 @:</div> 275 } 276 277 </header> 278 } else { 279 <header class="container-fluid header Fixed"> 280 @if (GetString("Item.Area.HeaderContentWidth") != "full") 281 { 282 @:<div class="container"> 283 } 284 <div class="row main-header"> 285 @*<a href="/" class="logo" title='@GetValue("Item.Area.CompanyName")'><img src="/Files/Templates/Designs/Tjlaan_Iris/images/logo.png"></a>*@ 286 287 <a href="/" class="logo" title='@GetValue("Item.Area.CompanyName")'> 288 <img src='@GetValue("Item.Area.LogoWebsite")' title='@GetValue("Item.Area.CompanyName")' alt='@GetValue("Item.Area.CompanyName")'> 289 </a> 290 291 <div class="top-nav-wrap"> 292 <nav class="top-nav hidden-xs" id="top-nav" role="navigation"> 293 @RenderNavigation(new 294 { 295 StartLevel = 1, 296 EndLevel = 3, 297 ExpandMode = "All", 298 Template = "I_TopNav.xslt" 299 }) 300 </nav> 301 @{ 302 string hasLangs = ""; 303 304 if (GetLoop("Item.Area.AreaLanguages").Any()) { 305 hasLangs = "has-langs"; 306 } 307 } 308 @*<div class="search-btn @hasLangs"><i></i></div>*@ 309 @if (GetLoop("Item.Area.AreaLanguages").Any()) { 310 311 string langLayout = GetString("Item.Area.LanguageLayout"); 312 string langNavClass = ""; 313 if(langLayout == "dropdown" || langLayout == "dropdown-icon-text"){ 314 langNavClass = "language-picker-dropdown"; 315 } else { 316 langNavClass = "language-picker-row"; 317 } 318 <nav class="@langNavClass hidden-xs"> 319 @if(langNavClass == "language-picker-dropdown"){ 320 <ul class="list-unstyled"> 321 <li> 322 <a> 323 @if(GetString("Item.Area.LanguageDropdownIcon") == "globe") 324 { 325 <i class="fa fa-globe"></i> 326 } else { 327 foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 328 { 329 330 if(l.GetBoolean("Item.Area.AreaLanguages.LanguageActive")){ 331 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 332 <img class="active-flag" src="@langIcon"> 333 } 334 } 335 } 336 </a> 337 <ul class="list-unstyled"> 338 @foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 339 { 340 string langActive = l.GetBoolean("Item.Area.AreaLanguages.LanguageActive") == true ? "activeitem" : ""; 341 string langUrl = l.GetString("Item.Area.AreaLanguages.LanguageURL"); 342 string langName = l.GetString("Item.Area.AreaLanguages.LanguageName"); 343 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 344 string langIconPresent = ""; 345 346 if(langLayout == "dropdown-icon-text"){ 347 langIconPresent = "lang-icon"; 348 } 349 <li class="@langActive"> 350 <a href="@langUrl" class="@langActive @langIconPresent" title="@langName">@if(langLayout == "dropdown-icon-text"){<img src="@langIcon">}@langName</a> 351 </li> 352 } 353 </ul> 354 </li> 355 </ul> 356 } else { 357 <ul class="list-unstyled @langNavClass"> 358 @foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 359 { 360 string langActive = l.GetBoolean("Item.Area.AreaLanguages.LanguageActive") == true ? "activeitem" : ""; 361 string langUrl = l.GetString("Item.Area.AreaLanguages.LanguageURL"); 362 string langName = l.GetString("Item.Area.AreaLanguages.LanguageName"); 363 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 364 365 <li class="@langActive"> 366 <a href="@langUrl" class="@langActive" title="@langName"><img src="@langIcon" alt="@langName"></a> 367 </li> 368 369 } 370 </ul> 371 } 372 </nav> 373 } 374 <a href="#top-nav" class="mobile-nav visible-xs-block"><i class="fa fa-bars"></i></a> 375 </div> 376 </div> 377 @if (GetString("Item.Area.HeaderContentWidth") != "full") 378 { 379 @:</div> 380 } 381 @*@if (!string.IsNullOrEmpty(GetString("DwAreaSearchPageID"))) 382 { 383 <div class="search-bar closed"> 384 <div class="container-fluid closed"> 385 <div class="container"> 386 <div class="row"> 387 <div class="col-xs-12 col-md-8 center-col"> 388 <form method="get" action="/Default.aspx"> 389 <fieldset> 390 <div class="input-group"> 391 <input type="hidden" name="ID" value='@GetValue("DwAreaSearchPageID")'> 392 <input type="text" class="form-control placeholder" name="q" id="search-field" placeholder='@Translate("searchfor","Søg efter")...' value=""> 393 <span class="input-group-btn"> 394 <input type="submit" class="btn btn-base-color-2" id="search" value='@Translate("SEARCH", "Søg")'> 395 </span> 396 </div> 397 </fieldset> 398 </form> 399 </div> 400 </div> 401 </div> 402 </div> 403 </div> 404 }*@ 405 </header> 406 } 407 408 @if (GetBoolean("Item.Area.ShowBreadcrumb") == true && GetBoolean("Item.Page.HideBreadcrumb") != true) 409 { 410 411 string isNewspage = ""; 412 if (GetString("Item.ItemInstanceType") == "I_NewsPage") 413 { 414 isNewspage = "is-newspage"; 415 } 416 417 <div class="container-fluid breadcrumb-wrap"> 418 <div class="container"> 419 <div class="row"> 420 <nav class="col-xs-12 breadcrumb @isNewspage"> 421 @if(!string.IsNullOrEmpty(GetString("Item.Area.BreadcrumbPrefix"))){<span class="prefix">@GetString("Item.Area.BreadcrumbPrefix")</span>} 422 @GetValue("DwNavigation(BreadCrumb)") 423 </nav> 424 </div> 425 </div> 426 </div> 427 } 428 429 @if (GetString("Item.ItemInstanceType") == "I_NewsPage") 430 { 431 <div class="container-fluid news-list news-page-header"> 432 <div class="container"> 433 <div class="row"> 434 <div class="col-xs-12"> 435 <p class="date-author"><span><i class="fa fa-calendar" aria-hidden="true"></i>@GetDate("Item.DateTime").ToLongDateString() - kl. @GetDate("Item.DateTime").ToShortTimeString()</span><span><i class="fa fa-user-circle-o" aria-hidden="true"></i>@GetString("Item.Author")</span></p> 436 </div> 437 </div> 438 </div> 439 </div> 440 } 441 <div class="content-width"> 442 443 @using System.Data.SqlClient 444 @using System.Text 445 @functions { 446 public class Ansoegningsblanket { 447 public int id { get; set; } 448 public string navn { get; set; } 449 public string bopael { get; set; } 450 public string postnummer { get; set; } 451 public string by { get; set; } 452 public string telefonnummer { get; set; } 453 public string mobiltelefonnummer { get; set; } 454 public string email { get; set; } 455 public string cprnummer { get; set; } 456 public string fil { get; set; } 457 public string anbefaler { get; set; } 458 public DateTime anbefaler_dato { get; set; } 459 public string kommentar { get; set; } 460 public DateTime _dato { get; set; } 461 public string _ip { get; set; } 462 public string _browser { get; set; } 463 public string _data { get; set; } 464 465 public static Ansoegningsblanket LoadBlanket(int rowId) { 466 return LoadBlanket("2016", rowId); 467 } 468 469 public static Ansoegningsblanket LoadBlanket(string suffix, int rowId) { 470 using (var connection = Dynamicweb.Data.Database.CreateConnection()) { 471 using (var command = connection.CreateCommand()) { 472 command.CommandText = "SELECT * FROM Ansoegningsblanket_" + suffix + " WHERE Ansoegningsblanket_" + suffix + "ID = @id"; 473 474 command.Parameters.Add(new SqlParameter("@id", rowId)); 475 476 using (var reader = command.ExecuteReader()) { 477 if (reader.Read()) { 478 return new Ansoegningsblanket { 479 id = reader.GetInt32(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "ID")), 480 navn = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Navn")), 481 bopael = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Bopael")), 482 postnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Postnummer")), 483 by = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_By")), 484 telefonnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Telefonnummer")), 485 mobiltelefonnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Mobiltelefonnummer")), 486 email = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Email")), 487 cprnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_CPRnummer")), 488 fil = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Fil")), 489 anbefaler = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Anbefaler")), 490 anbefaler_dato = reader.IsDBNull(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Anbefaler_Dato")) ? DateTime.MinValue : reader.GetDateTime(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Anbefaler_Dato")), 491 kommentar = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Kommentar")), 492 _dato = reader.GetDateTime(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__Dato")), 493 _ip = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__IP")), 494 _browser = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__Browser")), 495 _data = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__Data")) 496 }; 497 } 498 } 499 } 500 } 501 502 return null; 503 } 504 505 private static int[] XorKeys { 506 get { 507 return new[] { 210, 184, 99, 118, 57, 160, 85, 172, 21, 155, 114, 183, 208, 102, 176, 49 }; 508 } 509 } 510 511 private static string BytesToHex(byte[] bytes) { 512 var c = new char[bytes.Length * 2]; 513 514 for (var i = 0; i < bytes.Length; i++) { 515 var b = (byte)(bytes[i] >> 4); 516 c[i * 2] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30); 517 b = (byte)(bytes[i] & 0xF); 518 c[i * 2 + 1] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30); 519 } 520 521 return new string(c); 522 } 523 524 private static byte[] HexToBytes(string hex) { 525 var bytes = new byte[hex.Length / 2]; 526 527 for (var i = 0; i < bytes.Length; i++) { 528 var c = hex[i * 2]; 529 bytes[i] = (byte)((c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')) << 4); 530 c = hex[i * 2 + 1]; 531 bytes[i] |= (byte)(c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')); 532 } 533 534 return bytes; 535 } 536 537 public static string XorEncrypt(string value) 538 { 539 var buffer = Encoding.UTF8.GetBytes(value); 540 var hashed = new byte[buffer.Length + 16]; 541 var keys = XorKeys; 542 var salt = (Guid.NewGuid()).ToByteArray(); 543 var j = 0; 544 545 for (var i = 0; i < 8; i++) { 546 hashed[i] = (byte)(salt[i] ^ (uint)keys[i]); 547 hashed[i + 8 + buffer.Length] = (byte)(salt[i + 8] ^ (uint)keys[i + 8]); 548 } 549 550 for (var i = 0; i < buffer.Length; i++) { 551 if (j >= 16) 552 j = 0; 553 hashed[i + 8] = (byte)((buffer[i] ^ (uint)salt[j]) ^ 135u); 554 j++; 555 } 556 557 return BytesToHex(hashed); 558 } 559 560 public static string XorDecrypt(string value) { 561 var hashed = HexToBytes(value); 562 var buffer = new byte[hashed.Length - 16]; 563 var keys = XorKeys; 564 var salt = new byte[16]; 565 var j = 0; 566 567 for (var i = 0; i < 8; i++) { 568 salt[i] = (byte)(hashed[i] ^ (uint)keys[i]); 569 salt[i + 8] = (byte)(hashed[i + 8 + buffer.Length] ^ (uint)keys[i + 8]); 570 } 571 572 for (var i = 0; i < buffer.Length; i++) { 573 if (j >= 16) 574 j = 0; 575 buffer[i] = (byte)((hashed[i + 8] ^ 135u) ^ salt[j]); 576 j++; 577 } 578 579 return Encoding.UTF8.GetString(buffer); 580 } 581 } 582 } 583 @SnippetStart("StyleSheet") 584 @SnippetEnd("StyleSheet") 585 @SnippetStart("sidenavheader") 586 @SnippetEnd("sidenavheader") 587 @SnippetStart("sidetags") 588 @SnippetEnd("sidetags") 589 @{ 590 var rowId = Ansoegningsblanket.XorDecrypt(HttpContext.Current.Request.QueryString["rId"]).Split(':')[1]; 591 var blanket = string.IsNullOrWhiteSpace(rowId) ? null : Ansoegningsblanket.LoadBlanket("2016", int.Parse(rowId)); 592 } 593 594 @GetValue("DwContent(content)") 595 @GetValue("DwContent(menuwrap)") 596 597 598 599 @if(blanket != null) { 600 601 var datajson = Newtonsoft.Json.Linq.JObject.Parse(blanket._data); 602 var data_GenerateSend = (string)datajson["_Data_GenerateSend"]["value"]; 603 var cryptId = Ansoegningsblanket.XorEncrypt(DateTime.Now.Ticks + ":" + blanket.id); 604 605 <style type="text/css"> 606 #centerColumn { 607 min-height: auto; 608 } 609 </style> 610 611 if(data_GenerateSend == "PDF") { 612 <div class="container" style="padding-top: 45px;"> 613 <div class="row"> 614 <div class="col-xs-12"> 615 <div class="row "> 616 <div class="col-xs-8 themed-text text-xs-left"> 617 <h1>Du har valgt at sende fysisk</h1> 618 <p>Tak for udfyldelse af lånansøgningen. Du kan ved klik på nedenstående link, printe eller gemme din låneansøgning. Låneansøgningen sender du efterfølgende pr. brev eller via en e-mail til din kontaktperson.</p> 619 <a href="/Admin/Public/Ansoegningsblanket_2016HandlerV2.ashx?methodName=GetPDF&amp;id=@(cryptId)" class="btn btn-default" role="button" target="_blank">Print/Gem ansøgning</a> 620 </div> 621 </div> 622 </div> 623 </div> 624 </div> 625 626 } else { 627 628 <div class="container" style="padding-top: 45px;"> 629 <div class="row"> 630 <div class="col-xs-12"> 631 <div class="row "> 632 <div class="col-xs-8 themed-text text-xs-left"> 633 <h1>Tak for din ansøgning, som du nu har sendt til din faglige organisation.</h1> 634 <p>Når vi modtager ansøgningen fra din organisation, behandler vi ansøgningen og sender afgørelsen til din mail.</p> 635 <p>Er lånet bevilget sender vi samtidig lånedokumenterne via E-Signatur til din mail og de skal underskrives med din NemID. 636 <br> 637 Såfremt du ikke har NemID kan dokumenterne fremsendes med post. Du skal så kontakte låneforeningens kontor.</p> 638 <p>Lånet kan først udbetales til din NemKonto når vi efterfølgende har fået noteret lånet på dit lønkontor.</p> 639 </div> 640 </div> 641 </div> 642 </div> 643 </div> 644 645 } 646 } 647 648 649 650 @GetValue("DwContent(dwcontent)") 651 </div> 652 <footer class="footer container-fluid"> 653 <div class="container"> 654 @*<div class="row footer-top"> 655 656 <div class="col-margin-bottom text-xs-center col-xs-2 footer-logo"> 657 <a href="/" class="logo" title='@GetValue("Item.Area.CompanyName")'> 658 <img src='@GetValue("Item.Area.LogoWebsite")' title='@GetValue("Item.Area.CompanyName")' alt='@GetValue("Item.Area.CompanyName")' class="img-responsive"> 659 </a> 660 </div> 661 662 <div class="col-margin-bottom text-xs-center col-xs-10"> 663 <div class="row"> 664 @using System.Linq; 665 666 @{ 667 var footercolumns = GetLoop("Item.Area.FooterColumns").OrderBy(g => g.GetString("Item.Area.FooterColumns.Sort")).ToList(); 668 669 foreach (LoopItem i in footercolumns) 670 { 671 <div class='col-margin-bottom text-xs-center @ColumnClassFooter(@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthMobile")+" ",@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthTabletPortrait")+" ",@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthTabletLandscape")+" ",@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthDesktop")+" ")'> 672 @i.GetString("Item.Area.FooterColumns.Text") 673 674 @{ 675 var socialmedia = i.GetLoop("Item.Area.FooterColumns.SocialeMedier").OrderBy(d => d.GetString("Item.Area.FooterColumns.SocialeMedier.Sort")).ToList(); 676 677 foreach (LoopItem s in socialmedia) { 678 <a href='@s.GetString("Item.Area.FooterColumns.SocialeMedier.MediaURL")' class='social-media-circle' title='@s.GetString("Item.Area.FooterColumns.SocialeMedier.Name")' target='_blank'> 679 <i class='fa @s.GetString("Item.Area.FooterColumns.SocialeMedier.FontAwesomeClass")'></i> 680 </a> 681 } 682 } 683 684 </div> 685 686 } 687 } 688 689 @functions { 690 public string ColumnClassFooter(string mobile,string portrait,string landscape,string desktop) 691 { 692 if (string.IsNullOrWhiteSpace(mobile)) { 693 mobile = "col-xs-12 "; 694 } 695 696 if (string.IsNullOrWhiteSpace(portrait)) { 697 portrait = ""; 698 } 699 700 if (string.IsNullOrWhiteSpace(landscape)) { 701 landscape = ""; 702 } 703 704 return mobile + portrait + landscape + desktop; 705 } 706 } 707 </div> 708 </div> 709 710 </div>*@ 711 712 <div class="row footer-top"> 713 714 <div class="col-margin-bottom text-xs-center col-xs-12 footer-logo"> 715 <a href="/" class="logo" title='@GetValue("Item.Area.CompanyName")'> 716 <img src='@GetValue("Item.Area.FooterLogoWebsite")' title='@GetValue("Item.Area.CompanyName")' alt='@GetValue("Item.Area.CompanyName")' class="img-responsive"> 717 </a> 718 </div> 719 720 <div class="col-margin-bottom text-xs-center col-xs-12"> 721 <div class="row"> 722 @using System.Linq; 723 724 @{ 725 var footercolumns = GetLoop("Item.Area.FooterColumns").OrderBy(g => g.GetString("Item.Area.FooterColumns.Sort")).ToList(); 726 727 foreach (LoopItem i in footercolumns) 728 { 729 <div class='col-margin-bottom text-xs-center @ColumnClassFooter(@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthMobile")+" ",@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthTabletPortrait")+" ",@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthTabletLandscape")+" ",@i.GetString("Item.Area.FooterColumns.WidthSettings.WidthDesktop")+" ")'> 730 @i.GetString("Item.Area.FooterColumns.Text") 731 732 @{ 733 var socialmedia = i.GetLoop("Item.Area.FooterColumns.SocialeMedier").OrderBy(d => d.GetString("Item.Area.FooterColumns.SocialeMedier.Sort")).ToList(); 734 735 foreach (LoopItem s in socialmedia) { 736 <a href='@s.GetString("Item.Area.FooterColumns.SocialeMedier.MediaURL")' class='social-media-circle' title='@s.GetString("Item.Area.FooterColumns.SocialeMedier.Name")' target='_blank'> 737 <i class='fa @s.GetString("Item.Area.FooterColumns.SocialeMedier.FontAwesomeClass")'></i> 738 </a> 739 } 740 } 741 742 </div> 743 744 } 745 } 746 747 @functions { 748 public string ColumnClassFooter(string mobile,string portrait,string landscape,string desktop) 749 { 750 if (string.IsNullOrWhiteSpace(mobile)) { 751 mobile = "col-xs-12 "; 752 } 753 754 if (string.IsNullOrWhiteSpace(portrait)) { 755 portrait = ""; 756 } 757 758 if (string.IsNullOrWhiteSpace(landscape)) { 759 landscape = ""; 760 } 761 762 return mobile + portrait + landscape + desktop; 763 } 764 } 765 </div> 766 </div> 767 768 </div> 769 770 @if(!String.IsNullOrWhiteSpace(GetString("Item.Area.FooterCopyright"))){ 771 772 <div class="row footer-bottom"> 773 <div class="col-xs-12 text-center"> 774 <small> 775 © Copyright @GetGlobalValue("Global:Server.Date.Year") @GetString("Item.Area.FooterCopyright") 776 @if(!String.IsNullOrWhiteSpace(GetString("Item.Area.FooterWebsiteBy"))){ 777 <span>|</span> @GetString("Item.Area.FooterWebsiteBy") 778 } 779 </small> 780 781 </div> 782 </div> 783 } 784 785 </div> 786 </footer> 787 @* remove commenting if the "MetaMenu" is in use on this site *@ 788 789 <nav id="mmenu"> 790 @GetValue("DwNavigation(menupanel)") 791 @if (GetLoop("Item.Area.AreaLanguages").Any()) { 792 string langLayout = GetString("Item.Area.LanguageLayout"); 793 string langNavClass = "language-picker-dropdown"; 794 <ul id="languages-panel"> 795 @foreach (LoopItem l in GetLoop("Item.Area.AreaLanguages")) 796 { 797 string langActive = l.GetBoolean("Item.Area.AreaLanguages.LanguageActive") == true ? "active-language" : ""; 798 string langUrl = l.GetString("Item.Area.AreaLanguages.LanguageURL"); 799 string langName = l.GetString("Item.Area.AreaLanguages.LanguageName"); 800 string langIcon = l.GetString("Item.Area.AreaLanguages.LanguageIcon"); 801 string langIconPresent = ""; 802 803 if(langLayout == "dropdown-icon-text" || langLayout == "icon-row"){ 804 langIconPresent = "lang-icon"; 805 } 806 <li class="@langActive"> 807 <a href="@langUrl" class="@langActive @langIconPresent" title="@langName">@if(langLayout == "dropdown-icon-text" || langLayout == "icon-row"){<img src="@langIcon">}@langName</a> 808 </li> 809 } 810 </ul> 811 } 812 </nav> 813 814 @SnippetStart("sidenav") 815 <nav class="side-sub-nav"> 816 @GetValue("DwNavigation(SideNav)") 817 </nav> 818 @SnippetEnd("sidenav") 819 </div> 820 821 822 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- COOKIE -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 823 824 825 @{ 826 //var categories = Dynamicweb.Environment.CookieManager.GetCategories(); 827 string cookieChoiceId = "cookie-choice-renew"; 828 string cookieWarningClass = "custom-cookie"; 829 if (Dynamicweb.Environment.CookieManager.CookieOptInLevelExists) 830 { 831 cookieWarningClass += " \" style=\"display:none\" tab-index=\"-1\" aria-hidden=\"true\""; 832 } 833 else 834 { 835 cookieChoiceId += "\" style=\"display:none;"; 836 } 837 var cookieSettingsPage = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "cookiesettings"); 838 bool cookieActivated = cookieSettingsPage != null && cookieSettingsPage.Item["CookieActivated"] != null ? (bool)cookieSettingsPage.Item["CookieActivated"] : false; 839 } 840 841 @if (cookieActivated && cookieSettingsPage != null && cookieSettingsPage.Item["CookieCategories"] != null) 842 { 843 var cookieCategoryItems = Dynamicweb.Content.Items.ItemList.GetItemListById((int)cookieSettingsPage.Item["CookieCategories"]).Relations; 844 if (cookieCategoryItems.Any()) 845 { 846 <div id="@cookieChoiceId" title="Cookie valg" aria-label="renew-consent" style="height:35px;width:35px;z-index:500;"> 847 <svg class="svg-inline--fa fa-cookie-bite fa-w-16" aria-hidden="true" focusable="false" data-prefix="fal" data-icon="cookie-bite" role="img" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M352 328c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24zM184 192c0-13.26-10.75-24-24-24s-24 10.74-24 24c0 13.25 10.75 24 24 24s24-10.75 24-24zm8 136c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24zm96-96c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24zm222.52 23.82c-69.97-.85-126.47-57.69-126.47-127.86-70.17 0-127-56.49-127.86-126.45C249.57.5 242.9 0 236.26 0c-20.68 0-41.18 4.85-59.79 14.33l-69.13 35.22a132.221 132.221 0 0 0-57.79 57.81l-35.1 68.88a132.645 132.645 0 0 0-12.82 80.95l12.08 76.28a132.555 132.555 0 0 0 37.16 72.96l54.77 54.76a132.036 132.036 0 0 0 72.71 37.06l76.71 12.14c6.86 1.09 13.76 1.62 20.64 1.62 20.72 0 41.25-4.88 59.89-14.38l69.13-35.22a132.221 132.221 0 0 0 57.79-57.81l35.1-68.88c12.56-24.63 17.01-52.57 12.91-79.9zm-41.42 65.36L434 390.07c-9.68 19-24.83 34.15-43.81 43.82l-69.13 35.22C307.08 476.23 291.39 480 275.7 480c-5.21 0-10.47-.41-15.63-1.23l-76.7-12.14c-21-3.33-40.05-13.04-55.09-28.08l-54.77-54.76c-15.1-15.09-24.84-34.23-28.18-55.33l-12.08-76.27c-3.35-21.12.02-42.36 9.72-61.41l35.1-68.88c9.68-19 24.83-34.15 43.81-43.82L191 42.85c11.33-5.77 23.8-9.33 36.51-10.46 13.15 63.15 63.84 112.95 127.25 124.86 11.91 63.42 61.71 114.11 124.87 127.25-1.1 12.73-4.64 25.14-10.53 36.68z"></path></svg> 848 </div> 849 <div id="cookieWarningContainer" class="@cookieWarningClass"> 850 <form id="cookieWarningForm" method="post" action="/Admin/Public/CookieOptInLevelConfig.aspx"> 851 <input type="hidden" name="cmd" value="SetCookieOptInLevel"> 852 <input type="hidden" name="OptInLevel" id="OptInLevel" value="1"> 853 854 <fieldset> 855 <div class="p-4"> 856 <div class="row"> 857 <div class="col-xs-12"> 858 <h2>@cookieSettingsPage.Item["CookieHeader"]</h2> 859 @cookieSettingsPage.Item["CookieIntro"] 860 <hr class="mt-4 mb-4 w-100"> 861 <p class="text-center"> 862 <button type="button" class="btn btn-base-color-2 ml-3" onclick="setOptInCookie(1);">@Translate("Tillad valgte")</button> 863 <button type="button" class="btn btn-base-color-3 ml-3" onclick="setOptInCookie(2);">@Translate("Tillad alle")</button> 864 </p> 865 866 </div> 867 </div> 868 </div> 869 @{ 870 string showDetails = Translate("Vis detaljer"); 871 string hideDetails = Translate("Skjul detaljer"); 872 <div class="p-4"> 873 <div class="grid"> 874 @foreach (Dynamicweb.Content.Items.Item category in cookieCategoryItems) 875 { 876 string categoryName = "" + category["Name"]; 877 string categorySysName = "" + category["SysName"]; 878 string categoryID = "cookecategory-" + category.Id; 879 string categoryDescription = "" + category["Description"]; 880 var cookies = Dynamicweb.Content.Items.ItemList.GetItemListById((int)category["Cookies"]).Relations; 881 882 if (cookies.Any()) 883 { 884 <div class="col-xs-4"> 885 <div class="custom-control custom-checkbox text-center" data-nogutter="1"> 886 <span class="d-block">@categoryName</span> 887 @if (categorySysName == "Essential") 888 { 889 <input type="checkbox" class="custom-control-input" id="chk-cookie-@categorySysName" value="@categorySysName" checked="checked" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled" disabled="disabled"> 890 } 891 else 892 { 893 if (AllowedCookieCategories.Contains(categorySysName)) 894 { 895 <input type="checkbox" class="custom-control-input" checked="checked" id="chk-cookie-@categorySysName" name="OptInCategory" value="@categorySysName"> 896 } 897 else 898 { 899 <input type="checkbox" class="custom-control-input" id="chk-cookie-@categorySysName" name="OptInCategory" value="@categorySysName"> 900 } 901 } 902 <label class="custom-control-label" for="chk-cookie-@categorySysName"></label> 903 </div> 904 </div> 905 } 906 } 907 908 </div> 909 <div class="row"> 910 <div class="col-xs-12"> 911 <hr class="mt-4 mb-4 w-100"> 912 <p class="text-center"> 913 <button class="btn btn-primary-naked collapsed" id="cookie-details-button" data-toggle="collapse" role="button" aria-expanded="false" data-open-text="@showDetails" data-close-text="@hideDetails" aria-controls="collapse-cookie-info-container"> 914 @showDetails 915 </button> 916 </p> 917 </div> 918 </div> 919 </div> 920 <div class="collapse" id="collapse-cookie-info-container"> 921 <div class="cookie-info-container"> 922 <div class="mb-4"> 923 @foreach (Dynamicweb.Content.Items.Item category in cookieCategoryItems) 924 { 925 string categoryName = "" + category["Name"]; 926 string categorySysName = "" + category["SysName"]; 927 string categoryID = "cookecategory-" + category.Id; 928 string categoryDescription = "" + category["Description"]; 929 var cookies = Dynamicweb.Content.Items.ItemList.GetItemListById((int)category["Cookies"]).Relations; 930 if (cookies.Any()) 931 { 932 <div class="d-block toogle-f-content" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="collapse-cookie-info-@categoryID"> 933 <div class="row"> 934 <div class="col-xs-12 col-sm-3 cookie-info-container-title"> 935 @*<span class="arrow-animate-down"><span class="icon-bar"></span><span class="icon-bar"></span></span>*@ 936 <i class="fa fa-angle-right" aria-hidden="true"></i> 937 938 <strong>@categoryName</strong> 939 940 </div> 941 <div class="col-xs-12 col-sm-9"> 942 @categoryDescription 943 </div> 944 </div> 945 </div> 946 <div class="collapse" id="collapse-cookie-info-@categoryID"> 947 @foreach (Dynamicweb.Content.Items.Item cookie in cookies) 948 { 949 string titleClass = "col-xs-12 col-sm-3"; 950 string contentClass = "col-xs-12 col-sm-9"; 951 952 <div class="grid p-1"> 953 <div class="row collapse-cookie-info-header"> 954 <div class="@titleClass"> 955 <strong> 956 @Translate("Databehandler") 957 </strong> 958 </div> 959 <div class="@contentClass"> 960 <p>@cookie["DataProcessor"]</p> 961 </div> 962 </div> 963 <div class="row"> 964 <div class="@titleClass"> 965 <strong> 966 @Translate("Formål") 967 </strong> 968 </div> 969 <div class="@contentClass"> 970 @cookie["Purpose"] 971 </div> 972 <div class="@titleClass"> 973 <strong> 974 @Translate("Privatlivspolitik:") 975 </strong> 976 </div> 977 <div class="@contentClass"> 978 <p><a target="_blank" href="@cookie[" privacypolicy"]"="">@cookie["PrivacyPolicy"]</a></p> 979 </div> 980 <div class="@titleClass"> 981 <strong> 982 @Translate("Udløb") 983 </strong> 984 </div> 985 <div class="@contentClass"> 986 <p>@cookie["Expires"]</p> 987 </div> 988 <div class="@titleClass"> 989 <strong> 990 @Translate("Navn") 991 </strong> 992 </div> 993 <div class="@contentClass"> 994 <p>@cookie["Name"]</p> 995 </div> 996 <div class="@titleClass"> 997 <strong> 998 @Translate("Udbyder") 999 </strong> 1000 </div> 1001 <div class="@contentClass"> 1002 <p>@cookie["Provider"]</p> 1003 </div> 1004 </div> 1005 </div> 1006 } 1007 </div> 1008 } 1009 } 1010 </div> 1011 </div> 1012 </div> 1013 1014 } 1015 </fieldset> 1016 </form> 1017 1018 <script> 1019 document.getElementById("cookie-choice-renew").onclick = function () { 1020 showCookieChoice(); 1021 }; 1022 document.getElementById("cookie-details-button").onclick = function () { 1023 1024 if (this.classList.contains("opened")) { 1025 this.text = this.getAttribute("data-open-text"); 1026 this.classList.remove("opened"); 1027 document.getElementById("collapse-cookie-info-container").classList.remove("show"); 1028 } else { 1029 this.text = this.getAttribute("data-close-text"); 1030 this.classList.add("opened"); 1031 1032 document.getElementById("collapse-cookie-info-container").classList.add("show"); 1033 } 1034 }; 1035 var cookieExtraInfoElements = document.getElementsByClassName("toogle-f-content"); 1036 for (var i = 0; i < cookieExtraInfoElements.length; i++) { 1037 1038 cookieExtraInfoElements[i].onclick = function () { 1039 var elementToToggle = this.getAttribute("aria-controls"); 1040 if (this.classList.contains("opened")) { 1041 this.classList.remove("opened"); 1042 document.getElementById(elementToToggle).classList.remove("show"); 1043 } else { 1044 this.classList.add("opened"); 1045 document.getElementById(elementToToggle).classList.add("show"); 1046 } 1047 } 1048 } 1049 1050 1051 function setOptInCookie(optInLevel) { 1052 document.getElementById("OptInLevel").value = optInLevel; 1053 var formElement = document.getElementById("cookieWarningForm"); 1054 if (optInLevel == 1) { 1055 var essentialElement = document.createElement('input'); 1056 if (document.getElementById('cookie-essential') === null) { 1057 essentialElement.setAttribute("name", "OptInCategory"); 1058 essentialElement.setAttribute("value", "Essential"); 1059 essentialElement.setAttribute("type", "hidden"); 1060 essentialElement.setAttribute("id", "cookie-essential"); 1061 formElement.appendChild(essentialElement); 1062 } 1063 1064 if (document.getElementById("chk-cookie-Marketing") != null && document.getElementById("chk-cookie-Marketing").checked && typeof fbq !== 'undefined') { 1065 fbq('consent', 'grant'); 1066 } 1067 } 1068 if (optInLevel == 2) { 1069 if (document.getElementById("chk-cookie-Statistical") != null) { 1070 document.getElementById("chk-cookie-Statistical").checked = true; 1071 } 1072 if (document.getElementById("chk-cookie-Marketing") != null) { 1073 document.getElementById("chk-cookie-Marketing").checked = true; 1074 } 1075 1076 if (typeof fbq !== 'undefined') { 1077 fbq('consent', 'grant'); 1078 } 1079 1080 } 1081 var formData = new FormData(formElement); 1082 1083 var xmlhttp = new XMLHttpRequest(); 1084 xmlhttp.onreadystatechange = function () { 1085 if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 1086 hideCookieChoice(); 1087 return false; 1088 } 1089 } 1090 1091 xmlhttp.open(formElement.method, formElement.action); 1092 xmlhttp.send(formData); 1093 1094 return false; 1095 } 1096 function showCookieChoice() { 1097 1098 var cookieWarningContainer = document.getElementById("cookieWarningContainer"); 1099 cookieWarningContainer.style.display = "flex"; 1100 cookieWarningContainer.removeAttribute("tab-index"); 1101 cookieWarningContainer.removeAttribute("aria-hidden"); 1102 if (document.getElementById("cookie-choice-renew") != null) { 1103 document.getElementById("cookie-choice-renew").style.display = "none"; 1104 } 1105 1106 } 1107 function hideCookieChoice() { 1108 1109 var cookieWarningContainer = document.getElementById("cookieWarningContainer"); 1110 cookieWarningContainer.style.display = "none"; 1111 cookieWarningContainer.setAttribute("tab-index", "-1"); 1112 cookieWarningContainer.setAttribute("aria-hidden", "true"); 1113 1114 if (document.getElementById("cookie-choice-renew") != null) { 1115 document.getElementById("cookie-choice-renew").style.display = "block"; 1116 } 1117 1118 } 1119 </script> 1120 </div> 1121 } 1122 1123 } 1124 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 1125 1126 1127 <script type="text/javascript"> 1128 var isTablet = '@GetGlobalValue("Global:Device.IsTablet")'; 1129 var cookieText = "@cookieText"; 1130 var mmenuMenu = '@Translate("Menu","Menu")'; 1131 var mmenuLanguages = '@Translate("Languages","Sprog")'; 1132 var levelTwoPageID = '@GetValue("DwPageID_2")'; 1133 var itemInstanceType = '@GetValue("Item.ItemInstanceType")'; 1134 </script> 1135 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 1136 @GetValue("Item.Area.Webfonts") 1137 <script type="text/javascript" src="/Files/Templates/Designs/Tjlaan_Iris/javascript/compressed/i_compressed.js?v=@thejsstamp"></script> 1138 @GetValue("DwCookieWarning") 1139 @GetValue("Item.Area.ScriptsBodyEnd") 1140 @RenderSnippet("Scripts") 1141 @RenderSnippet("FormScripts") 1142 @RenderSnippet("FormScripts2") 1143 @RenderSnippet("FormScripts3") 1144 1145 </body> 1146 </html> 1147