Fixes php notice.
[platal.git] / templates / wiki.tpl
index 0c679a4..6565c97 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
+{if $canedit || $has_perms}
 <table class='wiki' cellspacing='0' cellpadding='0'>
   <tr>
     <td>
       <a href='{$wikipage}'>Voir la page</a>
-      {if $has_perms}
-      <select>
-      {html_options options=$perms_opts selected=$perms[0]}
-      </select>
-      {/if}
     </td>
     {if $canedit}
     <td>
-      <a href='{$wikipage}?action=edit'>Éditer</a>
-      {if $has_perms}
-      <select>
-      {html_options options=$perms_opts selected=$perms[1]}
-      </select>
-      {else}
-      {$perms[0]}
-      {/if}
+      <a href='{$wikipage}?action=edit'>Éditer la page</a>
     </td>
     {/if}
-    {if $has_perms}
+  {if $has_perms}
     <td>
       <a href='{$wikipage}?action=diff'>Historique</a>
     </td>
     <td>
       <a href='{$wikipage}?action=upload'>Upload</a>
     </td>
-    {/if}
+  </tr>
+  <tr>
+    <td>
+      <select onchange="$.dynPost('{$wikipage}', 'setrperms', this.value)">
+      {html_options options=$perms_opts selected=$perms[0]}
+      </select>
+    </td>
+    <td>
+      <select onchange="$.dynPost('{$wikipage}', 'setwperms', this.value)">
+      {html_options options=$perms_opts selected=$perms[1]}
+      </select>
+    </td>
+    <td colspan='2' style='text-align: left'>&lt;-- Droits associés</td>
+  {/if}
   </tr>
 </table>
+{/if}
 
+{if t($text)}
 {$pmwiki|smarty:nodefaults}
+{else}
+{include file=$pmwiki_cache}
+{/if}
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}