'label' => _("Minimalist View Options"),
'desc' => _("Configure options for the minimalist view."),
'members' => array('mimp_preview_msg', 'mimp_max_from_chars',
- 'mimp_max_subj_chars')
+ 'mimp_max_subj_chars', 'mimp_download_confirm')
);
$prefGroups['standard'] = array(
'desc' => _("In the mailbox view, how many characters of Subject: lines should we show before truncating?")
);
+$_prefs['mimp_download_confirm'] = array(
+ 'value' => 0,
+ 'locked' => true,
+ 'shared' => false,
+ 'type' => 'number',
+ 'desc' => _("Only show download confirmation page if message part is greater than this size, in bytes. Set to 0 to always require the confirmation page.")
+);
+
// End Minimalist View Options
// Standard View Options
}
foreach ($atc_parts as $key) {
- $summary = $imp_contents->getSummary($key, IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS | IMP_Contents::SUMMARY_DOWNLOAD_NOJS);
+ $summary = $imp_contents->getSummary($key, IMP_Contents::SUMMARY_BYTES | IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS | IMP_Contents::SUMMARY_DOWNLOAD_NOJS);
$hb->add(new Horde_Mobile_text(_("Attachment") . ': ', array('b')));
if (empty($summary['download'])) {
$hb->add(new Horde_Mobile_text($summary['description']));
} else {
- $hb->add(new Horde_Mobile_link($summary['description'], Horde_Util::addParameter($self_link, array('a' => 'c', 'atc' => $key))));
+ /* Preference: if set, only show download confirmation screen if
+ * attachment over a certain size. */
+ $download_link = ($summary['bytes'] > $prefs->getValue('mimp_download_confirm'))
+ ? Horde_Util::addParameter($self_link, array('a' => 'c', 'atc' => $key))
+ : $summary['download'];
+
+ $hb->add(new Horde_Mobile_link($summary['description'], $download_link);
}
$t = &$hb->add(new Horde_Mobile_text(sprintf(' [%s] %s', $summary['type'], $summary['size']) . "\n"));
$t->set('linebreaks', true);