web/polemicaltimeline.php
changeset 1480 d2d28468b410
parent 1443 66ca0c90c47c
child 1514 5869151a1f2f
equal deleted inserted replaced
1479:2b510a3a0f7d 1480:d2d28468b410
    49 
    49 
    50 if ($show_splash) {
    50 if ($show_splash) {
    51     array_push($_SESSION['answered_events'], $rep);
    51     array_push($_SESSION['answered_events'], $rep);
    52 }
    52 }
    53 
    53 
    54 //$annotation_protocol_version = isset($config['annotation_protocol_version'])?$config['annotation_protocol_version']:"1";
    54 $annotation_protocol_version = isset($config['annotation_protocol_version'])?$config['annotation_protocol_version']:"1";
    55 $annotations = get_default_annotations_config($config, $translate);
    55 $annotations = get_default_annotations_config($config, $translate);
    56 
    56 
    57 ?>
    57 ?>
    58 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    58 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    59 <html lang="<?php echo($actual); ?>">
    59 <html lang="<?php echo($actual); ?>">
   147             },
   147             },
   148 <?php if ($protocol_level > 1): ?>
   148 <?php if ($protocol_level > 1): ?>
   149             {
   149             {
   150                 type: "Polemic",
   150                 type: "Polemic",
   151                 max_elements: 60,
   151                 max_elements: 60,
   152 <?php if ($protocol_level < 4): ?>
   152                 default_version: "1",
   153                 polemics: []
   153 <?php if (isset($annotations)): ?>
   154 <?php elseif (isset($annotations)): ?>
   154                 polemics : { "<?php echo($annotation_protocol_version)?>":[
   155                 polemics : [
       
   156 <?php foreach ($annotations as $annot_key => $annot_def): ?>
   155 <?php foreach ($annotations as $annot_key => $annot_def): ?>
   157     <?php 
   156     <?php 
   158     $hVal = (isset($annot_def['colors'])&&isset($annot_def['colors']['h']))?floatval($annot_def['colors']['h']):0.17;
   157     $hVal = (isset($annot_def['colors'])&&isset($annot_def['colors']['h']))?floatval($annot_def['colors']['h']):0.17;
   159     $hVal = ($hVal<1)?floor($hVal*360.0):$hVal;
   158     $hVal = ($hVal<1)?floor($hVal*360.0):$hVal;
   160     $sVal = (isset($annot_def['colors'])&&isset($annot_def['colors']['s']))?floatval($annot_def['colors']['s']):1.0;
   159     $sVal = (isset($annot_def['colors'])&&isset($annot_def['colors']['s']))?floatval($annot_def['colors']['s']):1.0;
   166                         "name" : "<?php echo $annot_def['polemic_cat']; ?>",
   165                         "name" : "<?php echo $annot_def['polemic_cat']; ?>",
   167                         "keywords" : <?php echo json_encode($annot_def['polemic_keywords']); ?>,
   166                         "keywords" : <?php echo json_encode($annot_def['polemic_keywords']); ?>,
   168                         "color" : "<?php echo $polemicColor; ?>"
   167                         "color" : "<?php echo $polemicColor; ?>"
   169                     },
   168                     },
   170 <?php endforeach; ?>
   169 <?php endforeach; ?>
   171                 ]
   170                 ]}
   172 <?php endif; ?>
   171 <?php endif; ?>
   173             },
   172             },
   174 <?php endif; ?>
   173 <?php endif; ?>
   175 <?php if ($protocol_level > 1 || isset($annotations)): ?>
   174 <?php if ($protocol_level > 1 || isset($annotations)): ?>
   176             {
   175             {