Hello,
in a page type extending SiteTree I am overwriting doPublish() to perform some checks before and then decide wether to publish or not. Now I am looking for a way to get a message back to the user if publishing was blocked. Even I searched for two days now I only found the manipulation of the response description yet, which is displayed as a black, fading message box. This would be fine for me, but customer finds it not "alerting" enough, so I am urgently looking for a way, to send any custom HTML / Javascript signal.
See the Code, might explain it better:
public function doPublish() {
if ( check_something() ) {
#this works fine, but isn't enough
Controller::curr()->getResponse()->setStatusCode(500, 'Not Published!');
# here i would like to send any HTML / javascript signal back to the CMS admin ui.
return false;
}
parent::doPublish();
return true;
}
I would be very happy for any hint or idea!
I wish you nice holidays,
cheers
SF.