fold/unfold wiki folders in admin/wiki
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 23 Mar 2007 22:54:55 +0000 (22:54 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 23 Mar 2007 22:54:55 +0000 (22:54 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1602 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs/images/k1.gif [new file with mode: 0644]
modules/admin.php
templates/admin/wiki.tpl

diff --git a/htdocs/images/k1.gif b/htdocs/images/k1.gif
new file mode 100644 (file)
index 0000000..5397861
Binary files /dev/null and b/htdocs/images/k1.gif differ
index 5edf410..1b13c58 100644 (file)
@@ -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);
     }
index 40bed60..9f10bed 100644 (file)
     }
     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);
+  });
 // -->
 </script>
 {/literal}
   <tr class="pair">
     <td colspan="4" style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
       <img src="images/k2.gif" alt="-" width="9" height="21" />
-      {$cat} <a href="{$cat}/RecentChanges">{icon name=magnifier title="Changements récents"}</a>
+      {$cat} ({$pages|@count}) <a href="{$cat}/RecentChanges">{icon name=magnifier title="Changements récents"}</a>
     </td>
   </tr>
 {foreach from=$pages item=perm key=page name=pages}
-  <tr class="impair" onmouseover="this.className='pair';" onmouseout="this.className='impair';">
+  <tr id="row/{$cat}/{$page}" class="impair" onmouseover="this.className='pair';" onmouseout="this.className='impair';">
     <td style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
       {if $smarty.foreach.pages.last}
       <img src="images/L.gif" alt="L" width="12" height="21" />