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
Line 
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##
10import string
11from Products.CMFCore.utils import getToolByName
12from quintagroup.captcha.core.config import LAYER_DYNAMIC_CAPTCHAS
13from quintagroup.captcha.core.config import LAYER_STATIC_CAPTCHAS
14
15skinsTool = getToolByName(context, 'portal_skins')
16default_skin = skinsTool.getDefaultSkin()
17path = skinsTool.getSkinPath(default_skin)
18path = map( string.strip, string.split( path,',' ) )
19
20if LAYER_STATIC_CAPTCHAS in path:
21    return 'static'
22elif LAYER_DYNAMIC_CAPTCHAS in path:
23    return 'dynamic'
24else:
25    return None
Note: See TracBrowser for help on using the repository browser.