Replace the current paragraphwidget with an enhanced version of the textwidget

Registered by KaDMiO

The new textwidget should have 3 working modes:
    - text: prints its content just as they are, but replacing all html entities
    - bbcode: standard bbcode parsing
    - html: prints plain html

Blueprint information

Status:
Complete
Approver:
None
Priority:
Essential
Drafter:
None
Direction:
Approved
Assignee:
KaDMiO
Definition:
Approved
Series goal:
Accepted for v1
Implementation:
Implemented
Milestone target:
milestone icon alpha-3
Started by
KaDMiO
Completed by
KaDMiO

Whiteboard

New properties of the TextWidget:
    $working_mode: Defines the way the TextWidget behaves. Can have 3 possible values defined as constants in compinit.php:
        - TextW_TEXT_MODE: Prints the content just as it is, replacing all HTML entities.
        - TextW_BBCODE_MODE: Parses the text for BBCode.
        - TextW_HTML_MODE: Prints the content without modifications, but parses for closed tag AECode.
    $ID: Functionality inherited from the widget class.
    $STYLES: Array will contain information about all possible internal elements of a paragraph, including the paragraph by itself. The styling method will work on a double basis:
        - Default styling for the wrapping div. (NOTE: When in BBCODE mode, the default styling is applied to paragraphs inside of the wrapping div, and not the div by itself.) The function used for this is addAttribute($name, $value), which modifies the widget as a whole.
        - Styling of all additional components and component groups. For this to be done, one has to create a stylesheet for all subcomponents with the function addAditionalStylesheet($name). This function will return an integer indicating the index number of the stylesheet for it to be modified with the function modifyAditionalStylesheet($index, $attribute, $value).

Example of all this:

$Widget = new TextWidget('TESTWIDGET',TextW_BBCODE_MODE,'Testing... áéíóú <a href="#"> Link </a> [url=http://www.google.com]Link to Google[/url]');
$Widget->disableLanguageModule();
$Widget->addAttribute('text-align', 'center');
$index = $Widget->addAditionalStylesheet(link_hover);
$Widget->modifyAditionalStylesheet($index, 'color', '#FF00FF');

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.