[dev] [PATCH] PGP and S/MIME options page minor fix

Sergei Turchanov sergei.turchanov at vvsu.ru
Thu May 12 20:24:38 PDT 2005


Hello,

with this patch "Save options" button is placed at the bottom of
configuration page alongside with the "Return to Main Preferences Screen"
button to make it consistent with looks of other option pages.

Second fix: do not show "Save options" button if prefs->isLocked is true
since no modifications are possible.

-- 
With best regards,
Sergei Turchanov.




-------------- next part --------------
Index: horde2/imp/templates/pgp/notactive.inc
===================================================================
RCS file: /repository/imp/templates/pgp/notactive.inc,v
retrieving revision 1.18
diff -u -r1.18 notactive.inc
--- horde2/imp/templates/pgp/notactive.inc	15 Apr 2005 12:57:21 -0000	1.18
+++ horde2/imp/templates/pgp/notactive.inc	13 May 2005 03:10:35 -0000
@@ -1,17 +1,17 @@
-<?php if ($prefs->isLocked('use_pgp')): ?>
+<?php
+  $use_pgp_locked = $prefs->isLocked('use_pgp');
+  if ($use_pgp_locked): ?>
 <strong><?php echo _("PGP support is disabled on this system.") ?></strong>
 <?php else: ?>
 <input type="checkbox" id="use_pgp" name="use_pgp"<?php echo ($prefs->getValue('use_pgp')) ? ' checked="checked"' : '' ?> /> <?php echo Horde::label('use_pgp', _("Enable PGP functionality?")) ?></label>&nbsp;<?php echo Help::link('imp', 'pgp-overview') ?><br />
 </div>
+<?php endif; ?>
 
 <br class="spacer" />
 <div class="nowrap">
+<?php if (!$use_pgp_locked): ?>
   <input type="submit" name="save" class="button" onclick="document.prefs.actionID.value='pgp_enable'; return true;" value="<?php echo _("Save Options") ?>" />
-</div>
 <?php endif; ?>
-
-<br class="spacer" />
-<div class="nowrap">
   <input type="button" name="back" class="button" onclick="document.location.href='<?php echo IMP::prefsURL(true) ?>'" value="<?php echo _("Return to Main Preferences Screen") ?>" />
 </div>
 
Index: horde2/imp/templates/pgp/pgp.inc
===================================================================
RCS file: /repository/imp/templates/pgp/pgp.inc,v
retrieving revision 1.39
diff -u -r1.39 pgp.inc
--- horde2/imp/templates/pgp/pgp.inc	11 May 2005 11:08:26 -0000	1.39
+++ horde2/imp/templates/pgp/pgp.inc	13 May 2005 03:10:35 -0000
@@ -9,11 +9,6 @@
 </div>
 
 <br class="spacer" />
-<div class="nowrap">
-  <input type="submit" name="save" class="button" onclick="document.prefs.actionID.value='save_options';return true;" value="<?php echo _("Save Options") ?>" />
-</div>
-
-<br class="spacer" />
 <div class="header">
   <ul><li><?php echo Help::link('imp', 'pgp-manage-pubkey') ?></li></ul>
   <?php echo _("PGP Public Keyring") ?>
@@ -150,6 +145,7 @@
 
 <br class="spacer" />
 <div class="nowrap">
+  <input type="submit" name="save" class="button" onclick="document.prefs.actionID.value='save_options';return true;" value="<?php echo _("Save Options") ?>" />
   <input type="button" name="back" class="button" onclick="document.location.href='<?php echo IMP::prefsURL(true) ?>'" value="<?php echo _("Return to Main Preferences Screen") ?>" />
 </div>
 
Index: horde2/imp/templates/smime/notactive.inc
===================================================================
RCS file: /repository/imp/templates/smime/notactive.inc,v
retrieving revision 1.15
diff -u -r1.15 notactive.inc
--- horde2/imp/templates/smime/notactive.inc	15 Apr 2005 15:14:37 -0000	1.15
+++ horde2/imp/templates/smime/notactive.inc	13 May 2005 03:10:35 -0000
@@ -1,4 +1,6 @@
-<?php if ($prefs->isLocked('use_smime')): ?>
+<?php
+  $use_smime_locked = $prefs->isLocked('use_smime');
+  if ($use_smime_locked): ?>
 <strong><?php echo _("S/MIME support is disabled on this system.") ?></strong>
 <?php else: ?>
 <input id="use_smime" type="checkbox" name="use_smime"<?php echo ($prefs->getValue('use_smime')) ? ' checked="checked"' : '' ?> /> <?php echo Horde::label('use_smime', _("Enable S/MIME functionality?")) ?>&nbsp;<?php echo Help::link('imp', 'smime-overview') ?><br />
@@ -6,7 +8,9 @@
 
 <br class="spacer" />
 <div class="nowrap">
+<?php if (!$use_smime_locked): ?>
   <input type="submit" name="save" class="button" onclick="document.prefs.actionID.value='save_options'; return true;" value="<?php echo _("Save Options") ?>" />&nbsp;
+<?php endif; ?>
   <input type="button" name="back" class="button" onclick="document.location.href='<?php echo IMP::prefsURL(true) ?>'" value="<?php echo _("Return to Options") ?>" />
 </div>
 </form>


More information about the dev mailing list