[% USE Uapi; USE JSON; SET CPANEL.CPVAR.dprefix = "../../"; SET user = CPANEL.FORM.user; SET is_me = !user; SET config = Uapi.exec('DAV', 'get_calendar_contacts_config', { user => user }); SET cpdavd_enabled = ExpVar.expand('$hascpdavd') ? 1 : 0; SET user = config.data.user; SET title = (is_me ? locale.maketext('Calendars and Contacts Configuration') : locale.maketext('Calendars and Contacts Configuration for: [_1]', user)); SET has_feature = CPANEL.feature('caldavcarddav'); %] [% WRAPPER '_assets/master.html.tt' app_key = 'calendar_and_contacts' page_title = title include_legacy_stylesheets = 0 include_legacy_scripts = 1 include_cjt = 1 use_master_bootstrap = 0 page_stylesheets = [ 'mail/calendars_and_contacts/index.css' ] -%]
[% IF !has_feature %]
[% locale.maketext('Error:') %] [% locale.maketext('You do not have access to this feature!') %]
[% ELSIF !cpdavd_enabled %]
[% locale.maketext('Error:') %] [% locale.maketext('Your server administrator must enable the [asis,cpdavd] service to use this feature.') %]
[% END %] [% IF !config.status %]
[% locale.maketext('Error:') %] [% config.errors_as_string() FILTER html %]
[% ELSE %]
[% END %]
[% IF has_feature; # No point in loading the other assets if this is dead in the water %] [% PROCESS '_assets/cjt2_header_include.tt' %] [% END %] [% END #wrapper -%]