comparison 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
comparison
equal deleted inserted replaced
2999:e94b940f3a84 3000:344e33587519
1115 1115
1116 def guiworks(self, page): 1116 def guiworks(self, page):
1117 """ Return whether the gui editor / converter can work for that page. 1117 """ Return whether the gui editor / converter can work for that page.
1118 1118
1119 The GUI editor currently only works for wiki format. 1119 The GUI editor currently only works for wiki format.
1120 """ 1120 For simplicity, we also tell it does not work if the admin forces the text editor.
1121 return page.pi['format'] == 'wiki' 1121 """
1122 is_wiki = page.pi['format'] == 'wiki'
1123 gui_disallowed = self.cfg.editor_force and self.cfg.editor_default == 'text'
1124 return is_wiki and not gui_disallowed
1125
1122 1126
1123 def editorLink(self, page): 1127 def editorLink(self, page):
1124 """ Return a link to the editor 1128 """ Return a link to the editor
1125 1129
1126 If the user can't edit, return a disabled edit link. 1130 If the user can't edit, return a disabled edit link.