is_action('theme')) { if ($controls->data['theme'] != 'rawhtml') { $controls->merge($module->themes->get_options($controls->data['theme'])); $module->save_options($controls->data); } // If this theme has no intermediate options... if ($controls->data['theme'] == 'rawhtml' || !file_exists($module->get_current_theme_file_path('theme-options.php'))) { $email = array(); $email['status'] = 'new'; $email['subject'] = __('Here the email subject', 'newsletter'); $email['track'] = Newsletter::instance()->options['track']; $email['token'] = $module->get_token(); if ($controls->data['theme'] == 'rawhtml') { $email['editor'] = NewsletterEmails::EDITOR_HTML; $email['message'] = "\n\n\nYour email title\n\n\n\n"; } else { $theme_options = $module->get_current_theme_options(); $theme_url = $module->get_current_theme_url(); $theme_subject = ''; ob_start(); include $module->get_current_theme_file_path('theme.php'); $email['message'] = ob_get_clean(); if (!empty($theme_subject)) { $email['subject'] = $theme_subject; } $file = $module->get_current_theme_file_path('theme-text.php'); if (file_exists($file)) { ob_start(); include $module->get_current_theme_file_path('theme-text.php'); $email['message_text'] = ob_get_clean(); } else { $email['message_text'] = 'You need a modern email client to read this email. Read it online: {email_url}.'; } $email['editor'] = NewsletterEmails::EDITOR_TINYMCE; } $email['type'] = 'message'; $email['send_on'] = time(); $email = Newsletter::instance()->save_email($email); $controls->js_redirect($module->get_editor_url($email->id, $email->editor)); return; } } if ($controls->is_action('save')) { $module->save_options($controls->data); //$controls->messages = 'Saved.'; } if ($controls->is_action('create')) { $module->save_options($controls->data); $email = array(); $email['status'] = 'new'; $email['subject'] = __('Here the email subject', 'newsletter'); $email['track'] = Newsletter::instance()->options['track']; $theme_options = $module->get_current_theme_options(); $theme_url = $module->get_current_theme_url(); $theme_subject = ''; ob_start(); include $module->get_current_theme_file_path('theme.php'); $email['message'] = ob_get_clean(); if (!empty($theme_subject)) { $email['subject'] = $theme_subject; } ob_start(); include $module->get_current_theme_file_path('theme-text.php'); $email['message_text'] = ob_get_clean(); $email['type'] = 'message'; $email['send_on'] = time(); $email = Newsletter::instance()->save_email($email); ?>

click here to proceed.

data == null) { $controls->data = $module->get_options(); } function newsletter_emails_update_options($options) { add_option('newsletter_emails', '', null, 'no'); update_option('newsletter_emails', $options); } function newsletter_emails_update_theme_options($theme, $options) { $x = strrpos($theme, '/'); if ($x !== false) { $theme = substr($theme, $x + 1); } add_option('newsletter_emails_' . $theme, '', null, 'no'); update_option('newsletter_emails_' . $theme, $options); } function newsletter_emails_get_options() { $options = get_option('newsletter_emails', array()); return $options; } function newsletter_emails_get_theme_options($theme) { $x = strrpos($theme, '/'); if ($x !== false) { $theme = substr($theme, $x + 1); } $options = get_option('newsletter_emails_' . $theme, array()); return $options; } ?>


Theme options are saved for next time you'll use this theme.

init(); ?> hidden('theme'); ?>
button_primary('save', __('Refresh the preview', 'newsletter')); ?>
button_primary('create', 'Proceed to edit »', 'this.form.action=\'' . home_url('/', is_ssl() ? 'https' : 'http') . '?na=emails-create\';this.form.submit()'); ?>
get_current_theme_file_path('theme-options.php'); ?>