Don't display HTML image options if HTML inline viewing is disabled
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 9 Jul 2010 05:29:28 +0000 (23:29 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 9 Jul 2010 05:47:51 +0000 (23:47 -0600)
imp/lib/Prefs/Ui.php

index dcb9f39..97830aa 100644 (file)
@@ -260,6 +260,15 @@ class IMP_Prefs_Ui
             if (empty($conf['maillog']['use_maillog'])) {
                 $ui->suppress[] = 'disposition_send_mdn';
             }
+
+            $mock_part = new Horde_Mime_Part();
+            $mock_part->setType('text/html');
+            $v = Horde_Mime_Viewer::factory($mock_part);
+
+            if (!$v->canRender('inline')) {
+                $ui->suppress[] = 'html_image_replacement';
+                $ui->suppress[] = 'html_image_addrbook';
+            }
             break;
         }