Changeset 3005 for trunk

Show
Ignore:
Timestamp:
02/15/10 16:16:39 (2 years ago)
Author:
pjotr
Message:

Additional check for getSectionFromURL script. This was creating strange behavior for password reset form. From now on if provided section name is not one of the legal sections, script defaults to content

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/skins/lemill/getSectionFromURL.py

    r2867 r3005  
    88##title=Returns section name (first part of URL) to the body tag 
    99## 
     10lemill_sections = ('content', 'methods', 'tools', 'community') 
    1011contentPath = context.portal_url.getRelativeContentPath(context) 
    1112if not contentPath: 
    1213    return "content" 
    1314else: 
    14     return contentPath[0] 
     15    # Additional check in case some pages are shown outside the section context 
     16    if contentPath[0] in lemill_sections: 
     17        return contentPath[0] 
     18    else: 
     19        return "content"