diff --git a/ecrire/ajax_page.php b/ecrire/ajax_page.php index 703694487de13becf1560b3c4f66fe9fb96141ba..e77968a330da10fa9a23ef866f719d07e2e1b54a 100644 --- a/ecrire/ajax_page.php +++ b/ecrire/ajax_page.php @@ -64,11 +64,14 @@ echo "<"."?xml version='1.0' encoding='$charset'?>"; echo "<div><p><b>$titre</b></p></div>"; if (strlen($descriptif) > 0) echo "<div>$descriptif</div>"; - echo "</div>"; - + echo "<div style='text-align: $spip_lang_right;'>"; echo "<input type='button' value='"._T('bouton_choisir')."' class='fondo' onClick=\"sel=findObj_forcer('".$rac."_sel').value; sel2=findObj_forcer('".$rac."_sel2').value; func = findObj('".$rac."_fonc').value; func = func.replace('::sel::', sel); func = func.replace('::sel2::', sel2); eval(func);\">"; echo "</div>"; + + + echo "</div>"; + } diff --git a/ecrire/inc_layer.php3 b/ecrire/inc_layer.php3 index 4d8df1a5c357800df145f4092a8504bce695b91f..030cc495361fde2d5ae2a4fc9b5ab74532aa5fa5 100644 --- a/ecrire/inc_layer.php3 +++ b/ecrire/inc_layer.php3 @@ -37,6 +37,7 @@ function debut_block_invisible($nom_block){ $compteur_block++; $numero_block["$nom_block"] = $compteur_block; } + return http_script("vis['".$numero_block["$nom_block"]."'] = 'hide'; document.write('<div id=\"Layer".$numero_block["$nom_block"]."\" style=\"display: none; margin-top: 1;\">');", '', diff --git a/ecrire/layer.js b/ecrire/layer.js index 7e9f2a32cb9d139f662c1f056de0cb2ddfc10da5..96935853211bb87076e2622a9a97e0f54a6a9d8d 100644 --- a/ecrire/layer.js +++ b/ecrire/layer.js @@ -45,7 +45,7 @@ var vis = new Array(); if (element.style.visibility != "hidden") element.style.visibility = "hidden"; } } - + function swap_couche(couche, rtl, dir, no_swap) { triangle = findObj('triangle' + couche); if (!(layer = findObj('Layer' + couche))) return; @@ -130,6 +130,8 @@ function changerhighlight (couche) { function aff_selection (type, rac, id) { // alert (type + " - " + rac + " - " + id); + findObj_forcer(rac+"_selection").style.display = "none"; + charger_id_url("ajax_page.php?fonction=aff_info&type="+type+"&id="+id+"&rac="+rac, rac+"_selection"); } @@ -144,7 +146,6 @@ var image_search = new Array(); function charger_id_url(myUrl, myField, jjscript) { var Field = findObj_forcer(myField); // selects the given element - if (!Field) return; if (xmlhttp[myField]) xmlhttp[myField].abort(); @@ -152,6 +153,7 @@ function charger_id_url(myUrl, myField, jjscript) if (url_chargee['mem_'+myUrl]) { Field.innerHTML = url_chargee['mem_'+myUrl]; Field.style.visibility = "visible"; + Field.style.display = "block"; if(jjscript) eval(jjscript); } else { image_search[myField] = findObj_forcer('img_'+myField); @@ -171,6 +173,7 @@ function charger_id_url(myUrl, myField, jjscript) Field.innerHTML = xmlhttp[myField].responseText; // puts the result into the element url_chargee['mem_'+myUrl] = Field.innerHTML; Field.style.visibility = "visible"; + Field.style.display = "block"; if (image_search[myField]) { image_search[myField].style.visibility = "hidden"; } @@ -182,6 +185,22 @@ function charger_id_url(myUrl, myField, jjscript) } +function charger_id_url_si_vide (myUrl, myField, jjscript) +{ + var Field = findObj_forcer(myField); // selects the given element + if (!Field) return; + + if (Field.innerHTML == "") { + charger_id_url(myUrl, myField, jjscript) + } + else { + Field.style.visibility = "visible"; + Field.style.display = "block"; + } + + +} + diff --git a/ecrire/rubriques_edit.php3 b/ecrire/rubriques_edit.php3 index ce5e2ff3ea0b1b50025276eb8d14dc1ee693b701..6032e1488edb0cfc812733128cbba25e46f846fa 100644 --- a/ecrire/rubriques_edit.php3 +++ b/ecrire/rubriques_edit.php3 @@ -199,8 +199,9 @@ if ($spip_display == 4) { $titre_parent = entites_html(_T("info_racine_site")); } + echo "<table width='100%'><tr width='100%'><td width='45'>"; - echo "<a href=\"javascript:findObj('selection_rubrique').style.display='block';charger_id_url('ajax_page.php?fonction=aff_parent&id_rubrique=$id_parent&exclus=$id_rubrique','selection_rubrique');\"><img src='img_pack/loupe.png' style='border: 0px; vertical-align: middle;' /></a> "; + echo "<a href=\"javascript:if(findObj('selection_rubrique').style.display=='none') {charger_id_url_si_vide('ajax_page.php?fonction=aff_parent&id_rubrique=$id_parent&exclus=$id_rubrique','selection_rubrique');} else {findObj('selection_rubrique').style.display='none';}\"><img src='img_pack/loupe.png' style='border: 0px; vertical-align: middle;' /></a> "; echo "<img src='img_pack/searching.gif' id='img_selection_rubrique' style='visibility: hidden;'>"; echo "</td><td>"; echo "<input type='text' id='titreparent' name='titreparent' disabled='disabled' class='forml' value=\"$titre_parent\" />";