Disabling plain text
I'm curious as to if there is some way to change the "Format comments as" box in the options.
Basically, I want to allow HTML, and Textile, but use both, and have no selection for anything :)
0
This discussion has been closed.
Comments
Then you'd have to write an extension that follows both the rules of html and textile.
I imagine it would be something like this:
// Remove all existing formatters from the StringManipulator object $Context->StringManipulator->Formatters = array(); $Context->StringManipulator->GlobalFormatters = array(); // Declare your new StringFormatter $Context->Dictionary["HTMLExtile"] = "HTMLExtile"; class HTMLExtileFormatter extends StringFormatter { function Parse($String, $Object, $FormatPurpose) { // Do your string manipulation here... return $String; } } // Instantiate the formatter and add it to the context object's string manipulator $HTMLExtileFormatter = $Context->ObjectFactory->NewContextObject($Context, "HTMLExtileFormatter"); $Context->StringManipulator->AddManipulator("HTMLExtile", $HTMLExtileFormatter);
I haven't tested it, of course, but I'm pretty sure that will do it.
With a previous text comment, you get this message:
"Notice: Undefined index: Text in /path/to/library/Framework/Framework.Class.StringManipulator.php on line 98
Fatal error: Call to a member function on a non-object in path/to/library/Framework/Framework.Class.StringManipulator.php on line 100".
To fix it you just need to add in the extension:
$Context->Configuration['DEFAULT_FORMAT_TYPE'] = 'HTMLExtile';