Skip to content

Commit

Permalink
Improve Dashboard Notice; See: #163
Browse files Browse the repository at this point in the history
  • Loading branch information
kristineds committed Dec 2, 2015
1 parent c632e1c commit 496a9bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions comment-mail/includes/stcr.php
Expand Up @@ -93,10 +93,10 @@ function stcr_transition()

# Notice to existing StCR users now upgrading to Comment Mail.

$notice = sprintf(__('<h3 style="font-weight:400; margin:0 0 1em 0;">Upgrading from <strong>StCR</strong> (Subscribe to Comments Reloaded) to <strong>%1$s&trade;</strong> %2$s — Welcome! :-)</h3>', $plugin->text_domain), esc_html($plugin->name), $plugin->utils_fs->inline_icon_svg());
$notice = sprintf(__('<h3 style="font-weight:400; margin:0 0 1em 0;">Upgrading from <strong>Subscribe to Comments Reloaded</strong> (StCR) to <strong>%1$s&trade;</strong> %2$s — Welcome! :-)</h3>', $plugin->text_domain), esc_html($plugin->name), $plugin->utils_fs->inline_icon_svg());
$notice .= '<ul style="margin:0 0 0 3em; list-style:disc;">'.
' <li>'.sprintf(__('%1$s automatically imported <a href="http://comment-mail.com/kb-article/stcr-options-transitioned-by-comment-mail/" target="_blank">many of your StCR options</a>. It\'s still a good idea to review your Comment Mail configuration though.', $plugin->text_domain), esc_html($plugin->name)).'</li>'.
' <li>'.sprintf(__('<strong>IMPORTANT TIP:</strong> %1$s can import your existing StCR subscribers automatically too! [<strong><a href="%2$s">click here to begin</a></strong>]', $plugin->text_domain), esc_html($plugin->name), esc_attr($plugin->utils_url->import_export_menu_page_only())).'</li>'.
' <li>'.sprintf(__('%1$s automatically imported many of your StCR options (to learn what was imported, see <a href="http://comment-mail.com/kb-article/stcr-options-transitioned-by-comment-mail/" target="_blank">this article</a>). It\'s still a good idea to review your %1$s configuration though.', $plugin->text_domain), esc_html($plugin->name)).'</li>'.
' <li>'.sprintf(__('<strong>IMPORTANT TIP:</strong> %1$s can import your existing StCR subscribers automatically too! <strong><a href="%2$s">Click here to review the StCR → %1$s import process</a></strong>.', $plugin->text_domain), esc_html($plugin->name), esc_attr($plugin->utils_url->import_export_menu_page_only())).'</li>'.
'</ul>';
$plugin->enqueue_notice($notice, array('persistent' => TRUE));
}
Expand Down
4 changes: 4 additions & 0 deletions comment-mail/plugin.inc.php
Expand Up @@ -1919,6 +1919,10 @@ public function enqueue_user_error($markup, array $args = array())
*/
public function all_admin_notices()
{
if (!$this->options['enable']) {
$this->enqueue_notice(sprintf(__('<strong>%1$s is disabled. Please visit the <a href="%2$s">%1$s settings</a> and enable the plugin</strong>.', $this->text_domain), esc_html($this->name), esc_attr($this->utils_url->main_menu_page_only())));
}

if(!is_array($notices = get_option(__NAMESPACE__.'_notices')))
update_option(__NAMESPACE__.'_notices', ($notices = array()));

Expand Down

0 comments on commit 496a9bf

Please sign in to comment.