Extension:FlexForm

From mediawiki.org
MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
FlexForm
Release status: stable
FlexForm-logo.png
Implementation Parser extension
Description HTML5 rendering engine
Author(s) Sen-Saitalk (Wikibase Solutions) and others
Latest version 1.1.12
MediaWiki 1.35+
License No license specified
Download
Readme
ChangeLog
$wgFlexFormConfig
wikibasesolutions, forms, html5

Check usage and version matrix.

FlexForm is an enhanced HTML5 rendering engine.

It renders HTML5 form elements and allows to edit or create a page or multiple pages with one form.

This version 1 is a complete rewrite and stripped down version from the previous extension called WSForm.

Rendering of a form has been rewritten to support themes.

Documentation is currently being finished and can be found here : https://www.open-csp.org/DevOps:Doc/FlexForm

Installation[edit]

  • Download and place the file(s) in a directory called FlexForm in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'FlexForm' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Or install using Composer. Read more here : https://www.mediawiki.org/wiki/Composer/For_extensions

The Composer required name is : wikibase-solutions/flex-form

Configuration parameters[edit]

Detailed information can be found here : https://www.open-csp.org/DevOps:Doc/FlexForm

$wgFlexFormConfig['secure'] = true; //( default is true ). Will render form that make no sense when inspected in the browser
$wgFlexFormConfig['sec_key'] = ""; // A salt key for encryption. Used together with "secure" option. Must be set when using multiple instances of a wiki
$wgFlexFormConfig['auto_save_interval'] = 30000; // defaults to 3 minutes.
$wgFlexFormConfig['auto_save_after_change'] = 3000; // defaults to 3 seconds after last change
$wgFlexFormConfig['FlexFormDefaultTheme'] = "Plain"; // Currently the only form
$wgFlexFormConfig['rc_site_key'] = ""; // reCaptcha site key
$wgFlexFormConfig['rc_secret_key'] = ""; // reCaptcha secret key
$wgFlexFormConfig['can_create_user'] = false; // If FlexForm is allowed to create new users
$wgFlexFormConfig['file_temp_path'] = ""; // When using image upload conversion, we need a place to temporarily store images.
$wgFlexFormConfig['CreateAndEditForms']['allowedGroups'] = ["sysop","moderator"]; // Defaults to sysop. Only a user in the allowedGroups is able to edit pages with a FlexForm in the source.
$wgFlexFormConfig['CreateAndEditForms']['hideEdit'] = true; // Defaults to true. If a user is not in the allowedGroups then hide edit and editsource menu items for any page containing a FlexForm form.
$wgFlexFormConfig['create-seo-titles'] = true; // Defaults to false. Will filter any user input on creating a new page to be SEO friendly.
$wgFlexFormConfig['auto_save_btn_on'] = "Autosave On";
$wgFlexFormConfig['auto_save_btn_off'] = "Autosave Off";
$wgFlexFormConfig['use_smtp'] = false; // when sending email, should we use separate smtp ?
$wgFlexFormConfig['smtp_host'] = "";
$wgFlexFormConfig['smtp_authentication'] = true;
$wgFlexFormConfig['smtp_username'] = "";
$wgFlexFormConfig['smtp_password'] = "";
$wgFlexFormConfig['smtp_secure'] = "TLS";
$wgFlexFormConfig['smtp_port'] = 587;

Using the parser functions[edit]

When you are familiar with creating HTML5 forms you will have no problem using FlexForm. The documentation however is pretty extensive so we have it on a separate Wiki instalment. Documentation can be found here : https://www.open-csp.org/DevOps:Doc/FlexForm