admin_notices = $admin_notices;
}
/**
* @param int $track_strings
*/
public function add( $track_strings ) {
if ( ! $track_strings ) {
return;
}
$options_nonce = 'wpml-localization-options-nonce';
$message = __( 'For String Tracking to work, the option', 'wpml-string-translation' );
$message .= ' ' . WPML_ST_Theme_Plugin_Localization_Options_UI::get_all_strings_option_text() . ' ';
$message .= __( 'was automatically disabled. To enable it back, go to WPML->Theme and Plugins localization.', 'wpml-string-translation' );
$message .= '';
$notice = $this->admin_notices->get_new_notice( self::NOTICE_ID, $message, self::NOTICE_GROUP );
$notice->set_css_class_types( 'info' );
$notice->add_action( $this->admin_notices->get_new_notice_action( __( 'Cancel and undo changes', 'wpml-string-translation' ), '#', false, false, 'button-primary' ) );
$notice->add_action( $this->admin_notices->get_new_notice_action( __( 'Skip', 'wpml-string-translation' ), '#', false, true ) );
$this->admin_notices->add_notice( $notice );
}
public function remove() {
$this->admin_notices->remove_notice(
self::NOTICE_GROUP,
self::NOTICE_ID
);
}
}