Ajout : ./garradin
[garradin.git] / templates / admin / wiki / _chercher_parent.tpl
1 {include file="admin/_head.tpl" title="Choisir la page parent" current="wiki" body_id="popup" is_popup=true}
2
3 <div class="wikiTree">
4 <p class="choice">
5 <input type="button" onclick="chooseParent();" value="Choisir la page sélectionnée" />
6 </p>
7
8 {display_tree tree=$list}
9
10 </div>
11
12 {literal}
13 <script type="text/javascript">
14 (function() {
15 window.chooseParent = function()
16 {
17 var elm = document.getElementsByClassName("current")[0].getElementsByTagName("a")[0];
18
19 if (match = elm.href.match(/=(\d+)$/))
20 {
21 var id = parseInt(match[1], 10);
22 var titre = (id == 0 ? 'la racine du site' : elm.innerHTML);
23
24 if (window.opener.changeParent(id, titre))
25 {
26 self.close();
27 }
28 else
29 {
30 alert("Impossible de choisir la page comme parent d'elle-même !");
31 }
32
33 return false;
34 }
35 };
36 }());
37 </script>
38 {/literal}
39
40 {include file="admin/_foot.tpl"}