38
38
using Satrabel . OpenContent . Components . Datasource ;
39
39
using IDataSource = Satrabel . OpenContent . Components . Datasource . IDataSource ;
40
40
using SecurityAccessLevel = DotNetNuke . Security . SecurityAccessLevel ;
41
+ using Newtonsoft . Json . Serialization ;
42
+ using System . Reflection ;
41
43
42
44
#endregion
43
45
@@ -168,10 +170,13 @@ protected override void OnPreRender(EventArgs e)
168
170
if ( LogContext . IsLogActive && ! Debugger . IsAttached )
169
171
{
170
172
ClientResourceManager . RegisterScript ( Page , Page . ResolveUrl ( "~/DesktopModules/OpenContent/js/opencontent.js" ) , FileOrder . Js . DefaultPriority ) ;
173
+ var json = JsonConvert . SerializeObject ( LogContext . Current . ModuleLogs ( ModuleContext . ModuleId ) ) ;
174
+ json = json . Replace ( "<script>" , "*script*" ) ;
175
+ json = json . Replace ( "</script>" , "*/script*" ) ;
171
176
StringBuilder logScript = new StringBuilder ( ) ;
172
177
//logScript.AppendLine("<script type=\"text/javascript\"> ");
173
178
logScript . AppendLine ( "$(document).ready(function () { " ) ;
174
- logScript . AppendLine ( "var logs = " + System . Web . HttpUtility . HtmlEncode ( JsonConvert . SerializeObject ( LogContext . Current . ModuleLogs ( ModuleContext . ModuleId ) ) ) + "; " ) ;
179
+ logScript . AppendLine ( "var logs = " + json + "; " ) ;
175
180
logScript . AppendLine ( "$.fn.openContent.printLogs(\" Module " + ModuleContext . ModuleId + " - " + ModuleContext . Configuration . ModuleTitle + "\" , logs);" ) ;
176
181
logScript . AppendLine ( "});" ) ;
177
182
//logScript.AppendLine("</script>");
@@ -472,4 +477,6 @@ private void RenderHttpException(NotAuthorizedException ex)
472
477
#endregion
473
478
}
474
479
480
+
481
+
475
482
}
0 commit comments