Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/techsneeze/dmarcts-report-viewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjnew-gh <github@hazelden.ca>2021-05-04 03:25:41 +0300
committerjnew-gh <github@hazelden.ca>2021-05-04 03:25:41 +0300
commit33e2027b0e90cbe880de419393b40cbe61b891d1 (patch)
tree5fc1dd81f0df836ffe2018f0b412254a65ecc863
parent9255261c31c1c02cab27175fc6fcf46a584b3009 (diff)
Add xml highlighting
If xml highlight option is chosen, add the highlight.js Javascript and style sheets. Add the xml highlight Javascript variables to the page.
-rw-r--r--dmarcts-report-viewer.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/dmarcts-report-viewer.php b/dmarcts-report-viewer.php
index 2f7c6da..2599b0f 100644
--- a/dmarcts-report-viewer.php
+++ b/dmarcts-report-viewer.php
@@ -47,10 +47,18 @@ function html ($domains = array(), $orgs = array(), $periods = array() ) {
$html[] = " <title>DMARC Report Viewer</title>";
$html[] = " <link rel='stylesheet' href='" . $cookie_options['cssfile'] . "'>";
$html[] = " <script src='dmarcts-report-viewer.js'></script>";
+
+ if ( $cookie_options['xml_data_hljs'] ) {
+ $html[] = " <link rel='stylesheet' href='highlight.js/styles/" . $cookie_options['cssfile'] . "'>";
+ $html[] = " <script src='highlight.js/highlight.pack.js'></script>";
+ }
+
$html[] = " <script>";
$html[] = " var report_list_height_percent = " . $cookie_options["report_list_height_percent"] . ";";
$html[] = " var report_data_xml_width_percent = " . $cookie_options["report_data_xml_width_percent"] . ";";
$html[] = " var xml_data_open = " . $cookie_options['xml_data_open'] . ";";
+ $html[] = " var xml_data_highlight = " . $cookie_options['xml_data_highlight'] . ";";
+ $html[] = " var xml_data_hljs = " . $cookie_options['xml_data_hljs'] . ";";
$html[] = " </script>";
$html[] = " <meta charset=\"UTF-8\" />";
$html[] = " <meta name='google' content='notranslate' />";