Permalink
Browse files

add toolbar setting for compose screen

  • Loading branch information...
1 parent aea9d32 commit b7f1b67233bddfcfd24f35100906a2da9e0465df @JohnDoh committed Dec 22, 2012
Showing with 6 additions and 6 deletions.
  1. +4 −0 config.inc.php.dist
  2. +2 −6 markasjunk2.php
View
@@ -41,6 +41,10 @@ $rcmail_config['markasjunk2_debug'] = false;
// The mark as spam/ham icon can either be displayed on the toolbar or as part of the mark messages menu
$rcmail_config['markasjunk2_mb_toolbar'] = true;
+// Show icon on compose toolbar
+// The mark as spam/ham icon can either be displayed on the toolbar or as part of the mark messages menu
+$rcmail_config['markasjunk2_cp_toolbar'] = true;
+
// cmd_learn Driver options
// ------------------------
// The command used to learn that a message is spam
View
@@ -30,7 +30,7 @@ function init()
$this->load_config();
$this->ham_mbox = $rcmail->config->get('markasjunk2_ham_mbox', 'INBOX');
$this->spam_mbox = $rcmail->config->get('markasjunk2_spam_mbox', $rcmail->config->get('junk_mbox', null));
- $this->toolbar = $rcmail->config->get('markasjunk2_mb_toolbar', true);
+ $this->toolbar = $rcmail->action == 'show' ? $rcmail->config->get('markasjunk2_cp_toolbar', true) : $rcmail->config->get('markasjunk2_mb_toolbar', true);
if ($rcmail->action == '' || $rcmail->action == 'show') {
$this->include_script('markasjunk2.js');
@@ -46,11 +46,7 @@ function init()
elseif (!$mb_override)
$display_not_junk = 'display: none;';
- if ($rcmail->action == 'show') {
- $this->add_button(array('command' => 'plugin.markasjunk2.junk', 'type' => 'link', 'class' => 'button buttonPas markasjunk2 disabled', 'classact' => 'button markasjunk2', 'classsel' => 'button markasjunk2Sel', 'title' => 'markasjunk2.buttonjunk', 'label' => 'junk', 'style' => $display_junk), 'toolbar');
- $this->add_button(array('command' => 'plugin.markasjunk2.not_junk', 'type' => 'link', 'class' => 'button buttonPas markasnotjunk2 disabled', 'classact' => 'button markasnotjunk2', 'classsel' => 'button markasnotjunk2Sel', 'title' => 'markasjunk2.buttonnotjunk', 'label' => 'markasjunk2.notjunk', 'style' => $display_not_junk), 'toolbar');
- }
- elseif ($this->toolbar) {
+ if ($this->toolbar) {
$this->add_button(array('command' => 'plugin.markasjunk2.junk', 'type' => 'link', 'class' => 'button buttonPas markasjunk2 disabled', 'classact' => 'button markasjunk2', 'classsel' => 'button markasjunk2Sel', 'title' => 'markasjunk2.buttonjunk', 'label' => 'junk', 'style' => $display_junk), 'toolbar');
$this->add_button(array('command' => 'plugin.markasjunk2.not_junk', 'type' => 'link', 'class' => 'button buttonPas markasnotjunk2 disabled', 'classact' => 'button markasnotjunk2', 'classsel' => 'button markasnotjunk2Sel', 'title' => 'markasjunk2.buttonnotjunk', 'label' => 'markasjunk2.notjunk', 'style' => $display_not_junk), 'toolbar');
}

0 comments on commit b7f1b67

Please sign in to comment.