if (in_array($b['id'],$billets_id)) { $odd+=1; echo '<tr valign=top'.$addtr.'>'; echo '<td><a name=\'b'.$b['index'].'\'></a><b>'.$b['index'].'</b></td>'; echo '<td>'; echo '</td>'; if ($type_date=='jour') {echo "<td style=\"font-size:x-small;\">".adjust_date_jours($b['date'])."</td>";} else {echo "<td style=\"font-size:x-small;\">".$b['date']."</td>";} echo '<td></td>'; $chaine=prone($b['content'],$size_abstract); echo "<td>"; $concepts = implode("; ", convert_forme_principale_id($b['concepts'])); $permalien = $b['permalien']; $chaine = prone($chaine,8); $index=$b['index']; $jscriptmp.=" $('#dialog".$index."') .dialog({ autoOpen: false, stack: true, modal:true, width:600, closeOnEscape:true}) .click(function () { $('#dialog".$index."').dialog('close'); }); $('#opener".$index."').click(function(e) { if (!$('#dialog".$index."').dialog('isOpen')) $('#dialog".$index."').dialog('option','position', [$(this).position().left+50,'center']).dialog('open'); else $('#dialog".$index."').dialog('close'); return false; });";
function display_billets_plus($info_sources, $list_of_concepts, $my_period, $type_notice, $noscroll = 0) { function id_maker($x) { $y = 10 * floor(round(100 * $x) / 10); if ($y > 50) { $y = 50; } return $y; } global $jscriptmp; $backdark = "#E8E8E8"; $backlight = "#E1E1E1"; // scrollbar? if (!$noscroll) { $jscriptmp .= "\$('.scrollPane').scrollbar;"; echo '<div class="scrollPane">'; } foreach (array_keys($info_sources) as $key) { $max_pert = 0.1; for ($i = 0; $i < count($info_sources[$key]['titres']); $i++) { $pertmp = $info_sources[$key]['pertinences'][$i]; if ($pertmp > $max_pert) { $max_pert = $pertmp; } } $sourcetagid = id_maker($max_pert); $sourcetagidtext = 'value="pert' . $sourcetagid . '"'; //print_r($info_sources[$key]['pertinences']); echo $max_pert.'<br>'.$sourcetagidtext.'<br>'; echo '<table width=100% id=tab"' . $info_sources[$key]['idauteur'] . '" ' . $sourcetagidtext . ' cellspacing=0 cellpadding=0 style="display:none;">'; //>'; echo '<tr width=100% id="top' . $info_sources[$key]['idauteur'] . '" ' . $sourcetagidtext . ' style="display:none;">'; echo '<td width=10%></td><td width=2%></td><td width=2%><td width=86%></td></tr>'; echo '<tr width=100% id="tab' . $info_sources[$key]['idauteur'] . '" ' . $sourcetagidtext . ' valign=top class=tableitems style="background-color:' . $backdark . '; display:none;">'; echo '<td colspan=5 style="font-size:x-small;">'; $ids_auteur = recup_id_auteurs($info_sources[$key]['idauteur']); $keys = recup_names_auteurs($key); for ($j = 0; $j < count($ids_auteur); $j++) { echo ' <a href=source.php?id_source=' . $ids_auteur[$j] . "&periode=" . $my_period . '><b>' . $keys[$j] . "</b></a>"; if ($j < count($ids_auteur) - 1) { echo '; '; } } echo '</td>'; echo '</tr>'; for ($i = 0; $i < count($info_sources[$key]['titres']); $i++) { $idtext = 'value="pert' . id_maker($info_sources[$key]['pertinences'][$i]) . '"'; $chaine = $info_sources[$key]['content'][$i]; //coupe l'abstract aux 15 premières lignes $chaine = prone($chaine, 8); //print_r(convert_forme_principale_id($info_sources[$key]['concepts'][$i])); $conc = implode("; ", convert_forme_principale_id($info_sources[$key]['concepts'][$i])); //echo $conc; //il faut normaliser le nom de l'index pour que javascript ne soit pas perdu $index = str_replace("%", "", str_replace("/", "", str_replace(".", "", str_replace("-", "", $key . "-" . $i)))); $jscriptmp .= "\n\t\t\t\t\$('#dialog" . $index . "')\n\t\t\t\t\t.dialog({ autoOpen: false, stack: true, modal:true, width:600, closeOnEscape:true})\n\t\t\t\t\t.click(function () { \$('#dialog" . $index . "').dialog('close'); });\n\t\t\t\t\$('#opener" . $index . "').click(function(e) {\n\t\t\t\t\tif (!\$('#dialog" . $index . "').dialog('isOpen')) \n\t\t\t\t\t\t\$('#dialog" . $index . "').dialog('option','position', [\$(this).position().left+50,'center']).dialog('open');\n\t\t\t\t\telse\n\t\t\t\t\t\t\$('#dialog" . $index . "').dialog('close');\n\t\t\t\t\treturn false;\n\t\t\t\t\t});"; $insertedtext = ""; if (count($list_of_concepts) > 1) { $insertedtext .= " (" . number_format(round(100 * $info_sources[$key]['pertinences'][$i]), 0, ',', ' ') . "%)"; } echo '<tr id="bil' . $info_sources[$key]['idauteur'] . $i . '" ' . $idtext . ' valign=top class=commentitems width=100% style="background-color:' . $backdark . ';" onMouseOver="this.style.backgroundColor=\'' . $backlight . '\';" onMouseOut="this.style.backgroundColor=\'' . $backdark . '\';">'; echo '<td width=13% style=\\"font-size:x-small;\\">'; echo ' ' . $info_sources[$key]['dates'][$i]; echo "</td>"; echo "<td width=2%>"; echo "</td>"; echo "<td width=2%>"; echo display_box_plus($info_sources[$key]['titres'][$i], $key, $chaine, $info_sources[$key]['permaliens'][$i], $conc, $type_notice, $index, $insertedtext); echo "</td>"; echo "</tr>"; } echo '<tr id="' . $info_sources[$key]['idauteur'] . 'r" ' . $sourcetagidtext . ' style="height:2px;background-color:' . $backlight . ';" style="display:none;">'; echo '<td colspan=6></td>'; echo '</tr>'; echo "</table>"; } if (!$noscroll) { echo '</div>'; } }