- Timestamp:
- 05/02/08 16:47:16 (23 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/PyLucid/plugins_internal/system_settings/system_settings.py
r1548 r1551 7 7 8 8 A pseudo plugin for holding the system settings via the plugin preferences. 9 10 TODO: merge with page_admin ChoiceField -> move it into PyLucid.db.page?11 9 12 10 Last commit info: … … 22 20 __version__= "$Rev$" 23 21 24 from django import newforms as forms22 #from django import newforms as forms 25 23 #from django.utils.translation import ugettext as _ 26 24 #from django.utils.safestring import mark_safe … … 28 26 from PyLucid.system.BasePlugin import PyLucidBasePlugin 29 27 from PyLucid.models import Page 30 from PyLucid.db.page import flat_tree_list31 32 def get_parent_choices():33 """34 generate a verbose page name tree for the parent choice field.35 """36 page_list = flat_tree_list()37 choices = [(0, "---[root]---")]38 for page in page_list:39 choices.append((page["id"], page["level_name"]))40 return choices41 42 class PreferencesForm(forms.Form):43 # index_page = forms.IntegerField(44 index_page = forms.ChoiceField(45 choices=get_parent_choices(),46 help_text="The page ID of the index page",47 initial=048 )49 auto_shortcuts = forms.BooleanField(50 help_text="Should the shortcut of a page rebuild on every edit?",51 initial=True52 )53 54 28 55 29 56 30 class system_settings(PyLucidBasePlugin): 57 58 31 def lucidTag(self): 59 32 """ 60 Insert a empty search form into the page.33 TODO! 61 34 """ 62 35 self.page_msg("Preferences:", preferences)