Changeset 2657 in products for quintagroup.dropdownmenu


Ignore:
Timestamp:
Jul 9, 2010 2:49:17 PM (10 years ago)
Author:
fenix
Message:

fixed "show icons" functionality for plone4

Location:
quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt

    r1197 r2657  
    11<tal:master define="level options/level|python:0; 
    2                     children options/children | nothing" 
     2                    children options/children | nothing; 
     3                    plonefour view/is_plone_four" 
    34            i18n:domain="plone"> 
    45 
     
    1516                li_extr_class   python:(is_in_path and not is_current) and li_extr_class + ' selected' or li_extr_class; 
    1617                li_extr_class   python:(not (is_in_path or is_current)) and li_extr_class + ' plain' or li_extr_class; 
    17                 li_folder_class python:show_children and ' globalSectionsFolderish' or '';" 
     18                li_folder_class python:show_children and ' globalSectionsFolderish' or ''; 
     19                item_type       node/normalized_portal_type | nothing" 
    1820    tal:attributes="class string:globalSectionsItem visualNoMarker${li_class}${li_extr_class}${li_folder_class}"> 
    1921 
    20     <tal:level define="item_class string:state-${node/normalized_review_state}"> 
     22    <tal:level define="show_icons view/conf/show_icons; 
     23                       item_class string:state-${node/normalized_review_state}"> 
     24 
    2125    <a tal:attributes="href python:item_url; 
    2226                       title node/Description; 
    2327                       class string:$item_class${li_class}${li_extr_class}${li_folder_class}"> 
    24         <img tal:condition="view/conf/show_icons" 
    25              tal:replace="structure item_icon/html_tag" /> 
    26         <span tal:content="node/Title">Selected Item Title</span> 
     28        <img tal:condition="python: show_icons and not plonefour" 
     29             tal:replace="structure item_icon/html_tag | nothing" /> 
     30        <span tal:content="node/Title" 
     31              tal:attributes="class python: plonefour and show_icons and item_type and 'contenttype-'+ item_type or nothing">Selected Item Title</span> 
    2732    </a> 
    2833 
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py

    r2272 r2657  
    88from Products.CMFCore.interfaces import IAction, IActionCategory 
    99from Products.CMFCore.ActionInformation import ActionInfo 
     10from Products.CMFPlone.utils import versionTupleFromString 
    1011 
    1112from plone.memoize.instance import memoize 
     
    181182                                          self.portal_tabs) 
    182183        self.selected_portal_tab = self.selected_tabs['portal'] 
     184 
     185    @property 
     186    def is_plone_four(self): 
     187        """Indicates if we are in plone 4. 
     188         
     189        """ 
     190        pm = getToolByName(aq_inner(self.context), 'portal_migration')  
     191        version = versionTupleFromString(pm.getSoftwareVersion()) 
     192        if version: 
     193            return version[0] == 4 
     194 
Note: See TracChangeset for help on using the changeset viewer.