/** * Saves the options in own option entry */ public function save_settings_page_options() { $this->options['del_on_deactivate'] = (WC_Email_Att::$show_activation) ? isset( $_REQUEST[ self::PREFIX_JS_NAMES . 'del_on_deactivate' ] ) : false; $this->options['del_on_uninstall'] = (WC_Email_Att::$show_uninstall) ? isset( $_REQUEST[self::PREFIX_JS_NAMES . 'del_on_uninstall'] ) : true; $this->options['notification_headline'] = (isset( $_REQUEST[ self::PREFIX_JS_NAMES . 'notification_headline']) && ! empty( $_REQUEST[self::PREFIX_JS_NAMES . 'notification_headline' ] ) ) ? $_REQUEST[ self::PREFIX_JS_NAMES . 'notification_headline' ] : ''; $this->options['notification_headline'] = trim( stripslashes( $this->options['notification_headline'] ) ); $this->options['notification_text'] = (isset( $_REQUEST[ self::PREFIX_JS_NAMES . 'notification_text']) && ! empty( $_REQUEST[self::PREFIX_JS_NAMES . 'notification_text'])) ? $_REQUEST[self::PREFIX_JS_NAMES . 'notification_text' ] : ''; $this->options['notification_text'] = trim( stripslashes( $this->options['notification_text'] ) ); $this->options['show_notes_always'] = isset( $_REQUEST[ self::PREFIX_JS_NAMES . 'show_notes_always' ] ); $oldpath = $newpath = strtolower( $this->options['upload_folder'] ); if( isset( $_REQUEST[ self::PREFIX_JS_NAMES . 'upload_folder' ] ) ) { $newpath = strtolower( trim( strtolower( stripslashes( $_REQUEST[ self::PREFIX_JS_NAMES . 'upload_folder'] ) ) ) ); $newpath = str_replace( '\\', '/', $newpath ); $newpath = (strlen( $newpath ) == 0 ) ? $oldpath : untrailingslashit( $newpath ); $newpath = '/' . ltrim( $newpath, '/' ); if( $oldpath != $newpath ) { if( WC_Email_Att_Func::create_folder( $newpath ) ) { $this->options['upload_folder'] = $newpath; } WC_Email_Att_Func::remove_empty_folder( $oldpath, WC_Email_Att::$skip_files ); } } foreach ( $this->emailsubjects as $email_key => $emailclass ) { $opt_key = $this->inputfields_param[ $email_key ]['id']; $this->options[ $opt_key ] = $this->get_opt_emailaddress( self::PREFIX_JS_NAMES . 'head_', $email_key ); $opt_key = $this->inputfields_param[ $email_key ]['att_id']; $this->options[ $opt_key ] = $this->get_opt_attachment_files( self::PREFIX_JS_NAMES . 'att_', $email_key ); } $this->options = apply_filters( 'wc_eatt_save_settings_options', $this->options, $this->emailsubjects, $this->inputfields_param ); update_option( WC_Email_Att::OPTIONNAME, $this->options ); WC_Email_Att::instance()->options = $this->options; WC_Email_Att::$admin_message = 'Options saved'; }