web/polemicaltimeline.php
changeset 1480 d2d28468b410
parent 1443 66ca0c90c47c
child 1514 5869151a1f2f
--- a/web/polemicaltimeline.php	Sun Sep 23 17:14:07 2018 +0200
+++ b/web/polemicaltimeline.php	Mon Oct 22 17:04:30 2018 +0200
@@ -51,7 +51,7 @@
     array_push($_SESSION['answered_events'], $rep);
 }
 
-//$annotation_protocol_version = isset($config['annotation_protocol_version'])?$config['annotation_protocol_version']:"1";
+$annotation_protocol_version = isset($config['annotation_protocol_version'])?$config['annotation_protocol_version']:"1";
 $annotations = get_default_annotations_config($config, $translate);
 
 ?>
@@ -149,10 +149,9 @@
             {
                 type: "Polemic",
                 max_elements: 60,
-<?php if ($protocol_level < 4): ?>
-                polemics: []
-<?php elseif (isset($annotations)): ?>
-                polemics : [
+                default_version: "1",
+<?php if (isset($annotations)): ?>
+                polemics : { "<?php echo($annotation_protocol_version)?>":[
 <?php foreach ($annotations as $annot_key => $annot_def): ?>
     <?php 
     $hVal = (isset($annot_def['colors'])&&isset($annot_def['colors']['h']))?floatval($annot_def['colors']['h']):0.17;
@@ -168,7 +167,7 @@
                         "color" : "<?php echo $polemicColor; ?>"
                     },
 <?php endforeach; ?>
-                ]
+                ]}
 <?php endif; ?>
             },
 <?php endif; ?>