source: products/quintagroup.captcha.core/trunk/quintagroup/captcha/core/skins/captcha_core/getCaptchaType.py @ 2542

Last change on this file since 2542 was 1955, checked in by mylan, 14 years ago

#172: Fix 'plone_captchas' references to 'captcha_core'

File size: 716 bytes
RevLine 
[797]1## Script (Python) "getCaptchaType"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=actions=None
8##title=
9##
[1955]10import string
[797]11from Products.CMFCore.utils import getToolByName
[1955]12from quintagroup.captcha.core.config import LAYER_DYNAMIC_CAPTCHAS
13from quintagroup.captcha.core.config import LAYER_STATIC_CAPTCHAS
14
[797]15skinsTool = getToolByName(context, 'portal_skins')
16default_skin = skinsTool.getDefaultSkin()
17path = skinsTool.getSkinPath(default_skin)
18path = map( string.strip, string.split( path,',' ) )
19
[1955]20if LAYER_STATIC_CAPTCHAS in path:
[797]21    return 'static'
[1955]22elif LAYER_DYNAMIC_CAPTCHAS in path:
[797]23    return 'dynamic'
24else:
[1955]25    return None
Note: See TracBrowser for help on using the repository browser.