$titleheader.='('.get_short_string_periode($my_period).') [champ]'; if ($nav=="cooc" or $nav=="soc" or $nav=="socsem") $jsprotovis="TRUE"; include("include/header.php"); include("banner.php"); //////////////////////////// /// MODULE DE NAVIGATION /// //////////////////////////// $query="select * FROM partitions WHERE id_partition=".$id_partition; $resultat=mysql_query($query) or die ("<b>Requête non exécutée (récupération de info de partition)</b>."); $partition_infos=mysql_fetch_array($resultat); if ($partition_infos[nb_period_covered]>1){ list($jscriptmp,$linkFilThematique)=FTInfo($jscriptmp,$partition_infos[id_partition],'#ffffff'); $imagestar=imagestar($partition_infos[id_partition]); }; list($jscriptmp,$linkcluster)=link2clusters($jscriptmp,$partition_infos[id_partition], $partition_infos,str_replace('-',' ', $periode)); ////////////// echo '<table width=100% class=tableitems>'; echo '<tr valign=top><td width=2.5%></td><td>'; echo '<table width=100% class=subtitle><tr><td align=left>champ thématique "<i>'.remove_popo($label1_current).'</i><i style="font-weight:normal;"> - '.remove_popo($label2_current).'" '; if ($lettre_current!="") echo '('.$lettre_current.')'; echo '</i>';
function branch_list_string($mysql_branch_list, $depth, $min_similarity, $groupAlgo = 'cluster_branches') { //donne la liste des macro-branches qui couvrent au moins $phylo_min_nb_periods_covered global $jscriptmp; $whitedark = '#F8F8F8'; $whitedarker = '#E8E8E8'; //$label_list=array(); // liste des branches //$branch_last_period=array(); // liste des périodes associées //$branch_last_period_cluster_id=array(); // liste de clusters des branches $branch_list = array(); // infos sur les macro-branches (a vocation a intégrer toutes les variable ci-dessus) while ($ligne = mysql_fetch_array($mysql_branch_list)) { $last_period_for_branch = $ligne[last_period_string]; $infos = array(); // information sur la partition traitée $infos['id_partition'] = $ligne[id_partition]; $infos['nb_fields'] = $ligne[nb_fields]; $infos['terms'] = $ligne[terms]; $infos['terms_occ'] = $ligne[terms_occ]; $infos['branch_last_period'] = str_replace(' ', '-', $last_period_for_branch); $lab = $ligne[label]; if (strcmp(substr($lab, -1), ',') == 0) { $lab = substr($lab, 0, -1); } $infos['label'] = $lab; $infos['label_ids'] = $ligne[label_ids]; array_push($branch_list, $infos); } $nb_branches = count($branch_list); $grouped_labels = cluster_branches($branch_list, $depth, $min_similarity, $groupAlgo); $grouped_indexes = $grouped_labels[grouped_indexes]; // groupes des index branches $Ngram_arrays = $grouped_labels[Ngram_arrays]; // array pour les labelliser $branch_string = '<table class=tableitems cellspacing=0 cellpadding=3 style="background-color:' . $whitedark . ';" width=100%>'; $branch_string .= '<tr><td colspan=4 width=100% style="font-variant:small-caps; font-size:normal;">'; // html avec la liste des branches $branch_string .= '<i>(' . $nb_branches . ' fils thématiques dans cette catégorie)</i>'; $branch_string .= '</td></tr>'; $branch_string .= '<tr height=7px><td colspan=4 width=100%></td></tr>'; $first_withoutgroup = 1; if (count($grouped_indexes) > 0) { $branch_string .= '<tr style="background-color:white; font-variant:small-caps; font-size:large; font-weight:bold;" height=50px>'; $branch_string .= '<td colspan=4 width=100%>Regroupements de fils thématiques</td></tr>'; $branch_string .= '<tr height=7px style="background-color:#E0E0E0;"><td colspan=4 width=100%></td></tr>'; } for ($i = 0; $i < count($grouped_indexes); $i++) { $index_grouped = $grouped_indexes[$i]; $Ngrams = $Ngram_arrays[$i]; if (count($index_grouped) > 1) { // c'est un groupe $group_title = ''; while (count($Ngrams) > 0 && ($line = current($Ngrams))) { $group_title .= ucfirst(key($Ngrams)) . ', '; next($Ngrams); } $group_title = substr(trim($group_title), 0, -1); $branch_string .= '<tr><td colspan=4 width=100%>'; $branch_string .= '<b>' . ucfirst($group_title) . '</b>'; $branch_string .= '</td></tr>'; for ($j = 0; $j < count($index_grouped); $j++) { $index = $index_grouped[$j]; $branch_id = $branch_list[$index]['id_partition']; list($jscriptmp, $linkFilThematique) = FTInfo($jscriptmp, $branch_id, '#000000'); //list($jscriptmp,$linkFilThematique)=linkFilThematique($jscriptmp,$branch_id,$branch_list[$index],$backdarker); $sql = 'SELECT * from partitions WHERE id_partition=' . $branch_id; $resultat = mysql_query($sql) or die("<b>Requête non exécutée (récupération des infos de partition)</b>."); $ligne = mysql_fetch_array($resultat); $nchamps = $ligne['nb_fields']; list($jscriptmp, $linkstar) = linkstar($jscriptmp, $branch_id, $branch_list[$index], $ligne['periodWithMaxScore']); $imagestar = imagestar($branch_id); $branch = '<tr value=' . $nchamps . ' onMouseOver="this.style.backgroundColor=\'' . $whitedarker . '\';" onMouseOut="this.style.backgroundColor=\'' . $whitedark . '\';">'; $branch .= '<td width=50px style="font-size: x-small; text-align:right;"><b>' . $nchamps . '</b> champs<br/>' . $linkstar . $imagestar . '</a></td>'; $branch .= '<td width=50px style="font-size: x-small; text-align:right;"> '; $branch .= str_replace("( ", "(", str_replace(" ", " ", get_short_string_periode($ligne['first_period'] . '-' . $ligne['last_period']))); $branch .= ' </td><td style="font-size:9pt;">'; $branch .= $linkFilThematique; $branch .= '</td></tr>'; $branch_string .= $branch; next($index_grouped); } } else { // c'est une branche isolée if ($first_withoutgroup) { $branch_string .= '<tr style="background-color:white; font-variant:small-caps; font-size:large; font-weight:bold;" height=50px>'; $branch_string .= '<td colspan=4 width=100%>fils thématiques hors regroupement'; $first_withoutgroup = 0; } else { $branch_string .= '<tr><td colspan=4 width=100%>'; } $branch_string .= '</td></tr>'; $branch_id = $branch_list[$index_grouped[0]]['id_partition']; //list($jscriptmp,$linkFilThematique)=linkFilThematique($jscriptmp,$branch_id,$branch_list[$index_grouped[0]],$backdarker); list($jscriptmp, $linkFilThematique) = FTInfo($jscriptmp, $branch_id, '#000000'); $sql = 'SELECT * from partitions WHERE id_partition=' . $branch_id; $resultat = mysql_query($sql) or die("<b>Requête non exécutée (récupération des infos de partition)</b>."); $ligne = mysql_fetch_array($resultat); $nchamps = $ligne['nb_fields']; list($jscriptmp, $linkstar) = linkstar($jscriptmp, $branch_id, $branch_list[$index], $ligne['periodWithMaxScore']); $imagestar = imagestar($branch_id); $branch = '<tr value=' . $nchamps . ' onMouseOver="this.style.backgroundColor=\'' . $whitedarker . '\';" onMouseOut="this.style.backgroundColor=\'' . $whitedark . '\';">'; $branch .= '<td width=50px style="font-size: x-small; text-align:right;"><b>' . $ligne['nb_fields'] . '</b> champs<br/>' . $linkstar . $imagestar . '</a></td>'; $branch .= '<td width=50px style="font-size: x-small; text-align:right;"> '; $branch .= str_replace("( ", "(", str_replace(" ", " ", get_short_string_periode($ligne['first_period'] . '-' . $ligne['last_period']))); $branch .= ' </td><td style="font-size:9pt;">'; $branch .= $linkFilThematique; $branch .= '</td></tr>'; $branch_string .= $branch; } $branch_string .= '<tr height=3px><td width=100% colspan=4 style="background-color:' . $whitedarker . ';"></td></tr>'; //$branch_string=$branch_string.'</ul>'.'<br/>'; } $branch_string .= '</table>'; return remove_popo($branch_string); }