def zsettings(request):
    try:
        reg = SiteRegistration.objects.get(site=Site.objects.get_current())
        allow_registration = reg.allow_registration
    except:
        allow_registration = False

    media_plugin_url = settings.MEDIA_PLUGIN_URL

    if request.user.is_anonymous():
        usergroups = []
        calendar = None
    else:
        usergroups = [str(g.pk)
                      for g in request.user.get_profile().groups.all()]
        calendar = get_personal_calendar(request.user)

    return {'CKEDITOR_MEDIA_PREFIX': settings.CKEDITOR_MEDIA_PREFIX,
            'ZORNA_SKIN': settings.ZORNA_SKIN,
            'ZORNA_REGISTRATION': allow_registration,
            'MEDIA_PLUGIN_URL': media_plugin_url,
            'ZORNA_USER_GROUPS': usergroups,
            'ZORNA_USER_CALENDAR': calendar,
            }
Adds zorna context variables to the context.
dataset/ETHPy150Open zorna/zorna/zorna/context_processors.py/zsettings