Implement hidden permission in profile editor
[platal.git] / templates / profile / general.hobby.tpl
index 6767329..c7d68d0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2014 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
-{if !hasPerm('directory_private') && ($hobby.pub eq 'private') && !empty($hobby.text|smarty:nodefaults)}
-{assign var=hiddenhobby value=true}
+{if $isMe || hasPerm('admin') || empty($hobby.text|smarty:nodefaults)}
+  {assign var=hiddenhobby value=false}
+{elseif hasPerm('directory_hidden') || (($hobby.pub neq 'hidden') && ($hobby.pub neq 'private'))}
+  {assign var=hiddenhobby value=false}
+{elseif hasPerm('directory_private') && ($hobby.pub neq 'hidden')}
+  {assign var=hiddenhobby value=false}
 {else}
-{assign var=hiddenhobby value=false}
+  {assign var=hiddenhobby value=true}
 {/if}
 
 <tr id="hobby_{$i}">
@@ -53,4 +57,4 @@
   </td>
 </tr>
 
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
+{* vim:set et sw=2 sts=2 sws=2 fenc=utf-8: *}