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