".$msg["admin_connecteurs_sets_setcaption"]." ".$msg["admin_connecteurs_sets_settype"]." ".$msg["admin_connecteurs_sets_setadditionalinfo"]." ".$msg["admin_connecteurs_setcateg_latestcacheupdate"]." ".$msg["admin_connecteurs_setcateg_manualupdate"]." "; $tablefooter = ''; $parity=1; foreach($sets->sets as &$aset) { if ($current_type!=$aset->type) { print $current_type != 0 ? $tablefooter : ''; print "

".htmlentities($msg[$connector_out_set_types_msgs[$aset->type]] ,ENT_QUOTES, $charset)."

"; print $tableheader; $current_type = $aset->type; } $pair_impair = $parity++ % 2 ? 'even' : 'odd'; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./admin.php?categ=connecteurs&sub=out_sets&action=edit&id=$aset->id';\" "; print ""; print "".htmlentities($aset->caption ,ENT_QUOTES, $charset).""; print "".htmlentities($msg[$connector_out_set_types_msgs[$aset->type]] ,ENT_QUOTES, $charset).""; print "".htmlentities($aset->get_third_column_info() ,ENT_QUOTES, $charset).""; $date_caption = strtotime($aset->cache->last_updated_date) ? formatdate($aset->cache->last_updated_date, 1) : $msg["admin_connecteurs_setcateg_latestcacheupdate_never"]; print "".htmlentities($date_caption ,ENT_QUOTES, $charset).""; print ""."".""; print ""; } if (!count($sets->sets)) { print ''.$msg["admin_connecteurs_sets_nosets"].''; } print $tablefooter; print "

"; } function show_set_form($id=0, $set_type=0, $set_caption='', $config_form=NULL, $cache_config_form=NULL) { global $msg, $charset; global $connector_out_set_types, $connector_out_set_types_msgs; print '
'; if (!$id) print '

'.$msg['admin_connecteurs_set_add'].'

'; else print '

'.$msg['admin_connecteurs_set_edit'].'

'; print '
'; //id print ''; //caption print '

'; print '
'; //type if (!$id) { $type_input = ''; } else { $type_input = htmlentities($msg[$connector_out_set_types_msgs[$set_type]] ,ENT_QUOTES, $charset); $type_input .= ''; } print '

'; print $type_input; print '
'; if ($config_form) { print '
'; print call_user_func_array($config_form, array(&$out_of_form_result)); print '
'; } if ($cache_config_form) { print '
'; print call_user_func($cache_config_form); print '
'; } //buttons print "
"; print " "; print ''; print "
"; if ($id) { print confirmation_delete("./admin.php?categ=connecteurs&sub=out_sets&action=del&id="); print ""; } print "
 
"; print '
'; if ($out_of_form_result) print $out_of_form_result; } function update_set_from_form() { global $msg, $charset,$dbh,$id; global $set_type, $set_caption; if (!$id) { //Ajout d'un nouveau set if (!$set_caption) { print $msg['admin_connecteurs_set_emptyfield']; show_set_form(0, stripslashes($set_type), stripslashes($set_caption)); return false; } if (connector_out_set::caption_exists($set_caption)) { print $msg['admin_connecteurs_set_namealreadyexists']; show_set_form(0, stripslashes($set_type), stripslashes($set_caption)); return false; } $new_set = connector_out_set::add_new(); $new_set->type = $set_type; $new_set->caption = stripslashes($set_caption); $new_set->commit_to_db(); } else { $theset = new_connector_out_set_typed($id); if ($theset->error) { return false; } $theset->type = $set_type; $theset->caption = stripslashes($set_caption); $theset->update_config_from_form(); $theset->cache->update_from_form(); $theset->commit_to_db(); $theset->cache->commit_to_db(); } return true; } function show_import_noticesearch_into_multicritere_set_form() { global $toset_search, $msg, $candidate_id; $candidate_id += 0; $serialized_search = stripslashes($toset_search); //Un petit tour dans la classe search histoire de filtrer la recherche $sc = new search(false); $sc->unserialize_search($serialized_search); $serialized_search = $sc->serialize_search(); $human_query = $sc->make_human_query(); print '
'; print '

'.$msg['search_notice_to_connector_out_set_formtitle'].'

'; print '
'; //la recherche print ''; //caption print '

'; print $human_query; print '

'; //set d'acceuil $set_list = ''; //caption print '

'; print $set_list; print '

'; //buttons print "
"; print " "; print ''; print "
"; print "


"; print '
'; } function import_noticesearch_into_multicritere_set() { global $dbh, $toset_search, $set_id; $set_id+=0; //Pas de set spécifié? if (!$set_id) return; //Vérifions que le set spécifié est bien un bon set multicritère $the_set = new connector_out_set($set_id, true); if ($the_set->type != 2) return; $serialized_search = stripslashes($toset_search); //Un petit tour dans la classe search histoire de filtrer la recherche $sc = new search(false); $sc->unserialize_search($serialized_search); $serialized_search = $sc->serialize_search(); //Mettons à jour le set $the_set_m = new connector_out_set_noticemulticritere($set_id, true); $the_set_m->config["search"] = $serialized_search; $the_set_m->commit_to_db(); $the_set_m->clear_cache(true); } if (!isset($action)) $action=""; switch ($action) { case "add": show_set_form(0, '', ''); break; case "edit": $set_type=0; $set_caption=''; $set_config_form=NULL; $setcache_config_form=NULL; if ($id) { $the_set = new_connector_out_set_typed($id); if ($the_set->error) { $id = 0; } else { $set_type=$the_set->type; $set_caption=$the_set->caption; $set_config_form=array($the_set, 'get_config_form'); $setcache_config_form=array($the_set->cache, 'get_config_form'); } } show_set_form($id, $set_type, $set_caption, $set_config_form, $setcache_config_form); break; case "update": if (update_set_from_form()) list_out_sets(); break; case "manual_update": $theset = new_connector_out_set_typed($id); if ($theset->error) { return false; } $theset->update_cache(); list_out_sets(); break; case "del": if ($id) { $the_set = new connector_out_set($id); $the_set->delete(); } list_out_sets(); break; case "import_notice_search_into_set": show_import_noticesearch_into_multicritere_set_form(); break; case "import_notice_search_into_set_do": import_noticesearch_into_multicritere_set(); list_out_sets(); break; default: list_out_sets(); break; } ?>