def __call__(self):

        T = current.T

        # Must be logged in
        auth = current.auth
        if not auth.s3_logged_in():
            auth.permission.fail()

        has_role = auth.s3_has_role
        # Available resources
        resources = [dict(resource="cap_alert",
                          url="cap/alert",
                          label=T("Updates")),
                     ]

        # Filter widgets
        # @note: subscription manager has no resource context, so
        #        must configure fixed options or lookup resources
        #        for filter widgets which need it.
        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",
                                   ),
                   #S3LocationFilter("location_id",
                   #                 label = T("Location(s)"),
                   #                 resource = "cap_area_location",
                   #                 options = self._options("location_id"),
                   #                 _name = "location-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("ALERT_EDITOR") or has_role("ALERT_APPROVER")):          
            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
            title = T("Manage Recipients")
        else:
            recipient_filters = None
            group_filters = None
            # Title
            title = T("Subscriptions")

        filter_script = '''$.filterOptionsS3({
                             'trigger':'event-filter',
                             'target':'priority-filter',
                             'lookupPrefix': 'cap',
                             'lookupResource': 'warning_priority',
                             'lookupKey': 'event_type_id',
                             'showEmptyField': 'false'
                             })'''
        current.response.s3.jquery_ready.append(filter_script)

        # View
        self._view(THEME, "subscriptions.html")

        # Form
        form = self._manage_subscriptions(resources, filters, recipient_filters, group_filters)

        return dict(title = title,
                    form = form,
                    )

    # -------------------------------------------------------------------------
MenuItem constructor
dataset/ETHPy150Open sahana/eden/modules/templates/SAMBRO/controllers.py/subscriptions.__call__--crossover with--dataset/ETHPy150Open borgstrom/django-simple-menu/menu/menu.py/MenuItem.__init__