Show
Ignore:
Timestamp:
05/02/08 16:47:16 (23 months ago)
Author:
JensDiemer
Message:

update preferences:

  • move the preferences form from the plugin module into the plugin config modul
  • a plugin must not use try...except to get the preferences
  • update all modules around the plugin install/deinstall etc.
  • detect_page used the system_settings "index_page" value (setup a other default index page works!)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/plugins_internal/system_settings/system_settings.py

    r1548 r1551  
    77 
    88    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? 
    119 
    1210    Last commit info: 
     
    2220__version__= "$Rev$" 
    2321 
    24 from django import newforms as forms 
     22#from django import newforms as forms 
    2523#from django.utils.translation import ugettext as _ 
    2624#from django.utils.safestring import mark_safe 
     
    2826from PyLucid.system.BasePlugin import PyLucidBasePlugin 
    2927from PyLucid.models import Page 
    30 from PyLucid.db.page import flat_tree_list 
    31  
    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 choices 
    41  
    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=0 
    48     ) 
    49     auto_shortcuts = forms.BooleanField( 
    50         help_text="Should the shortcut of a page rebuild on every edit?", 
    51         initial=True 
    52     ) 
    53  
    5428 
    5529 
    5630class system_settings(PyLucidBasePlugin): 
    57  
    5831    def lucidTag(self): 
    5932        """ 
    60         Insert a empty search form into the page. 
     33        TODO! 
    6134        """ 
    6235        self.page_msg("Preferences:", preferences)