예제 #1
0
 function main()
 {
     parent::WYSIJA_control_back();
     wp_enqueue_style('thickbox');
     if (!isset($_REQUEST['action'])) {
         $this->action = 'main';
     } else {
         $this->action = $_REQUEST['action'];
     }
     $this->jsTrans['testemail'] = __('Sending a test email', WYSIJA);
     $this->jsTrans['bounceconnect'] = __('Bounce handling connection test', WYSIJA);
     $this->jsTrans['processbounceT'] = __('Bounce handling processing', WYSIJA);
     $this->jsTrans['doubleoptinon'] = __('Subscribers will now need to activate their subscription by email in order to receive your newsletters. This is recommended.', WYSIJA);
     $this->jsTrans['doubleoptinoff'] = __('Unconfirmed subscribers will receive your newsletters from now on without the need to activate their subscriptions.', WYSIJA);
     $this->jsTrans['processbounce'] = __('Process bounce handling now!', WYSIJA);
     $this->jsTrans['errorbounceforward'] = __('When setting up the bounce system, you need to have a different address for the bounce email and the forward to address', WYSIJA);
     // form list
     $this->jsTrans['suredelete'] = __('Are you sure you want to delete this form?', WYSIJA);
     switch ($this->action) {
         case 'log':
         case 'save':
         case 'clearlog':
             wp_enqueue_script('wysija-config-settings', WYSIJA_URL . 'js/admin-config-settings.js', array('wysija-admin-js-global'), WYSIJA::get_version());
             wp_localize_script('wysija-config-settings', 'mpEmailCheck', WJ_Utils::get_tip_data());
             wp_enqueue_script('jquery-cookie', WYSIJA_URL . 'js/jquery/jquery.cookie.js', array('jquery'), WYSIJA::get_version());
         case 'form_add':
         case 'form_edit':
         case 'form_duplicate':
         case 'form_delete':
         case 'form_widget_settings':
         case 'form_add_field':
             return $this->{$this->action}();
             break;
         case 'reinstall':
             $this->reinstall();
             return;
             break;
         case 'dkimcheck':
             $this->dkimcheck();
             if (defined('WYSIJA_REDIRECT')) {
                 $this->redirectProcess();
             }
             return;
             break;
         case 'doreinstall':
             $this->doreinstall();
             if (defined('WYSIJA_REDIRECT')) {
                 global $wysi_location;
                 $wysi_location = 'admin.php?page=wysija_campaigns';
                 $this->redirectProcess();
             }
             return;
             break;
         default:
             wp_enqueue_script('mailpoet.tooltip', WYSIJA_URL . 'js/vendor/bootstrap.tooltip.js', array('jquery'), WYSIJA::get_version(), true);
             wp_enqueue_style('mailpoet.tooltip', WYSIJA_URL . 'css/vendor/bootstrap.tooltip.css', array(), WYSIJA::get_version(), 'screen');
             wp_enqueue_script('wysija-config-settings', WYSIJA_URL . 'js/admin-config-settings.js', array('wysija-admin-js-global'), WYSIJA::get_version(), true);
             wp_localize_script('wysija-config-settings', 'mpEmailCheck', WJ_Utils::get_tip_data());
             wp_enqueue_script('jquery-cookie', WYSIJA_URL . 'js/jquery/jquery.cookie.js', array('jquery'), WYSIJA::get_version());
     }
     if (WYSIJA_DBG > 1) {
         $this->viewObj->arrayMenus = array('log' => 'View log');
     }
     $this->data = array();
     $hook_settings_super_advanced_params = array();
     $this->data['hooks']['hook_settings_super_advanced'] = apply_filters('hook_settings_super_advanced', WYSIJA_module::execute_hook('hook_settings_super_advanced', $hook_settings_super_advanced_params), $hook_settings_super_advanced_params);
     $this->action = 'main';
     if (isset($_REQUEST['validate'])) {
         $this->notice(str_replace(array('[link]', '[/link]'), array('<a title="' . __('Get Premium now', WYSIJA) . '" class="premium-activate" href="javascript:;">', '</a>'), __('You\'re almost there. Click this [link]link[/link] to activate the licence you have just purchased.', WYSIJA)));
     }
 }
예제 #2
0
 function editDetails()
 {
     if (!$this->_checkEmailExists($_REQUEST['id'])) {
         return;
     }
     $this->viewObj->title = __('Final step: last details', WYSIJA);
     $this->viewShow = 'editDetails';
     $this->js[] = 'wysija-validator';
     $this->jsTrans['previewemail'] = __('Sending preview...', WYSIJA);
     $this->jsTrans['pickadate'] = __('Pick a date', WYSIJA);
     $this->jsTrans['saveclose'] = __('Save & close', WYSIJA);
     $this->jsTrans['sendlater'] = __('Send later', WYSIJA);
     $this->jsTrans['schedule'] = __('Schedule', WYSIJA);
     $this->jsTrans['emailCheck'] = WJ_Utils::get_tip_data();
     $this->js[] = 'jquery-ui-datepicker';
     $this->js[] = 'wysija-tooltip';
     $model_list = WYSIJA::get('list', 'model');
     $model_list->limitON = false;
     $this->data = array();
     $this->data['lists'] = $this->_getLists(false, true, true);
     $model_email = WYSIJA::get('email', 'model');
     $this->data['email'] = $model_email->getOne(false, array('email_id' => $_REQUEST['id']));
     // The first newsletter, we don't have replyto_email and replyto_name
     if (empty($this->data['email']['replyto_email']) || empty($this->data['email']['replyto_name'])) {
         $current_user = wp_get_current_user();
         $this->data['email']['replyto_email'] = $current_user->data->user_email;
         $this->data['email']['replyto_name'] = $current_user->data->display_name;
     }
     if ((int) $this->data['email']['type'] == 2) {
         $this->js['wysija-edit-autonl'] = 'wysija-edit-autonl';
         $this->jsTrans['autonl'] = true;
         $this->immediateWarning();
         $this->jsTrans['send'] = __('Activate now', WYSIJA);
     } else {
         $this->jsTrans['autonl'] = true;
         $this->viewObj->immediatewarning = '';
         $this->jsTrans['send'] = __('Send', WYSIJA);
     }
     if ((int) $this->data['email']['type'] == 1) {
         $this->jsTrans['alertsend'] = __('You are about to send this newsletter. Please confirm.', WYSIJA);
     } else {
         if (isset($this->data['email']['params']['autonl']['event']) && $this->data['email']['params']['autonl']['event'] == 'subs-2-nl') {
             $this->data['autoresponder'] = 1;
             foreach ($this->data['lists'] as $list) {
                 if ($list['list_id'] == $this->data['email']['params']['autonl']['subscribetolist']) {
                     break;
                 }
             }
             $this->jsTrans['ignoreprevious'] = sprintf(__('Are you sure you want to ignore the %1$s subscribers of the list %2$s?', WYSIJA), '"' . $list['count'] . '"', '"' . $list['name'] . '"');
         }
     }
     $this->checkIsEditable();
     $this->title = sprintf(__('Step %1$s', WYSIJA), 3) . " | " . $this->data['email']['subject'];
     $this->dataAutoNl();
     $this->jsLoc['wysija-edit-autonl']['autofields'] = $this->data['autonl']['fields'];
     $modelCL = WYSIJA::get('campaign_list', 'model');
     $this->data['campaign_list'] = $modelCL->get(false, array('campaign_id' => $this->data['email']['campaign_id']));
 }