nav_tabs = $this->es_get_tabs_list();
$this->es_display_nav_tabs();
$this->form = $this->es_process_settings_data();
$this->es_display_settings();
}
public function es_get_tabs_list() {
$tabs = array(
'admin' => __( 'Admin', ES_TDOMAIN ),
'signup-confirmation' => __( 'Signup Confirmation', ES_TDOMAIN ),
'roles' => __( 'User Roles', ES_TDOMAIN ),
'cron' => __( 'Cron', ES_TDOMAIN ),
);
return apply_filters( 'es_settings_tabs', $tabs );
}
public function es_display_nav_tabs() {
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
What is Cron?', ES_TDOMAIN ); ?>
Setup cron job in Plesk', ES_TDOMAIN ); ?>
Setup cron job in cPanal', ES_TDOMAIN ); ?>
Hosting does not support cron jobs?', ES_TDOMAIN ); ?>
|
'norecord' && $es_c_rolesandcapabilities <> "") {
$form['es_roles_subscriber'] = $es_c_rolesandcapabilities['es_roles_subscriber'];
$form['es_roles_mail'] = $es_c_rolesandcapabilities['es_roles_mail'];
$form['es_roles_notification'] = $es_c_rolesandcapabilities['es_roles_notification'];
$form['es_roles_sendmail'] = $es_c_rolesandcapabilities['es_roles_sendmail'];
$form['es_roles_sentmail'] = $es_c_rolesandcapabilities['es_roles_sentmail'];
}
// Cron Settings
$es_cron_url = get_option('ig_es_cronurl', 'nocronurl');
if($es_cron_url == "nocronurl") {
$guid = es_cls_common::es_generate_guid(60);
$home_url = home_url('/');
$cronurl = $home_url . "?es=cron&guid=". $guid;
add_option('ig_es_cronurl', $cronurl);
$es_cron_url = get_option('ig_es_cronurl');
}
$form['ig_es_cronurl'] = $es_cron_url;
$es_cron_mailcount = get_option('ig_es_cron_mailcount', '0');
if($es_cron_mailcount == "0") {
add_option('ig_es_cron_mailcount', "50");
$es_cron_mailcount = get_option('ig_es_cron_mailcount');
}
$form['ig_es_cron_mailcount'] = $es_cron_mailcount;
$blogname = get_option('blogname');
$es_cron_adminmail = get_option('ig_es_cron_adminmail', '');
if($es_cron_adminmail == "") {
add_option('ig_es_cron_adminmail', "Hi Admin,\r\n\r\nCron URL has been triggered successfully on ###DATE### for the email ###SUBJECT###. And it sent email to ###COUNT### recipient(s).\r\n\r\nBest,\r\n".$blogname."");
$es_cron_adminmail = get_option('ig_es_cron_adminmail');
}
$form['ig_es_cron_adminmail'] = $es_cron_adminmail;
// Form submitted, check & update the data in options table
if (isset($_POST['es_form_submit']) && $_POST['es_form_submit'] == 'yes') {
// Just security thingy that wordpress offers us
check_admin_referer('es_form_edit');
// Fetch submitted Admin Data
$form['ig_es_fromname'] = isset($_POST['es_c_fromname']) ? $_POST['es_c_fromname'] : '';
$form['ig_es_fromname'] = stripslashes($form['ig_es_fromname']);
if ($form['ig_es_fromname'] == '') {
$es_errors[] = __( 'Please enter sender of notifications from name.', ES_TDOMAIN );
$es_error_found = TRUE;
}
$form['ig_es_fromemail'] = isset($_POST['es_c_fromemail']) ? $_POST['es_c_fromemail'] : '';
if ($form['ig_es_fromemail'] == '') {
$es_errors[] = __( 'Please enter sender of notifications from email.', ES_TDOMAIN );
$es_error_found = TRUE;
}
$form['ig_es_emailtype'] = isset($_POST['es_c_mailtype']) ? $_POST['es_c_mailtype'] : '';
$form['ig_es_post_image_size'] = isset($_POST['es_c_post_image_size']) ? $_POST['es_c_post_image_size'] : '';
$form['ig_es_adminemail'] = isset($_POST['es_c_adminemail']) ? $_POST['es_c_adminemail'] : '';
$form['ig_es_notifyadmin'] = isset($_POST['es_c_adminmailoption']) ? $_POST['es_c_adminmailoption'] : '';
$form['ig_es_admin_new_sub_subject'] = isset($_POST['es_c_adminmailsubject']) ? $_POST['es_c_adminmailsubject'] : '';
$form['ig_es_admin_new_sub_content'] = isset($_POST['es_c_adminmailcontant']) ? $_POST['es_c_adminmailcontant'] : '';
$form['ig_es_sentreport'] = isset($_POST['es_c_sentreport']) ? $_POST['es_c_sentreport'] : '';
$form['ig_es_sentreport_subject'] = isset($_POST['es_c_sentreport_subject']) ? $_POST['es_c_sentreport_subject'] : '';
// Fetch submitted Signup Configuration data
$form['ig_es_welcomeemail'] = isset($_POST['es_c_usermailoption']) ? $_POST['es_c_usermailoption'] : '';
$form['ig_es_welcomesubject'] = isset($_POST['es_c_usermailsubject']) ? $_POST['es_c_usermailsubject'] : '';
$form['ig_es_welcomecontent'] = isset($_POST['es_c_usermailcontant']) ? $_POST['es_c_usermailcontant'] : '';
$form['ig_es_optintype'] = isset($_POST['es_c_optinoption']) ? $_POST['es_c_optinoption'] : '';
$form['ig_es_confirmsubject'] = isset($_POST['es_c_optinsubject']) ? $_POST['es_c_optinsubject'] : '';
$form['ig_es_confirmcontent'] = isset($_POST['es_c_optincontent']) ? $_POST['es_c_optincontent'] : '';
$home_url = home_url('/');
$optinlink = $home_url . "?es=optin&db=###DBID###&email=###EMAIL###&guid=###GUID###";
$form['ig_es_optinlink'] = $optinlink;
$unsublink = $home_url . "?es=unsubscribe&db=###DBID###&email=###EMAIL###&guid=###GUID###";
$form['ig_es_unsublink'] = $unsublink;
$form['ig_es_unsubcontent'] = isset($_POST['es_c_unsubtext']) ? $_POST['es_c_unsubtext'] : '';
$form['ig_es_unsubtext'] = isset($_POST['es_c_unsubhtml']) ? $_POST['es_c_unsubhtml'] : '';
$form['ig_es_successmsg'] = isset($_POST['es_c_subhtml']) ? $_POST['es_c_subhtml'] : '';
$form['ig_es_suberror'] = isset($_POST['es_c_message1']) ? $_POST['es_c_message1'] : '';
$form['ig_es_unsuberror'] = isset($_POST['es_c_message2']) ? $_POST['es_c_message2'] : '';
// Fetch submitted Roles Data
$form['es_roles_subscriber'] = $roles['es_roles_subscriber'] = isset($_POST['es_roles_subscriber']) ? $_POST['es_roles_subscriber'] : '';
$form['es_roles_mail'] = $roles['es_roles_mail'] = isset($_POST['es_roles_mail']) ? $_POST['es_roles_mail'] : '';
$form['es_roles_notification'] = $roles['es_roles_notification'] = isset($_POST['es_roles_notification']) ? $_POST['es_roles_notification'] : '';
$form['es_roles_sendmail'] = $roles['es_roles_sendmail'] = isset($_POST['es_roles_sendmail']) ? $_POST['es_roles_sendmail'] : '';
$form['es_roles_sentmail'] = $roles['es_roles_sentmail'] = isset($_POST['es_roles_sentmail']) ? $_POST['es_roles_sentmail'] : '';
// Fetch submitted Cron Data
$es_cron_mailcount = isset($_POST['es_cron_mailcount']) ? $_POST['es_cron_mailcount'] : '';
if( $es_cron_mailcount == "0" && strlen ($es_cron_mailcount) > 0 ) {
$es_errors[] = __('Please enter valid mail count.', 'email-subscribers');
$es_error_found = TRUE;
} else {
$form['ig_es_cron_mailcount'] = $es_cron_mailcount;
}
$form['ig_es_cron_adminmail'] = isset($_POST['es_cron_adminmail']) ? $_POST['es_cron_adminmail'] : '';
// No errors found, we can add the settings to tehe options
if ($es_error_found == FALSE) {
$action = "";
$action = $this->es_settings_update( $form, $roles );
if($action == "sus") {
$es_success = __( 'Settings Saved.', ES_TDOMAIN );
} else {
$es_error_found == TRUE;
$es_errors[] = __( 'Oops, unable to update.', ES_TDOMAIN );
}
}
}
if ($es_error_found == TRUE && isset($es_errors[0]) == TRUE) {
?> 0) {
?> $value ) {
update_option( $key, $value );
}
}
if ( ! empty( $roles ) ) {
update_option( 'ig_es_rolesandcapabilities', $roles );
}
return 'sus';
}
}
}
new ES_Settings();