Changeset 658
- Timestamp:
- 11/27/06 07:11:27
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneCaptchas/trunk/Extensions/Install.py
r657 r658 20 20 safeEditProperty(self, 'captcha_key', generateKey(8)) 21 21 22 # add Property sheet to portal_properies23 pp = getToolByName(self, 'portal_properties')24 if not 'qPloneCaptchas' in pp.objectIds():25 pp.addPropertySheet(id='qPloneCaptchas', title= '%s Properties' % 'qPloneCaptchas')26 out.write("Adding %s property sheet to portal_properies\n" % 'qPloneComments' )27 props_sheet = pp['qPloneCaptchas']28 updateProperties(props_sheet, out, PROPERTIES)29 30 22 Layers = [] 31 23 Layers += LAYERS 32 33 if pp.qPloneCaptchas.getProperty('static_captchas', False) and havePIL: 34 Layers.append(LAYER_DYNAMIC_CAPTCHAS) 35 else: 36 Layers.append(LAYER_STATIC_CAPTCHAS) 24 Layers.append(LAYER_DYNAMIC_CAPTCHAS) 37 25 38 26 mtool = getToolByName(self, 'portal_migration') … … 101 89 controlpanel_tool = getToolByName(self, 'portal_controlpanel') 102 90 controlpanel_tool.unregisterConfiglet(CONFIGLET_ID) 103 # Remove Product's property sheet from portal_properties104 pp = getToolByName(self, 'portal_properties')105 if 'qPloneCaptchas' in pp.objectIds():106 pp.manage_delObjects(ids=['qPloneCaptchas',])107 108 91 109 92 def updateProperties(pp_ps, out, *args): qPloneCaptchas/trunk/skins/plone_captchas/prefs_captchas_setup.cpy
r657 r658 26 26 27 27 form = context.REQUEST.form 28 sc= form['static_captchas']29 if sc == 'True':28 ct = form['static_captchas'] 29 if ct == 'static': 30 30 exchangeLayers('plone_captchas/dynamic', 'plone_captchas/static') 31 31 layer = 'static' qPloneCaptchas/trunk/skins/plone_captchas/prefs_captchas_setup_form.cpt
r657 r658 36 36 <fieldset> 37 37 <legend i18n:translate="legend_setup_options">qPloneCaptchas setup options</legend> 38 <div tal:define=" sc here/portal_properties/qPloneCaptchas/static_captchas;">38 <div tal:define="ct here/getCaptchaType;"> 39 39 <input name="static_captchas" 40 40 id="use_static_captchas" 41 41 type="radio" 42 tal:attributes="value sc;43 checked python:test( sc, 'checked', '')"/>42 tal:attributes="value ct; 43 checked python:test(ct=='static', 'checked', '')"/> 44 44 <label for="use_static_captchas">Use static captchas</label> 45 45 <br /> … … 48 48 type="radio" 49 49 disabled="" 50 tal:attributes="value python:not sc;51 checked python:test( not sc, 'checked', '');50 tal:attributes="value ct; 51 checked python:test(ct=='dynamic', 'checked', ''); 52 52 disabled python:test(context.checkPIL(), '', 'disabled');"/> 53 53 <label for="use_dynamic_captchas">Use dynamic captchas</label>
