function main() { parent::__construct(); 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))); } }
/** * Constructor */ function __construct() { parent::__construct(); }
function licok() { parent::__construct(); $dt = get_option('wysijey'); if (isset($_REQUEST['xtz']) && $dt === $_REQUEST['xtz']) { $dataconf = array('premium_key' => base64_encode(get_option('home') . time()), 'premium_val' => time(), 'premium_expire_at' => (int) $_REQUEST['expire_at']); $this->notice(__('Premium version is valid for your site.', WYSIJA)); } else { $dataconf = array('premium_key' => '', 'premium_val' => ''); if (!empty($_REQUEST['expire_at'])) { $dataconf['premium_expire_at'] = (int) $_REQUEST['expire_at']; } else { $url_premium = 'http://www.mailpoet.com/checkout/?wysijadomain=' . $dt . '&nc=1&utm_source=wpadmin&utm_campaign=error_licence_activation'; $this->error(str_replace(array('[link]', '[/link]'), array('<a href="' . $url_premium . '" target="_blank">', '</a>'), __('Premium licence does not exist for your site. Purchase it [link]here[/link].', WYSIJA)), 1); } } WYSIJA::update_option('wysicheck', false); $modelConf = WYSIJA::get('config', 'model'); $modelConf->save($dataconf); $this->redirect('admin.php?page=wysija_config#tab-premium'); }
function main() { $this->messages['insert'][true] = __('Subscriber has been saved.', WYSIJA); $this->messages['insert'][false] = __('Subscriber has not been saved.', WYSIJA); $this->messages['update'][true] = __('Subscriber has been modified. [link]Edit again[/link].', WYSIJA); $this->messages['update'][false] = __('Subscriber has not been modified.', WYSIJA); $this->_cleanup_form(); parent::__construct(); //we change the default model of the controller based on the action if (isset($_REQUEST['action'])) { switch ($_REQUEST['action']) { case 'listsedit': case 'savelist': case 'lists': $this->model = 'list'; break; default: $this->model = 'user'; } } WYSIJA_control::__construct(); if (!isset($_REQUEST['action']) || !$_REQUEST['action']) { $this->defaultDisplay(); $this->checkTotalSubscribers(); } else { $this->_tryAction($_REQUEST['action']); } }