diff MoinMoin/theme/__init__.py @ 3000:344e33587519

do not show 2 editor links in edit_bar if text editor is forced by admin (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 17:36:13 +0100
parents 6a1b18869fe8
children fe0263c5d64c
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Sun Jan 06 17:32:33 2008 +0100
+++ b/MoinMoin/theme/__init__.py	Sun Jan 06 17:36:13 2008 +0100
@@ -1117,8 +1117,12 @@
         """ Return whether the gui editor / converter can work for that page.
 
             The GUI editor currently only works for wiki format.
+            For simplicity, we also tell it does not work if the admin forces the text editor.
         """
-        return page.pi['format'] == 'wiki'
+        is_wiki = page.pi['format'] == 'wiki'
+        gui_disallowed = self.cfg.editor_force and self.cfg.editor_default == 'text'
+        return is_wiki and not gui_disallowed
+
 
     def editorLink(self, page):
         """ Return a link to the editor