Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Write a object oriented UI library #968

@Bloke

Description

@Bloke

It's high time to phase out most/all of txplib_forms.php and parts of txplib_html.php. To achieve this, we should build an extensible OO user interface library using inheritance and interfaces.

Benefits:

  • Removal of the stupid overloaded parameter function signatures (like fInput() with 12 params!) in favour of clean constructors with setters.
  • Additional attributes can be catered - e.g. data- attributes.
  • Cascading and compound UI elements can be built more easily from the base components - in core and in plugins - reducing code.
  • Potential to construct one or more tags that output elements, which allows forms to be built.
  • Potential to use the tags to build the admin-side UI from templates, which offers endless workflow customization options or easily buildable dashboards for people that know what they're doing.

Downsides:

  • It's OO, so possibly slower than raw function calls. Needs to be optimised to maintain speed.
  • Bigger product footprint overall because each discrete file has preamble text.

So far:

Class Notes Proposed names
AdminAction Replaces eInput(), sInput(), tInput() -
AdminAnchor Replaces aLink(), eLink, sLink(), wLink() -
AdminDelete Replaces dLink() -
Anchor Replaces href() -
Checkbox A single <input type="checkbox" /> tag -
CheckboxSet An <input type="checkbox" /> tag inline set with labels -
Disclosure A twistable panel behind an anchor, which replaces our current wrapGroup and wrapRegion -
Form A <form /> tag -
Input An <input /> tag -
InputLabel An <input /> tag and associated label -
InputSet An <input /> tag set. Primarily of use for creating a series of hidden inputs -
Label A single <label /> tag -
Number A numeric <input /> tag -
OnOffRadioSet An <input type="radio" /> tag set with on/off options -
OptGroup An <optgroup /> tag and collection of options -
Option An <option /> tag -
Para A <p /> tag. Replaces graf() -
Radio A single <input type="radio" /> tag -
RadioSet An <input type="radio" /> tag inline set with labels -
Script A CSP-aware <script /> tag -
Select A <select /> list tag -
SelectTree A <select /> list tag built from a tree-based record set -
Span A <span /> tag. Replaces span() -
Style A CSP-aware <style /> or <link /> tag -
Tag Base widget - a tag for creating custom widgets -
TagCollection Useful for creating a custom collection of widgets -
Textarea A <textarea /> tag -
Token A hidden <input /> tag containing a CSRF token -
UploadForm A file upload <form /> tag -
YesNoRadioSet An <input type="radio" /> tag set with yes/no options -

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions