'Main entry point, configuration'

def __call__(self):

    T = current.T
    auth = current.auth
    if (not auth.s3_logged_in()):
        auth.permission.fail()
    has_role = auth.s3_has_role
    resources = [dict(resource='cap_alert', url='cap/alert', label=T('Updates'))]
    filters = [S3OptionsFilter('event_type_id', label=T('Event    Type'), options=self._options('event_type_id'), widget='multiselect', multiple=False, resource='cap_info', _name='event-filter'), S3OptionsFilter('priority', label=T('Priority'), options=self._options('priority'), widget='multiselect', resource='cap_info', _name='priority-filter')]
    cap_languages = current.deployment_settings.get_cap_languages()
    if (len(cap_languages) > 1):
        language_filters = S3OptionsFilter('language', label=T('Language'), options=cap_languages, represent='%(name)s', resource='cap_info', _name='language-filter')
        filters.append(language_filters)
    if ((current.request.get_vars['option'] == 'manage_recipient') and has_role('ADMIN')):
        from s3 import S3Represent
        recipient_filters = [S3OptionsFilter('id', label=T('People'), represent=S3Represent(lookup='auth_user', fields=['first_name', 'last_name'], field_sep='    '), widget='multiselect', resource='auth_user', _name='person-filter')]
        group_filters = [S3OptionsFilter('id', label=T('Groups'), represent=S3Represent(lookup='pr_group', fields=['name']), widget='multiselect', resource='pr_group', _name='group-filter')]
        title = T('Manage    Recipients')
    else:
        recipient_filters = None
        group_filters = None
        title = T('Subscriptions')
    filter_script = "$.filterOptionsS3({\n                                                                                                                    'trigger':'event-filter',\n                                                                                                                    'target':'priority-filter',\n                                                                                                                    'lookupPrefix':    'cap',\n                                                                                                                    'lookupResource':    'warning_priority',\n                                                                                                                    'lookupKey':    'event_type_id',\n                                                                                                                    'showEmptyField':    'false'\n                                                                                                                    })"
    current.response.s3.jquery_ready.append(filter_script)
    self._view(THEME, 'subscriptions.html')
    form = self._manage_subscriptions(resources, filters, recipient_filters, group_filters)
    return dict(title=title, form=form)
