save_settings();
} elseif ( isset( $_POST['tadv-restore-defaults'] ) ) {
check_admin_referer( 'tadv-save-buttons-order' );
// TODO: only for admin || SA
$this->admin_settings = $this->get_default_admin_settings();
update_option( 'tadv_admin_settings', $this->get_default_admin_settings() );
// TODO: all users that can have settings
$this->user_settings = $this->get_default_user_settings();
update_option( 'tadv_settings', $this->get_default_user_settings() );
$message = '
' . __('Default settings restored.', 'tinymce-advanced') . '
';
} elseif ( isset( $_POST['tadv-export-settings'] ) ) {
check_admin_referer( 'tadv-save-buttons-order' );
$this->load_settings();
$output = array( 'settings' => $this->user_settings );
// TODO: only admin || SA
$output['admin_settings'] = $this->admin_settings;
?>
text (.txt) file, using a plain text editor like Notepad.', 'tinymce-advanced' ); ?>
' . __( 'Importing of settings failed.', 'tinymce-advanced' ) . '
';
} else {
$this->save_settings( $import );
}
}
if ( empty( $_POST ) ) {
$this->check_plugin_version();
}
$this->load_settings();
if ( empty( $this->toolbar_1 ) && empty( $this->toolbar_2 ) && empty( $this->toolbar_3 ) && empty( $this->toolbar_4 ) ) {
$message = '' . __( 'ERROR: All toolbars are empty. Default settings loaded.', 'tinymce-advanced' ) . '
';
$this->admin_settings = $this->get_default_admin_settings();
$this->user_settings = $this->get_default_user_settings();
$this->load_settings();
}
$all_buttons = $this->get_all_buttons();
?>
warn_if_unsupported();
if ( isset( $_POST['tadv-save'] ) && empty( $message ) ) {
?>