[%- # Imports USE Api2; USE DataURI; USE NVData; USE JSON; # Setup the spinner, include the DATAURI optimization SET spinner_url = '/images/report-spinner.gif'; IF CPANEL.ua_is_ie && CPANEL.ua_is_ie < 8; SET spinner_url = MagicRevision(spinner_url); ""; ELSE; SET spinner_url = DataURI.datauri(spinner_url, 'image/gif'); END; # Fetch the NVDATA for this user SET nvdata = NVData.get_page_nvdata(); # Setup the titles for each type. SET archive_type_titles = { 'incoming' => locale.maketext('Incoming Email Messages'), 'outgoing' => locale.maketext('Outgoing Email Messages'), 'mailman' => locale.maketext('Outgoing Mailing List Email Messages'), }; #This way, undefined/'' values will default to "on". SET show_default_configurator = nvdata.show_default_configurator != 0; -%]

[% locale.maketext('Default Archive Configuration') %]

[% locale.maketext('Used by new domains created on this account via the web interfaces or the domain APIs.') %]
[% # Retreive the complete list of domains SET all_domains = Api2.exec( 'Email', 'listmaildomains', {}); -%] [% # Retreive the default configuration and the list of archive types SET default_config = Api2.exec( 'Email', 'get_archiving_default_configuration', {}); SET archive_types_list = Api2.exec( 'Email', 'get_archiving_types', {} ); IF archive_types_list.size; FOR archive_type = archive_types_list; SET archive_types = archive_type -%] [% FOREACH archive_type IN archive_types.pairs; # Find the current configuration in the list SET current_config = {}; IF default_config.size; FOR config = default_config; IF config.direction == archive_type.key; SET current_config = config; END; END; END; SET archive_type_key = archive_type.key; SET archive_type_name = archive_type.value; SET archive_type_title = archive_type_titles.$archive_type_key; SET archive_type_enabled = current_config.enabled; SET archive_type_retention = current_config.retention_period; SET archive_type_dom_key = "archive_" _ archive_type.key; SET archive_type_dom_key_retain_days = "archive_" _ archive_type.key _ "_retain_days"; SET added_progress = 0 -%]
[% SET retention_control_enabled = archive_type_enabled -%] [% SET retention_control_key = "archive_" _ archive_type_key _ "_retain_days_GLOBAL" -%] [% SET retention_control_value = archive_type_retention -%] [% PROCESS mail/retention_control.html.tt -%] [% IF added_progress == 0%] [% SET added_progress = 1 %]
[% END %]
[%- END -%]
[% END; ELSE -%] [% locale.maketext('Unable to retrieve the data from the server!') %] [% END -%]