This is a first idea, initially coming from thoughts about how to deprecate and which facility to replace ConditionValidator, which is more or less a hack to achieve a global condition.
A first step towards this goal would be to enhance the ConditionValidator by a reference expression overgiven as configuration parameters, which can be given in install.xml:
or even without giving a classname but defining a condition directly like in the <conditions> section:
Further, the generic panel validator API should have the possibility to overgive:
the action to perform on validation error (error, warn)
the error message translation id if a validation error occurs
the default answer in case of a warning (Yes to ignore and continue to the next panel, No to review the input parameters).
This may look like this:
As a result you may have a validator optionally defined like this:
or in the second variant: