} else { $bouton_ajouter = "<input type='button' class='bouton_small' onclick=\"document.location='{$base_url}&action=add&deb_rech='+this.form.f_user_input.value\" value='{$msg['163']}' />"; } switch ($action) { case 'add': $collection_form = str_replace("!!deb_saisie!!", htmlentities(stripslashes($f_user_input), ENT_QUOTES, $charset), $collection_form); print $collection_form; break; case 'update': require_once "{$class_path}/editor.class.php"; require_once "{$class_path}/collection.class.php"; $value['name'] = $collection_nom; $value['parent'] = $ed_id; $value['issn'] = $issn; $collection = new collection(); $collection->update($value); $sel_search_form = str_replace("!!bouton_ajouter!!", $bouton_ajouter, $sel_search_form); $sel_search_form = str_replace("!!deb_rech!!", htmlentities(stripslashes($f_user_input), ENT_QUOTES, $charset), $sel_search_form); print $sel_search_form; print $jscript; show_results($dbh, $collection_nom, 0, 0, $collection->id); break; default: $sel_search_form = str_replace("!!bouton_ajouter!!", $bouton_ajouter, $sel_search_form); $sel_search_form = str_replace("!!deb_rech!!", htmlentities(stripslashes($f_user_input), ENT_QUOTES, $charset), $sel_search_form); print $sel_search_form; print $jscript; show_results($dbh, $user_input, $nbr_lignes, $page); break; } function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
if (!$sup_result) { include './autorites/collections/collections_list.inc.php'; } else { error_message($msg[132], $sup_result, 1, "./autorites.php?categ=collections&sub=collection_form&id={$id}"); } break; case 'update': // mettre à jour collection id // mise à jour d'une collection $collection_nom = clean_string($collection_nom); if (!$collection_nom || !$ed_id) { error_message($msg[132], $mg['erreur_creation_collection'], 1, ""); } else { $coll = array('name' => $collection_nom, 'parent' => $ed_id, 'collection_web' => $collection_web, 'issn' => $issn, 'comment' => $comment); $collection = new collection($id); $collection->update($coll); include './autorites/collections/collections_list.inc.php'; } break; case 'collection_form': // création d'une collection if (!$id) { // affichage du form pour création $collection = new collection(); $collection->show_form(); } else { // affichage du form pour modification $collection = new collection($id); $collection->show_form(); } break;