WCF 2.1.x - PHP#
WoltLab Suite 3.0 finally made the transition from raw bbcode to bbcode-flavored HTML, with many new features related to message processing being added. This change impacts both message validation and storing, requiring slightly different APIs to get the job done.
Input Processing for Storage#
The returned HTML is an intermediate representation with a maximum of meta data embedded into it, designed to be stored in the database. Some bbcodes are replaced during this process, for example
<strong>…</strong>, while others are converted into a metacode tag for later processing.
1 2 3 4
$messageObjectID can be zero if the element did not exist before, but it should be non-zero when saving an edited message.
Embedded objects need to be registered after saving the message, but once again you can use the processor instance to do the job.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Rendering the Message#
The output processor will parse the intermediate HTML and finalize the output for display. This step is highly dynamic and allows for bbcode evaluation and contextual output based on the viewer's permissions.
1 2 3 4
At some point there can be the need of a simplified output HTML that includes only basic HTML formatting and reduces more sophisticated bbcodes into a simpler representation.
1 2 3 4
text/plain output type will strip down the simplified HTML into pure text, suitable for text-only output such as the plaintext representation of an email.
1 2 3 4
Converting from BBCode#
Enabling message conversion for HTML messages is undefined and yields unexpected results.
Legacy message that still use raw bbcodes must be converted to be properly parsed by the html processors. This process is enabled by setting the fourth parameter of
1 2 3 4
Extracting Embedded Objects#
process() method of the input processor is quite expensive, as it runs through the full message validation including the invocation of HTMLPurifier. This is perfectly fine when dealing with single messages, but when you're handling messages in bulk to extract their embedded objects, you're better of with
processEmbeddedContent(). This method deconstructs the message, but skips all validation and expects the input to be perfectly valid, that is the output of a previous run of
process() saved to storage.
1 2 3 4 5
Breadcrumbs / Page Location#
Breadcrumbs used to be added left to right, but parent locations are added from the bottom to the top, starting with the first ancestor and going upwards. In most cases you simply need to reverse the order.
Breadcrumbs used to be a lose collection of arbitrary links, but are now represented by actual page objects and the control has shifted over to the
1 2 3 4 5 6
Pages and Forms#
$activeMenuItem has been deprecated for the front end and is no longer evaluated at runtime. Recognition of the active item is entirely based around the invoked controller class name and its definition in the page table. You need to properly register your pages for this feature to work.
setLocation() method that is used to set the current page location based on the search result.
SearchIndexManager::update() have been deprecated and forward their call to the new method