Ignore:
Timestamp:
02/16/05 17:05:51 (8 years ago)
Author:
hauma
Message:
  • Fancyfication: Hide edit buttons in TracNav, if no WIKI_MODIFY permission is granted.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trac/trunk/wiki-macros/JPNav.py

    r2696 r2704  
    7474    toc = getToc(db, name) 
    7575    if not toc: 
    76         return '<div class="system-message"><strong>Error: Table of contents does not exist. Click here to <a href="%s?edit=yes">edit</a>.</strong></div>' % env.href.wiki(name) 
     76        msg = '' 
     77        msg += '<div class="system-message"><strong>Error: Table of contents does not exist.' 
     78        if (hdf.getValue('trac.acl.WIKI_MODIFY', '')): 
     79            msg += ' Click here to <a href="%s?edit=yes">edit</a>.' % env.href.wiki(name) 
     80        msg += '</strong></div>' 
     81        return msg 
    7782 
    7883    html = '' 
    7984    html += '<div class="wiki-toc">' 
    80     html += '<div class="wiki-tocedit"><a href="%s?edit=yes">edit</a></div>' % env.href.wiki(name) 
     85    if (hdf.getValue('trac.acl.WIKI_MODIFY', '')): 
     86        html += '<div class="wiki-tocedit"><a href="%s?edit=yes">edit</a></div>' % env.href.wiki(name) 
    8187    (_, subhtml) = generate(env, curpage, toc) 
    8288    html += subhtml 
Note: See TracChangeset for help on using the changeset viewer.