Changeset 142


Ignore:
Timestamp:
05/05/09 16:45:11 (6 years ago)
Author:
david
Message:

adding additional control panel for alt themes that match 1:1 to default base_properties

Location:
enpraxis.leftskin/trunk/enpraxis/leftskin
Files:
52 added
6 edited

Legend:

Unmodified
Added
Removed
  • enpraxis.leftskin/trunk/enpraxis/leftskin/browser/configure.zcml

    r12 r142  
    5050     /> 
    5151 
     52  <utility 
     53     provides="zope.schema.interfaces.IVocabularyFactory" 
     54     component=".controlpaneladv.fontfamilies_vocab" 
     55     name="leftskin.fontfamilies_vocab" 
     56     /> 
     57 
     58  <utility 
     59     provides="zope.schema.interfaces.IVocabularyFactory" 
     60     component=".controlpaneladv.borderstyles_vocab" 
     61     name="leftskin.borderstyles_vocab" 
     62     /> 
     63 
     64  <utility 
     65     provides="zope.schema.interfaces.IVocabularyFactory" 
     66     component=".controlpaneladv.transforms_vocab" 
     67     name="leftskin.transforms_vocab" 
     68     /> 
     69 
     70 
     71 
     72  <adapter factory=".controlpaneladv.BasePropertiesControlPanelAdapter" /> 
     73 
     74  <browser:page 
     75     name="baseproperties-controlpanel" 
     76     for="Products.CMFPlone.interfaces.IPloneSiteRoot" 
     77     class=".controlpaneladv.BasePropertiesControlPanel" 
     78     permission="cmf.ManagePortal" 
     79     /> 
     80 
    5281</configure> 
  • enpraxis.leftskin/trunk/enpraxis/leftskin/browser/controlpanel.py

    r73 r142  
    182182        # fails for some reason, until then just access it directly 
    183183        self.skins = context.portal_skins.custom 
     184        # check if exists; if not, find cur theme and customize it 
    184185        self.props = context.portal_skins.custom.base_properties 
    185186        self.css = context.portal_css 
     
    392393        stool.leftskin.base_properties.manage_doCustomize(folder_path='custom') 
    393394         
     395    def customizeBaseProperties(self): 
     396        """ Ensure a copy of the current theme's base_properties exists in the custom folder  """ 
     397        self.custom = self.context.portal_skins.custom.aq_inner.aq_explicit 
     398 
     399        if not hasattr(self.custom, 'base_properties'): 
     400            base_props = self.context.base_properties 
     401            base_props.manage_doCustomize(folder_path='custom') 
     402 
    394403 
    395404generalset = FormFieldsets(ILeftSkinGeneralSchema) 
     
    438447    @form.action(PloneMessageFactory(u'label_save', default=u'Save'), name=u'save') 
    439448    def handle_edit_action(self, action, data): 
     449        if self.adapters.has_key('ILeftSkinGeneralSchema'): 
     450            self.adapters['ILeftSkinGeneralSchema'].customizeBaseProperties() 
     451 
    440452        if form.applyChanges(self.context, self.form_fields, data, 
    441453                             self.adapters): 
  • enpraxis.leftskin/trunk/enpraxis/leftskin/profiles/default/actionicons.xml

    r12 r142  
    22<action-icons xmlns:i18n="http://xml.zope.org/namespaces/i18n" 
    33              i18n:domain="leftskin"> 
    4  <action-icon category="controlpanel" 
    5               action_id="LeftSkin" 
    6               title="Left Skin" 
    7               priority="0" icon_expr="skin.gif" 
    8               i18n:attributes="title"/> 
     4  <action-icon category="controlpanel" 
     5               action_id="LeftSkin_basic" 
     6               title="Left Skin" 
     7               priority="0" icon_expr="skin.gif" 
     8               i18n:attributes="title"/> 
     9  <action-icon category="controlpanel" 
     10               action_id="LeftSkin_adv" 
     11               title="Left Skin" 
     12               priority="0" icon_expr="skin.gif" 
     13               i18n:attributes="title"/> 
     14 
    915</action-icons> 
  • enpraxis.leftskin/trunk/enpraxis/leftskin/profiles/default/controlpanel.xml

    r12 r142  
    11<?xml version="1.0"?> 
    22<object name="portal_controlpanel" meta_type="Plone Control Panel Tool"> 
    3   <configlet title="Left Skin" 
    4              action_id="LeftSkin" 
     3  <configlet title="Left Skin CSS Helper" 
     4             action_id="LeftSkin_basic" 
    55             appId="LeftSkin" 
    66             category="Products" 
    7              conditional_expression="" 
     7             condition_expr="python:here.portal_skins.getDefaultSkin() == 'Left Skin'" 
    88             url_expr="string:${portal_url}/@@leftskin-controlpanel" 
    99             visible="True"> 
    1010    <permission>Manage portal</permission> 
    1111  </configlet> 
     12 
     13  <configlet title="CSS Helper" 
     14             action_id="LeftSkin_adv" 
     15             appId="LeftSkin" 
     16             category="Products" 
     17             condition_expr="python:here.portal_skins.getDefaultSkin() != 'Left Skin'" 
     18             url_expr="string:${portal_url}/@@baseproperties-controlpanel" 
     19             visible="True"> 
     20    <permission>Manage portal</permission> 
     21  </configlet> 
    1222</object> 
  • enpraxis.leftskin/trunk/enpraxis/leftskin/profiles/default/cssregistry.xml

    r12 r142  
    1010              expression="python:portal.restrictedTraverse('@@plone_portal_state').is_rtl()" 
    1111              rendering="import"/> 
     12 
     13  <stylesheet title="" cacheable="True" compression="safe" cookable="True" 
     14              enabled="1" id="css/colorpicker.css"  
     15              media="screen" rel="stylesheet" 
     16              rendering="import"/> 
     17 
     18  <stylesheet title="" cacheable="True" compression="safe" cookable="True" 
     19              enabled="1" id="css/layout.css"  
     20              media="screen" rel="stylesheet" 
     21              rendering="import"/> 
    1222</object> 
  • enpraxis.leftskin/trunk/enpraxis/leftskin/profiles/default/skins.xml

    r12 r142  
    66  <layer name="leftskin" insert-before="LanguageTool"/> 
    77 </skin-path> 
     8 
     9 <object name="colorpicker" meta_type="Filesystem Directory View" 
     10    directory="enpraxis.leftskin:skins/colorpicker"/> 
     11 <skin-path name="*" based-on="Plone Default"> 
     12  <layer name="colorpicker" insert-after="custom"/> 
     13 </skin-path> 
    814</object> 
Note: See TracChangeset for help on using the changeset viewer.