(int)(!empty($_POST['ab_flag_spam'])), 'email_notify' => (int)(!empty($_POST['ab_email_notify'])), 'cronjob_enable' => (int)(!empty($_POST['ab_cronjob_enable'])), 'cronjob_interval' => (int)self::get_key($_POST, 'ab_cronjob_interval'), 'no_notice' => (int)(!empty($_POST['ab_no_notice'])), 'dashboard_count' => (int)(!empty($_POST['ab_dashboard_count'])), 'dashboard_chart' => (int)(!empty($_POST['ab_dashboard_chart'])), 'advanced_check' => (int)(!empty($_POST['ab_advanced_check'])), 'regexp_check' => (int)(!empty($_POST['ab_regexp_check'])), 'spam_ip' => (int)(!empty($_POST['ab_spam_ip'])), 'already_commented' => (int)(!empty($_POST['ab_already_commented'])), 'always_allowed' => (int)(!empty($_POST['ab_always_allowed'])), 'ignore_pings' => (int)(!empty($_POST['ab_ignore_pings'])), 'ignore_filter' => (int)(!empty($_POST['ab_ignore_filter'])), 'ignore_type' => (int)self::get_key($_POST, 'ab_ignore_type'), 'reasons_enable' => (int)(!empty($_POST['ab_reasons_enable'])), 'ignore_reasons' => (array)self::get_key($_POST, 'ab_ignore_reasons'), 'bbcode_check' => (int)(!empty($_POST['ab_bbcode_check'])), 'dnsbl_check' => (int)(!empty($_POST['ab_dnsbl_check'])), 'country_code' => (int)(!empty($_POST['ab_country_code'])), 'country_black' => sanitize_text_field(self::get_key($_POST, 'ab_country_black')), 'country_white' => sanitize_text_field(self::get_key($_POST, 'ab_country_white')), 'translate_api' => (int)(!empty($_POST['ab_translate_api'])), 'translate_lang' => sanitize_text_field(self::get_key($_POST, 'ab_translate_lang')) ); /* Keine Tagmenge eingetragen? */ if ( empty($options['cronjob_interval']) ) { $options['cronjob_enable'] = 0; } /* Translate API */ if ( !empty($options['translate_lang']) ) { if ( !preg_match('/^(de|en|fr|it|es)$/', $options['translate_lang']) ) { $options['translate_lang'] = ''; } } if ( empty($options['translate_lang']) ) { $options['translate_api'] = 0; } /* Liste der Spamgründe */ if ( empty($options['reasons_enable']) ) { $options['ignore_reasons'] = array(); } /* Blacklist reinigen */ if ( !empty($options['country_black']) ) { $options['country_black'] = preg_replace( '/[^A-Z ]/', '', strtoupper($options['country_black']) ); } /* Whitelist reinigen */ if ( !empty($options['country_white']) ) { $options['country_white'] = preg_replace( '/[^A-Z ]/', '', strtoupper($options['country_white']) ); } /* Leere Listen? */ if ( empty($options['country_black']) && empty($options['country_white']) ) { $options['country_code'] = 0; } /* Cron stoppen? */ if ( $options['cronjob_enable'] && !self::get_option('cronjob_enable') ) { self::init_scheduled_hook(); } else if ( !$options['cronjob_enable'] && self::get_option('cronjob_enable') ) { self::clear_scheduled_hook(); } /* Optionen speichern */ self::update_options($options); /* Redirect */ wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), wp_get_referer() ) ); die(); } /** * Generierung eine Selectbox * * @since 2.4.5 * @change 2.4.5 * * @param string $name Name der Selectbox * @param array $data Array mit Werten * @param string $selected Selektierter Wert * @return string $html Erzeugtes HTML */ private static function _build_select($name, $data, $selected) { /* Start HTML */ $html = ''; return $html; } /** * Anzeige der GUI * * @since 0.1 * @change 2.6.1 */ public static function options_page() { ?>