Show
Ignore:
Timestamp:
04/23/08 09:31:05 (7 months ago)
Author:
JensDiemer
Message:
  • page title
    • plugin_manager.handle_command() changes the page title, if it's not changes by the plugin themself.
    • remove some headlines in internal pages
    • set some title in plugins
  • add BasePlugin?.build_menu() - Used in show_internals (comes later)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/system/plugin_manager.py

    r1522 r1532  
    6060    plugin_class = getattr(plugin, plugin_name) 
    6161    return plugin_class 
     62 
     63def debug_plugin_config(page_msg, plugin_config): 
     64    for item in dir(plugin_config): 
     65        if item.startswith("_"): 
     66            continue 
     67        page_msg("'%s':" % item) 
     68        page_msg(getattr(plugin_config, item)) 
    6269 
    6370def get_plugin_config(request, package_name, plugin_name, 
     
    198205def handle_command(context, response, plugin_name, method_name, url_args): 
    199206    """ 
    200     handle a _command url request 
    201     """ 
     207    handle a _command url request. 
     208    If the plugin doesn't change the page title, we set it here. 
     209    """ 
     210    original_page_title = context["PAGE"].title 
     211 
    202212    output = run(context, response, plugin_name, method_name, url_args) 
     213 
     214    if context["PAGE"].title == original_page_title: 
     215        # The plugin doesn't set a page title. 
     216        if plugin_name == method_name or method_name == "lucidTag": 
     217            title = plugin_name 
     218        else: 
     219            title = "%s - %s" % (plugin_name, method_name) 
     220        context["PAGE"].title = title.replace("_", " ") 
    203221 
    204222    return output