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 < 3): ?> |
152 <?php if ($protocol_level < 4): ?> |
153 polemics: [] |
153 polemics: [] |
154 <?php elseif (isset($annotations)): ?> |
154 <?php elseif (isset($annotations)): ?> |
155 polemics : [ |
155 polemics : [ |
156 <?php foreach ($annotations as $annot_key => $annot_def): ?> |
156 <?php foreach ($annotations as $annot_key => $annot_def): ?> |
157 <?php if($annot_key == 'default') { continue; } ?> |
157 <?php |
|
158 $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; |
|
160 $sVal = (isset($annot_def['colors'])&&isset($annot_def['colors']['s']))?floatval($annot_def['colors']['s']):1.0; |
|
161 |
|
162 $polemicColor = isset($annot_def['polemic_color'])?$annot_def['polemic_color']:rgb2hex(hsl2Rgb($hVal, $sVal, 0.5)); |
|
163 |
|
164 if($annot_key == 'default') { continue; } ?> |
158 { |
165 { |
159 "name" : "<?php echo $annot_def['polemic_cat']; ?>", |
166 "name" : "<?php echo $annot_def['polemic_cat']; ?>", |
160 "keywords" : <?php echo json_encode($annot_def['polemic_keywords']); ?>, |
167 "keywords" : <?php echo json_encode($annot_def['polemic_keywords']); ?>, |
161 "color" : "<?php echo $annot_def['polemic_color'];?>" |
168 "color" : "<?php echo $polemicColor; ?>" |
162 }, |
169 }, |
163 <?php endforeach; ?> |
170 <?php endforeach; ?> |
164 ] |
171 ] |
165 <?php endif; ?> |
172 <?php endif; ?> |
166 }, |
173 }, |
167 <?php endif; ?> |
174 <?php endif; ?> |
168 <?php if ($protocol_level > 1): ?> |
175 <?php if ($protocol_level > 1 || isset($annotations)): ?> |
169 { |
176 { |
170 type: "MultiSegments", |
177 type: "MultiSegments", |
171 //annotation_type: "chap" |
178 //annotation_type: "chap" |
172 }, |
179 }, |
173 { |
180 { |