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