You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1 KiB

  1. <?php
  2. if (!defined('_ECRIRE_INC_VERSION')) return;
  3. function formulaires_spipr_educ_recherche_educnat_charger_dist() {
  4. $req_sql=sql_select('*','spip_spipr_educ',"nom='recherche_educnat' AND type='gestion bloc' AND nom_sauvegarde='en_cours_d_utilisation_SPIPr'");
  5. $tab_sql=sql_fetch($req_sql);
  6. $valeurs['rechercheEducnat']= ($tab_sql['parametre1'] ? $tab_sql['parametre1'] : '');
  7. return $valeurs;
  8. }
  9. function formulaires_spipr_educ_recherche_educnat_traiter_dist() {
  10. $decompte=0;
  11. $tab_request=array();
  12. if (_request('hidden_recherche_educnat')=='ok') {
  13. $req_mots_cles=sql_select('id_mot','spip_mots','','titre');
  14. while ($mot = sql_fetch($req_mots_cles)){
  15. if (_request('mot'.$mot['id_mot'])=='on') {
  16. $tab_request[]=$mot['id_mot'];
  17. $decompte++;
  18. }
  19. };
  20. if ($decompte>10) {$res['message_erreur']="Merci de choisir moins de 10 mots-clés";}
  21. else {
  22. $res['message_ok'] = _T('config_info_enregistree');
  23. sql_updateq('spip_spipr_educ',array('parametre1' => implode(",",$tab_request)),"nom='recherche_educnat' AND type='gestion bloc' AND nom_sauvegarde='en_cours_d_utilisation_SPIPr'");
  24. }
  25. }
  26. return $res;
  27. }
  28. ?>