Changeset 861

Show
Ignore:
Timestamp:
05/04/07 04:22:30
Author:
piv
Message:

added possibility to customize Silo Navigation portlet for the portal root

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qSiloGroup/trunk/HISTORY.txt

    r851 r861  
     10.3.0 
     2 
     3  * added possibility to customize Silo Navigation portlet for the portal root 
     4   
     5  * refactored skins layout for diminishing template logic, added utils module 
     6 
    170.2.0 
    28 
  • qSiloGroup/trunk/__init__.py

    r731 r861  
     1from AccessControl import allow_module 
    12from Products.CMFCore import utils 
    23from Products.CMFCore.DirectoryView import registerDirectory 
     
    78 
    89registerDirectory(SKINS_DIR, GLOBALS) 
     10 
     11allow_module('Products.qSiloGroup.utils') 
    912 
    1013def initialize(context): 
  • qSiloGroup/trunk/skins/qSiloGroup/getSiloData.py

    r740 r861  
    99# 
    1010 
     11from Products.qSiloGroup.utils import getCurrentFolder 
     12 
    1113prop_dict = context.getSiloNavigationDictionary() 
    1214 
     
    1416    return [] 
    1517 
    16 if context.portal_type in ['Folder', 'Large Plone Folder', 'CMFFolder']: CONTEXT = context 
    17 else: CONTEXT = context.aq_parent 
     18CONTEXT = getCurrentFolder(context) 
    1819 
    1920return [prop_dict[item] for item in CONTEXT.objectIds() if item in prop_dict.keys()] 
  • qSiloGroup/trunk/skins/qSiloGroup/getSiloNavigationDictionary.py

    r846 r861  
    1010 
    1111from Products.CMFCore.utils import getToolByName 
     12from Products.qSiloGroup.utils import getCurrentFolder 
    1213 
    13 if context.portal_type in ['Folder', 'Large Plone Folder', 'CMFFolder']: CONTEXT = context 
    14 else: CONTEXT = context.aq_parent 
     14CONTEXT = getCurrentFolder(context) 
    1515 
    16 items = CONTEXT.getProperty('silo_items',None) 
     16items = CONTEXT.getProperty('silo_items', None) 
    1717 
    1818if not items: 
  • qSiloGroup/trunk/skins/qSiloGroup/portlet_navigation.pt

    r846 r861  
    66       i18n:domain="plone" 
    77       tal:omit-tag="" 
    8        tal:define="silo python:test(here.portal_type == 'Folder', here, here.aq_parent); 
    9                    default_page python:silo.getProperty('default_page',None); 
     8       tal:define="utils nocall:modules/Products/qSiloGroup/utils; 
     9                   silo python:utils.getCurrentFolder(context); 
     10                   is_portal python:utils.isPortalOrPortalDefaultPage(context); 
     11                   default_page python:utils.getDefaultPage(silo); 
    1012                   silo_list here/getSiloData"> 
    11 <dl class="portlet" id="portlet-navigation-tree"> 
     13    <dl class="portlet" id="portlet-navigation-tree"> 
    1214    <dt class="portletHeader"> 
    13         <tal:title content="python:test(getattr(silo, 'portal_type', '') == 'Folder', silo.title_or_id(), 'Navigation')" /> 
     15        <tal:title content="python:test(not is_portal, silo.title_or_id(), 'Navigation')" /> 
    1416    </dt> 
    1517 
     
    3234    </dd> 
    3335    <dd class="portletFooter even" 
    34         tal:condition="python:getattr(silo.aq_explicit, 'portal_type','')=='Folder' and not isAnon and checkPermission('Manage Portal', silo)"> 
     36        tal:condition="python:checkPermission('Manage Portal', silo)"> 
    3537        <span> 
    3638            <a tal:attributes="href string:${silo/absolute_url}/folder_contents;"> 
  • qSiloGroup/trunk/skins/qSiloGroup/silo_navigation_edit.cpy

    r731 r861  
    1111 
    1212from Products.CMFCore.utils import getToolByName 
     13from Products.qSiloGroup.utils import isStructuralFolder, getDefaultPage 
    1314 
    1415silo_items = [] 
     
    1920    else: 
    2021        continue 
    21     if item.portal_type in ['Folder', 'Large Plone Folder', 'CMFFolder']
     22    if isStructuralFolder(item)
    2223        ids = {} 
    2324        for i in item.objectIds(): 
    2425                ids[i] = 1 
    25         pages = item.getProperty('default_page', []) 
    26         if isinstance(pages, basestring): 
    27             pages = [pages] 
    28         for page in pages: 
    29             if page and ids.has_key(page): 
    30                 default_page = page 
    31                 break 
     26        page = getDefaultPage(item) 
     27        if page and ids.has_key(page): 
     28            default_page = page 
    3229        if default_page == '': 
    3330            site_properties = getToolByName(context, 'portal_properties').site_properties 
  • qSiloGroup/trunk/skins/qSiloGroup/silositemap_view.pt

    r731 r861  
    88<div metal:fill-slot="main"> 
    99    <tal:main-macro metal:define-macro="main"  
    10            tal:define="silo python:test(here.portal_type == 'Folder', here, here.aq_parent); 
    11                        default_page python:silo.getProperty('default_page',None); 
     10           tal:define="utils nocall:modules/Products/qSiloGroup/utils; 
     11                       silo python:utils.getCurrentFolder(context); 
     12                       default_page python:utils.getDefaultPage(silo); 
    1213                       silo_dict here/getSiloNavigationDictionary; 
    1314                       default_title python:silo_dict.get(default_page, {}).get('title', None); 
    1415                       silo_list here/getSiloData; 
    15                        id here/getId"> 
     16                       id context/getId"> 
    1617        <ul> 
    1718              <li tal:condition="default_page"> 
     
    2728              <li tal:define="item_id item/id; 
    2829                              item_title item/title" 
    29                   tal:condition="python:item_id and (item_id not in [default_page,id]) and item_title"> 
     30                  tal:condition="python:item_id and (item_id not in [default_page, id]) and item_title"> 
    3031                <div> 
    3132                  <a tal:condition="item_title" 
  • qSiloGroup/trunk/version.txt

    r851 r861  
    1 0.2.0 
     10.3.0