From: x2001corpet Date: Fri, 23 Mar 2007 22:54:55 +0000 (+0000) Subject: fold/unfold wiki folders in admin/wiki X-Git-Tag: xorg/0.9.14~184 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e923a0cec71e7185f61da64fb7e9ec526d7b5f29;p=platal.git fold/unfold wiki folders in admin/wiki git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1602 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/images/k1.gif b/htdocs/images/k1.gif new file mode 100644 index 0000000..5397861 Binary files /dev/null and b/htdocs/images/k1.gif differ diff --git a/modules/admin.php b/modules/admin.php index 5edf410..1b13c58 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -944,6 +944,7 @@ class AdminModule extends PLModule $page->changeTpl('admin/wiki.tpl'); + $page->addJsLink('jquery.js'); $page->assign('wiki_pages', $wiki_tree); $page->assign('perms_opts', $perms); } diff --git a/templates/admin/wiki.tpl b/templates/admin/wiki.tpl index 40bed60..9f10bed 100644 --- a/templates/admin/wiki.tpl +++ b/templates/admin/wiki.tpl @@ -35,6 +35,19 @@ } return false; } + function replie() { + var cat=$.trim($(this).parent().text().replace(/(.*)\([0-9]+\)/, "$1")); + $("tr[@id^=row/"+cat+"/]").hide(); + $(this).attr('src', 'images/k1.gif').unbind("click", replie).click(deplie); + } + function deplie(image) { + var cat=$.trim($(this).parent().text().replace(/(.*)\([0-9]+\)/, "$1")); + $("tr[@id^=row/"+cat+"/]").show(); + $(this).attr('src', 'images/k2.gif').unbind("click", deplie).click(replie); + } + $(document).ready(function() { + $("tr.pair img[@alt=-]").css("cursor","pointer").each(replie); + }); // --> {/literal} @@ -63,11 +76,11 @@ - - {$cat} {icon name=magnifier title="Changements récents"} + {$cat} ({$pages|@count}) {icon name=magnifier title="Changements récents"} {foreach from=$pages item=perm key=page name=pages} - + {if $smarty.foreach.pages.last} L