[%- # Imports USE Api2; USE DataURI; USE JSON; USE VarCache; USE Encoder; USE CPScalar; # 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; # 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'), }; %] [% PROCESS '_assets/_ajaxapp.html.tt' -%] [% SET api_response = Api2.exec( 'Email', 'get_archiving_configuration', { regex => form_regex, no_expvar => 1, api2_paginate => 1, api2_paginate_start => CPANEL.FORM.api2_paginate_start, api2_paginate_size => CPANEL.CPVAR.itemsperpage, api2_sort => 1, api2_sort_column => CPANEL.FORM.api2_sort_column || 'domain', api2_sort_reverse => CPANEL.FORM.api2_sort_reverse == '1', # Reverse is descending. }); -%] [% IF api_response.size -%] [% FOR dom = api_response -%] [% SET oddeven = loop.index % 2 ? 'odd' : 'even' -%] [%- SET archive_active = 0; FOR archive_type IN archive_types; SET archive_key = "archive_" _ archive_type.key; IF dom.$archive_key; SET archive_active = 1; LAST; END; END; %]