Use CSS images for dimpaction buttons
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 18 Feb 2009 07:37:47 +0000 (00:37 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 18 Feb 2009 07:37:47 +0000 (00:37 -0700)
imp/lib/DIMP.php
imp/templates/chunks/compose.php
imp/templates/chunks/message.php
imp/templates/index/index-dimp.inc
imp/themes/screen-dimp.css
imp/themes/silver/screen-dimp.css

index 54a4d87..869e91d 100644 (file)
@@ -19,7 +19,7 @@ class DIMP
      * <pre>
      * 'app' - The application to load the icon from.
      * 'class' - The CSS classname to use for the link.
-     * 'icon' - The icon filename to display.
+     * 'icon' - The icon CSS classname.
      * 'id' - The DOM ID of the link.
      * 'title' - The title string.
      * 'tooltip' - Tooltip text to use.
@@ -50,9 +50,8 @@ class DIMP
                            empty($params['id']) ? array() : array('id' => $params['id']),
                            !empty($title))
             . (!empty($params['icon'])
-               ? IMP::img($params['icon'], $title, '',
-                          $GLOBALS['registry']->getImageDir(empty($params['app']) ? 'imp' : $params['app']))
-               : '')
+                  ? '<span class="iconImg dimpaction' . $params['icon'] . '"></span>'
+                  : '')
             . $title . '</a>';
     }
 
index 0eb0a5c..2d9f739 100644 (file)
@@ -44,15 +44,25 @@ function _createDAcompose($text, $image, $id)
 <input type="hidden" id="composeCache" name="composeCache" value="<?php echo $composeCache ?>" />
 
 <div class="dimpActions dimpActionsCompose">
- <?php _createDAcompose(_("Send"), 'forward_menu.png', 'send_button') ?>
+ <span>
+  <?php _createDAcompose(_("Send"), 'Forward', 'send_button') ?>
+ </span>
 <?php if ($GLOBALS['conf']['compose']['allow_receipts'] && $d_read != 'never'): ?>
- <label><input type="checkbox" class="checkbox" name="request_read_receipt"<?php if ($d_read != 'ask') echo ' checked="checked"' ?> /> <?php echo _("Read Receipt") ?></label>
+ <span>
+  <label><input type="checkbox" class="checkbox" name="request_read_receipt"<?php if ($d_read != 'ask') echo ' checked="checked"' ?> /> <?php echo _("Read Receipt") ?></label>
+ </span>
 <?php endif; ?>
 <?php if ($GLOBALS['conf']['user']['allow_folders'] && !$GLOBALS['prefs']->isLocked('save_sent_mail')): ?>
-  <label><input type="checkbox" class="checkbox" id="save_sent_mail" name="save_sent_mail"<?php if ($identity->saveSentmail()) echo ' checked="checked"' ?> /> <?php echo _("Save in ") ?><span id="sent_mail_folder_label"><?php echo $sent_mail_folder ?></span></label>
+  <span>
+   <label><input type="checkbox" class="checkbox" id="save_sent_mail" name="save_sent_mail"<?php if ($identity->saveSentmail()) echo ' checked="checked"' ?> /> <?php echo _("Save in ") ?><span id="sent_mail_folder_label"><?php echo $sent_mail_folder ?></span></label>
+  </span>
 <?php endif; ?>
- <?php _createDAcompose(_("Check Spelling"), 'spellcheck_menu.png', 'spellcheck') ?>
- <?php _createDAcompose(_("Save as Draft"), 'drafts_menu.png', 'draft_button') ?>
+ <span>
+  <?php _createDAcompose(_("Check Spelling"), 'Spellcheck', 'spellcheck') ?>
+ </span>
+ <span>
+  <?php _createDAcompose(_("Save as Draft"), 'Drafts', 'draft_button') ?>
+ </span>
 </div>
 
 <div id="writemsg" class="noprint">
index 52fc6aa..5cdab08 100644 (file)
@@ -33,15 +33,25 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true)
    </div>
 
    <div class="dimpActions dimpActionsMsg">
-    <span id="button_reply_cont"><?php _createDAfmsg(_("Reply"), 'reply_menu.png', 'reply_link', 'hasmenu', $show_text) ?></span>
-    <span id="button_forward_cont"><?php _createDAfmsg(_("Forward"), 'forward_menu.png', 'forward_link', 'hasmenu', $show_text) ?></span>
+    <span>
+     <?php _createDAfmsg(_("Reply"), 'Reply', 'reply_link', 'hasmenu', $show_text) ?>
+    </span>
+    <span>
+     <?php _createDAfmsg(_("Forward"), 'Forward', 'forward_link', 'hasmenu', $show_text) ?>
+    </span>
 <?php if (!empty($conf['spam']['reporting']) && (!$conf['spam']['spamfolder'] || ($folder != IMP::folderPref($prefs->getValue('spam_folder'), true)))): ?>
-    <span><?php _createDAfmsg(_("Report Spam"), 'spam_menu.png', 'button_spam', '', $show_text) ?></span>
+    <span>
+     <?php _createDAfmsg(_("Report Spam"), 'Spam', 'button_spam', '', $show_text) ?>
+    </span>
 <?php endif; ?>
 <?php if (!empty($conf['notspam']['reporting']) && (!$conf['notspam']['spamfolder'] || ($folder == IMP::folderPref($prefs->getValue('spam_folder'), true)))): ?>
-    <span><?php _createDAfmsg(_("Report Innocent"), 'ham_menu.png', 'button_ham', '', $show_text) ?></span>
+    <span>
+     <?php _createDAfmsg(_("Report Innocent"), 'Ham', 'button_ham', '', $show_text) ?>
+    </span>
 <?php endif; ?>
