Hi,
the output of a CKEditor field is postprocessed by the MarkupHTMLPurifier module, which has no configuration settings in the backend. I want to tweak the html output, so I'm trying to change the MarkupHTMLPurifier settings. The easiest method would be, to change one line in MarkupHTMLPurifier.module, but I want to be save when updating ProcessWire. So I had the idea to change the module settings on runtime. To achieve that, I wrote following module:
class configModifer extends WireData implements Module {
public static function getModuleInfo() {
return array(
'title' => 'Config Modifier Test',
'version' => 1,
'summary' => 'This module tries to change the settings of another module on runtime.',
'singular' => true,
'autoload' => true,
);
}
public function init() {
$this->addHookBefore('Inputfield::render', $this, 'beforeInputFieldRender');
}
public function beforeInputFieldRender (HookEvent $event) {
$purifier = wire()->modules->get('MarkupHTMLPurifier');
$purifier->set('HTML.Doctype', 'HTML 4.01 Transitional');
}
}
Unfortunately this doesn't work. The Hook is called, but it doesn't change the settings of MarkupHTMLPurifier.
How can I change the module settings of MarkupHTMLPurifier on runtime? Or is there another way to achieve that?
Thanks in advance.