예제 #1
0
파일: z2.py 프로젝트: vedantc98/Plone-test
def switch_on(view, request_layer=z3c.form.interfaces.IFormLayer):
    """Fix up the request and apply the given layer. This is mainly useful
    in Zope < 2.10 when using a wrapper layout view.
    """

    request = view.request

    if (not IFixedUpRequest.providedBy(request)
            and not IBrowserApplicationRequest.providedBy(request)):
        interface.alsoProvides(request, IFixedUpRequest)
        interface.alsoProvides(request, request_layer)
예제 #2
0
파일: z2.py 프로젝트: CGTIC/Plone_SP
def switch_on(view, request_layer=z3c.form.interfaces.IFormLayer):
    """Fix up the request and apply the given layer. This is mainly useful
    in Zope < 2.10 when using a wrapper layout view.
    """

    request = view.request

    if (not IFixedUpRequest.providedBy(request) and
        not IBrowserApplicationRequest.providedBy(request)
    ):

        interface.alsoProvides(request, IFixedUpRequest)
        interface.alsoProvides(request, request_layer)
예제 #3
0
def switch_on(view, request_layer=z3c.form.interfaces.IFormLayer):
    """Fix up the request and apply the given layer. This is mainly useful
    in Zope < 2.10 when using a wrapper layout view.
    """

    request = view.request

    if (not IFixedUpRequest.providedBy(request) and
        not IBrowserApplicationRequest.providedBy(request)
    ):

        interface.alsoProvides(request, IFixedUpRequest)
        interface.alsoProvides(request, request_layer)

        if getattr(request, 'locale', None) is None:
            request.locale = setup_locale(request)

        if not hasattr(request, 'getURL'):
            add_getURL(request)