-    <span><?php _createDAfmsg(_("Delete"), 'delete_menu.png', 'button_deleted', '', $show_text) ?></span>
+    <span>
+     <?php _createDAfmsg(_("Delete"), 'Delete', 'button_deleted', '', $show_text) ?>
+    </span>
    </div>
   </div>
 
index c0ec2b8..837f4b4 100644 (file)
@@ -171,32 +171,32 @@ function _simpleButton($id, $text, $image, $imagedir = null)
        <input type="text" name="msgList_filter" id="msgList_filter" size="30" />
       </form>
       <span>
-       <?php _createDA(_("Reply"), 'reply_menu.png', 'button_reply', '', $show_text) ?>
+       <?php _createDA(_("Reply"), 'Reply', 'button_reply', '', $show_text) ?>
       </span>
       <span>
-       <?php _createDA(_("Forward"), 'forward_menu.png', 'button_forward', '', $show_text) ?>
+       <?php _createDA(_("Forward"), 'Forward', 'button_forward', '', $show_text) ?>
       </span>
 <?php if (!empty($conf['spam']['reporting'])): ?>
       <span>
-       <?php _createDA(_("Spam"), 'spam_menu.png', 'button_spam', '', $show_text) ?>
+       <?php _createDA(_("Spam"), 'Spam', 'button_spam', '', $show_text) ?>
       </span>
 <?php endif; ?>
 <?php if (!empty($conf['notspam']['reporting'])): ?>
       <span style="display:none">
-       <?php _createDA(_("Innocent"), 'ham_menu.png', 'button_ham', '', $show_text) ?>
+       <?php _createDA(_("Innocent"), 'Ham', 'button_ham', '', $show_text) ?>
       </span>
 <?php endif; ?>
       <span id="button_compose">
-       <?php _createDA(_("Compose"), 'compose_menu.png', '', '', $show_text) ?>
+       <?php _createDA(_("Compose"), 'Compose', '', '', $show_text) ?>
       </span>
       <span id="button_checkmail">
-       <?php _createDA(_("Get Mail"), 'checkmail_menu.png', '', '', $show_text) ?>
+       <?php _createDA(_("Get Mail"), 'Checkmail', '', '', $show_text) ?>
       </span>
       <span>
-       <?php _createDA(_("Delete"), 'delete_menu.png', 'button_deleted', '', $show_text) ?>
+       <?php _createDA(_("Delete"), 'Delete', 'button_deleted', '', $show_text) ?>
       </span>
       <span>
-       <?php _createDA(_("Other Actions"), 'plus_menu.png', 'button_other', '', $show_text) ?>
+       <?php _createDA(_("Other Actions"), 'Other', 'button_other', '', $show_text) ?>
       </span>
      </div>
 
index 642e59b..6fb17a4 100644 (file)
@@ -519,7 +519,7 @@ div.msgSubject img {
     padding-left: 4px;
     padding-right: 4px;
 }
-.dimpActions .disabled img, .dimpActions .disabled span.popdownImg, .dimpActions .disabled span.spellcheckPopdownImg {
+.dimpActions .disabled span.iconImg, .dimpActions .disabled span.spellcheckPopdownImg {
     filter: alpha(opacity=25);
     -moz-opacity: .25;
     opacity: .25;
@@ -977,6 +977,37 @@ span.iconImg, span.contextImg, span.spellcheckPopdownImg {
     vertical-align: top;
 }
 
+span.dimpactionReply {
+    background-image: url("graphics/reply_menu.png");
+}
+span.dimpactionForward {
+    background-image: url("graphics/forward_menu.png");
+}
+span.dimpactionSpam {
+    background-image: url("graphics/spam_menu.png");
+}
+span.dimpactionHam {
+    background-image: url("graphics/ham_menu.png");
+}
+span.dimpactionCompose {
+    background-image: url("graphics/compose_menu.png");
+}
+span.dimpactionCheckmail {
+    background-image: url("graphics/checkmail_menu.png");
+}
+span.dimpactionDelete {
+    background-image: url("graphics/delete_menu.png");
+}
+span.dimpactionOther {
+    background-image: url("graphics/plus_menu.png");
+}
+span.dimpactionSpellcheck {
+    background-image: url("graphics/spellcheck_menu.png");
+}
+span.dimpactionDrafts {
+    background-image: url("graphics/drafts_menu.png");
+}
+
 /* Context menu images */
 #ctx_message_reply span.contextImg {
     background-image: url("graphics/reply.png");
index a55ae2d..6f6f5f3 100644 (file)
     background-image: url("graphics/popright.png");
 }
 
+span.dimpactionReply {
+    background-image: url("graphics/reply_menu.png");
+}
+span.dimpactionForward {
+    background-image: url("graphics/forward_menu.png");
+}
+span.dimpactionSpam {
+    background-image: url("graphics/spam_menu.png");
+}
+span.dimpactionHam {
+    background-image: url("graphics/ham_menu.png");
+}
+span.dimpactionCompose {
+    background-image: url("graphics/compose_menu.png");
+}
+span.dimpactionCheckmail {
+    background-image: url("graphics/checkmail_menu.png");
+}
+span.dimpactionDelete {
+    background-image: url("graphics/delete_menu.png");
+}
+span.dimpactionOther {
+    background-image: url("graphics/plus_menu.png");
+}
+span.dimpactionSpellcheck {
+    background-image: url("graphics/spellcheck_menu.png");
+}
+span.dimpactionDrafts {
+    background-image: url("graphics/drafts_menu.png");
+}
+
 /* Context menu images */
 #ctx_message_reply span.contextImg {
     background-image: url("graphics/reply.png");