Changeset 3563 in products
- Timestamp:
- Sep 24, 2012 11:24:32 AM (12 years ago)
- Location:
- quintagroup.plonetabs/trunk/quintagroup/plonetabs
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py
r3437 r3563 7 7 from zope.interface import implements 8 8 from zope.component import getMultiAdapter 9 from zope.app.container.interfaces import INameChooser 9 10 # BBB: compatibility with older plone versions 11 try: 12 # Plone < 4.3 13 from zope.app.container import interfaces 14 INameChooser = interfaces.INameChooser 15 except ImportError: 16 # Plone >= 4.3 17 from zope.container.interfaces import INameChooser 18 10 19 from zope.viewlet.interfaces import IViewletManager, IViewlet 11 20 … … 25 34 26 35 from quintagroup.plonetabs.config import PROPERTY_SHEET, FIELD_NAME 36 from quintagroup.plonetabs.utils import setupViewletByName 27 37 from quintagroup.plonetabs import messageFactory as _ 28 38 from interfaces import IPloneTabsControlPanel … … 444 454 def selected_portal_tab(self): 445 455 """See global-sections viewlet""" 446 selectedTabs = self.context.restrictedTraverse('selectedTabs') 447 selected_tabs = selectedTabs('index_html', self.context, 448 self.portal_tabs()) 456 # BBB: compatibility with older plone versions. 457 # ``selectedTabs`` Python script was merged into the 458 # GlobalSectionsViewlet. 459 section_viewlet = setupViewletByName(self, 460 self.context, 461 self.request, 462 'plone.global_sections') 463 if section_viewlet: 464 # Plone >= 4.3 465 selected_tabs = section_viewlet.selectedTabs( 466 default_tab='index_html', 467 portal_tabs=self.portal_tabs()) 468 else: 469 # Plone < 4.3 470 selectedTabs = self.context.restrictedTraverse('selectedTabs') 471 selected_tabs = selectedTabs('index_html', self.context, 472 self.portal_tabs()) 449 473 450 474 return selected_tabs['portal'] -
quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_erase.py
r3437 r3563 6 6 from Testing import ZopeTestCase as ztc 7 7 8 from zope.app.component.hooks import setHooks, setSite 8 # BBB: compatibility with older plone versions 9 try: 10 # Plone < 4.3 11 from zope.app.component import hooks 12 setSite = hooks.setSite 13 setHooks = hooks.setHooks 14 except ImportError: 15 # Plone >= 4.3 16 from zope.component.hooks import setSite, setHooks 9 17 10 18 from plone.browserlayer.utils import registered_layers
Note: See TracChangeset
for help on using the changeset viewer.