Changeset 91356 in spip-zone
- Timestamp:
- Aug 14, 2015, 3:04:23 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/clil/trunk/base/clil.php
r91348 r91356 72 72 73 73 function clil_declarer_champs_extras($champs = array()) { 74 74 75 75 // étape 1 : récupérer les datas 76 76 $datas = array(); 77 $res1 = sql_select('id_clil_theme', 'spip_clil_themes', "tag='oui'",'id_secteur','id_clil_theme'); 77 78 // Récupérer d'abord les grands thèmes (group by sur id_secteur) pour les optgroups 79 $res1 = sql_select('id_secteur', 'spip_clil_themes', "tag='oui'",'id_secteur','id_clil_theme'); 78 80 79 81 while ($tab1 = sql_fetch($res1)){ 80 $optgroup = $tab1['id_ clil_theme'];82 $optgroup = $tab1['id_secteur']; 81 83 $libelle_optgroup = sql_getfetsel('libelle', 'spip_clil_themes', "id_clil_theme=$optgroup"); 82 $res2 = sql_select('id_clil_theme,libelle', 'spip_clil_themes', "tag='oui' AND id_secteur = $optgroup",'','id_clil_theme');83 84 85 // récupérer ensuite les thèmes CLIL sélectionnés 86 $res2 = sql_select('id_clil_theme, id_secteur, libelle', 'spip_clil_themes', "tag='oui' AND id_secteur = $optgroup",'','id_clil_theme'); 84 87 while ($tab2 = sql_fetch($res2)){ 85 $id_ secteur = $tab2['id_secteur'];86 $ code = $tab2['id_clil_theme'];87 $libelle = $tab2['libelle'];88 $id_clil_theme = $tab2['id_clil_theme']; 89 $id_secteur = $tab2['id_secteur']; 90 $libelle = $tab2['libelle']; 88 91 89 92 // un peu de mise en forme … … 91 94 function_exists('mb_strtolower') ? $libelle = ucfirst(mb_strtolower($libelle)) : $libelle = ucfirst(strtolower($libelle)); 92 95 93 $sous_tab[$ code] = $libelle;96 $sous_tab[$id_clil_theme] = $libelle; 94 97 } 95 98 $datas[$libelle_optgroup] = $sous_tab; … … 113 116 ), 114 117 ); 115 return $champs; 118 return $champs; 116 119 } 117 120
Note: See TracChangeset
for help on using the changeset viewer.