Coder Social home page Coder Social logo

friendsofredaxo / mform Goto Github PK

View Code? Open in Web Editor NEW
77.0 10.0 19.0 26.5 MB

Spielend einfach umfangreiche Modul-Input-Formulare erzeugen.

License: MIT License

JavaScript 16.53% PHP 77.67% CSS 5.80%
redaxo forms content editing backend redaxo-addon hacktoberfest form form-builder

mform's Introduction

MForm - REDAXO Addon

Poster

MForm facilitates the creation of REDAXO module inputs. With MForm, you can not only create forms, but also visually design them exactly to your own specifications thanks to flexible templates. It allows you to create all standard REDAXO form elements and includes several extra widgets that can be easily integrated into modules.

But it doesn’t stop there! MForm also enhances YForm and rex_form with additional widgets. Need a custom link field or a chic image list? No problem, MForm has you covered.

New in Version 8

The highlight of the latest version? The brand-new Form Repeater! This feature replaces the old MBlock AddOn and offers the ability to not only repeat form elements but also nest them at multiple levels – something that was not possible with MBlock. This allows for the construction of even more complex forms.

The included demo collection allows for immediate testing of module codes. Modules can be directly installed and tested. The codes are all commented. And additionally, there is a comprehensive documentation 📒.

Features

Basic Functionalities

  • Creation of module inputs via PHP: The foundation for working with MForm.
  • Multi-column forms: Layout options for structuring the forms.
  • Inline form elements: For compact form design.
  • HTML5 form elements: Utilization of modern web standards.
  • Datalists: For enhanced input options in forms.

Advanced Design and Interactivity

  • Custom widgets for linking (including Yform) and images: Special widgets for frequently needed functions.
  • Factory that allows easy outsourcing of form parts: Simplifies the reuse of form components.
  • Collapse, Tabs, Accordions: Elements for designing dynamic, interactive forms.
  • Wrapper elements via Checkbox, Radio, or Select controlled collapse elements: Provides interactive controls for user guidance.
  • Form output customizable via fragments: Allows for flexible design of the form presentation.

Special Features

  • Integrated Form Repeater: Replaces MBlock and allows nested form elements.
  • REDAXO JSON Value Utilization: Integration of REDAXO-specific data structures.
  • SQL fields: Direct integration of database queries.
  • Continuous MBlock Compatibility: Ensures compatibility with existing MBlock installations.
  • Module examples for direct installation: Provides ready-to-use templates for various use cases.

Form Repeater

The Form Repeater allows dynamic repetition of form elements while realizing nesting at multiple levels.

Migration from MBlock to MForm 8

Der neue Repeater ist nur eingeschränkt mit MBlock kompatibel.

Akuell funktionieren nicht bei einer Migration:

  • CustomLinkField
  • addMediaListField
  • addLinkListField

MBlock Module

// Base ID for managing form elements
$id = 1;

// Initialize MForm
$mform = new MForm();

// Add a fieldset
$mform->addFieldsetArea('Team member');

// Add a text field, referring dynamically to a JSON format
$mform->addTextField("$id.0.name", array('label' => 'Name'));

// Add a media field saved by MBlock in JSON
$mform->addMediaField(1, array('label' => 'Avatar'));

// Output the form with MBlock, which allows dynamic handling of blocks
echo MBlock::show($id, $mform->show(), array('min' => 2, 'max' => 4));

The same module in MForm 8

To determine the necessary field keys, a dump might be needed beforehand. Note: From the original MBlock Mediafield 1, it becomes: 'REX_MEDIA_1'

use FriendsOfRedaxo\MForm;

// Repeater initialization ID with the base ID of the original MBlock section
$id = 1;

// Create a new MForm instance with the factory method and directly integrate a repeater
echo MForm::factory()
    ->addRepeaterElement(
        $id, 
        MForm::factory()
            ->addFieldsetArea('Team member', 
                MForm::factory()
                    ->addTextField('name', ['label' => 'Name'])
                    ->addMediaField('REX_MEDIA_1', ['label' => 'Avatar'])
            ),
        true, 
        true, 
        ['min' => 2, 'max' => 4]
    )
    ->show();

Installation

MForm can be directly installed via the Redaxo Installer. MForm Redaxo Addon Page

  1. Log in to REDAXO
  2. In the backend under "Installer > Download new", search for "MForm" and click on "view" under "Function"
  3. In the current version list, click "download" under "Function"
  4. Install and activate MForm under "AddOns"

Output

MForm utilizes REDAXO variables provided by REDAXO, either as classic or JSON values. For more information, see the REDAXO Documentation.

License

MForm is licensed under the MIT License.

Changelog

See CHANGELOG.md

Author

Friends Of REDAXO

Credits

Project Lead

Joachim Dörr

2nd Maintainer

skerbis

Mform Repeater

Thorben eaCe

Docs & Testing

alexplusde

mform's People

Contributors

alxndr-w avatar ascky-thorben avatar bitshiftersgmbh avatar christophboecker avatar danielweitenauer avatar danspringer avatar dgrothaus-mc avatar dpf-dd avatar dtpop avatar eace avatar elricco avatar geri2017 avatar ingowinter avatar interweave-media avatar joachimdoerr avatar lexplatt avatar marcohanke avatar nandes2062 avatar olien avatar omphteliba avatar philippparth avatar schuer avatar skerbis avatar staabm avatar tobiaskrais avatar ynamite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mform's Issues

HTML-Element

Ausgabe von eigenen HTML-Elementen in einem mform-Block

z.b.:
$objForm = new mform();
// headline
$objForm->addHeadline('Text-Input und Hidden Elemente');
//html
$objForm->addHtml('hier html ausgabe oder z.b. javascript');

$mform->addTextField + Anführungszeichen

Hi,

wenn man das Eingabefeld, das $mform->addTextField() liefert, mit einem Anführungszeichen befüllt, wird der Inhalt danach abgeschnitten. Sollte stattdessen escaped werden, oder?

$mform->show_mform() und ID für Elemente

Moin

Ich stolpere jedesmal über echo $mform->show_mform(); Besser fände ich eine Methode in $mform->get(), die das Formular als String zurückgibt und eine zusätzliche Methode $mform->show(), die direkt ausgibt.

Fein wäre es auch, wenn ich den Elementen eine ID geben könnte. Momentan bekommt jedes Element eine ID im Format "rv53" zugewiesen, eine manuelle Zuweisung über $mform->setAttributes ist nicht möglich.

LG Ingo

Strict Standards Meldung : Checkbox

Hi Joachim,

wenn ich so etwas nutze

$objForm->addCheckboxField(9,array(1=>''),array('label'=>'Bildrahmen'));

erhalte ich im Backend bei editieren des Moduls folgende Meldung:

Strict Standards: Only variables should be passed by reference in /Applications/MAMP/htdocs/xx/redaxo/include/addons/mform/lib/classes/class.parse_mform.php on line 38

LG
Oliver

Error nach Reload der Moduleditansicht nach Logintimeout

Fatal error: Call to a member function getLanguage() on a non-object in /kunden/301311_96450/rp-hosting/1/1/webseiten/goetz2013/redaxo/include/addons/mform/functions/function.parsley.php on line 21

Verhindert dadurch, dass das Login Fenster erscheint.

bei z.B. folgender URL: redaxo/index.php?article_id=37&page=content&mode=edit&slice_id=47&function=add&clang=0&ctype=1&module_id=9#

Fehlendes FormElement hinzufügen "fieldset"

"Fieldset" wurde vergessen und muss noch hinzugefügt werden - ähnlich wie z.b. Headlines nur mit der Logig wenn angelegt bis zum nächsten "fieldset" alle Form Elemente umschließen und wenn kein weiteres "fieldset" dann am Ende der Elemente schließen.

Template auf Div Layout umstellen

Das aktuell verwendete Tabellen Template ist nicht wirklich das gelbe vom Ei und sollte dringend durch ein moderneres Div-bassiertes Layout ersetzt werden.

Variablenname $objForm in site.demo.php

In den Beispielen packst du das mform Objekt in die Variable $objForm. Ich fände $mform als Variable wesentlich eingängiger (und auch leichter zu tippen).

Undefined index: radio-attr

Hallo Joachim,

wenn ich das Code-Beispiel Blanko aus der Dokumentation benutze, kommt folgende Fehlermeldung:

bildschirmfoto 2014-01-20 um 15 11 31

Nur das ich das kurz auch dokumentiert habe, weil ich es am Wochenende gesagt habe.

Danke nochmal für das tolle Addon!

Mform für r5 fit machen

R5 ist ja jetzt schon soweit, dass sich die Strukturen für Addons nicht mehr ändern werden, dadurch kann MForm jetzt final angepasst werden, natürlich müssten die neuen Features einfließen.

Attribute für Checkboxen und Radiobuttons hinzufügen

Checkboxen und Radiobuttons können keine Attribute zugewiesen werden, es gilt da auch das Problem zu lösen, wie den unterschiedlichen Radiobuttons zur Radiobutton-Gruppe unterschiedliche Attribute zugewiesen werden können.

Fatal error: Call to a member function getLanguage()

Hi,

wenn ich meinen Chrome schliesse ohne mich aus Redaxo auszuloggen und ihn dann wieder öffne (Chrome öffnet die alten Tabs wieder) bekomme ich immer:

Fatal error: Call to a member function getLanguage() on a non-object in ../redaxo/include/addons/mform/functions/function.parsley.php on line 21

lg
ingo

Ausgabe von " array() "

Hallo,

wenn ich folgenden Code nutze (funktioniert)

$options = array("hallo","test");

$objForm = new mform();

    $objForm->addMultiSelectField(1);
    $objForm->addOptions($options);
    $objForm->setSize(5);
    $objForm->setLabel('Slider wählen');

echo $objForm->show_mform();  

wird bei der Eingabe über der mform Ausgabe

array()

ausgegeben.

Grüße
Oliver
(Und danke für die Tipps!)

Validierung mit Abhängigkeit

Hi Joachim,

keine Ahnung ob das geht aber ich würde gerne Felder in Abhängigkeit zueinander validieren.

Ist z.B. eine Bild ausgewählt muss ein Alt Text vergeben werden und umgekehrt...

LG
Oliver

Ausgaben CSS/Javascript

CSS und JavaScript am besten über die index.php per Parameter gesteuert ausgeben

.htacces im Unterverzeichnis ist suboptimal, verursacht oft Probleme bzw. funktioniert nicht überall

notices / warnings

Hi, ich bekomme hier noch einiges an notices:

Notice: Undefined variable: strLangData in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.get_mform_array.php on line 564
Warning: Invalid argument supplied for foreach() in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.get_mform_array.php on line 461
Notice: Undefined variable: strLangData in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.get_mform_array.php on line 564
Warning: Invalid argument supplied for foreach() in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.get_mform_array.php on line 461
Warning: Invalid argument supplied for foreach() in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.get_mform_array.php on line 339
Notice: Undefined index: label in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.parse_mform.php on line 245
Notice: Undefined index: label in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.parse_mform.php on line 245
Notice: Undefined index: label in /media/sf__htdocs/redaxo/include/addons/mform/lib/class.parse_mform.php on line 113

Strict Standards config.inc.php line 55/56

Kommt direkt nach der Installation auf jeder Seite im Backend:

Strict Standards: Only variables should be passed by reference in /.../redaxo/include/addons/mform/config.inc.php on line 55

Strict Standards: Only variables should be passed by reference in /.../redaxo/include/addons/mform/config.inc.php on line 56

Hoster: Domainfactory
REDAXO: 4.5.1
PHP: 5.4.9

Tabs integrieren

Tabs z.b. Bootstrap Tabs oder jQuery UI Tabs - sollte nach dem selben Prinzip wie fieldsets integriert werden.

Fehler mit Rex 4.6

Strict Standards: Only variables should be passed by reference in /123/12345/123/redaxo/include/addons/mform/config.inc.php on line 55

REX_LINKLIST_BUTTON fehlerhaft

Hi Joachim,

REX_LINKLIST_BUTTON wird zwar ausgegeben und gespeichert, aber sobald ich das Modul erneut öffne, ist der Inhalt leer. Also die ausgewählten Artikel sind weg, obwohl diese in der DB sind. Glaube da ist ein Fehler in der Ausgabe oder ähnliches.

LG
Hirbod

Arrays

Hallo Joachim,

wäre so etwas möglich? Und wenn ja wie sähe die Ausgabe aus?

$objForm->addMediaField(2.1,array('label'=>'Datei'));
$objForm->addTextField(2.2,array('label'=>'ALT Text','style'=>'width:500px'));
$objForm->addTextField(2.3,array('label'=>'Bildunterschrift','style'=>'width:500px'));

LG
Oliver

Wiki Dokumentation fertig stellen

Sollte schon mal bald fertig werden... Vor allem der Bereich mit den einzelnen Formular Elementen, Templates ist ein Zusatz der erstmal nicht voll nötig ist, die Handhabung für die Modulerstellung ist erstmal wichtiger.

Eventuell noch "Demo Modul Inputs" anbieten, eventuell die Module aus der Redaxo Standard Demo -> vielleicht auch ein Redaxo Datenbank Import der Standard Demo anbieten in der die Module Formulare durch MForm generiert werden...

Mehrsprachige Labels ermöglichen

Das RexBackend ist ja mehrsprachig, ein Problem dabei ist, dass Formular Labels nur mühselig mit verschiedenen Sprachen versehen werden können, hier wäre eine einfache Lösung via array schick: $this->setLabel(array('de'=>'DE Label','en'=>'EN Label'));

RexMarkitup und MForm

Hallo Joachim,

ich verwende gerade RexMarkitup in MForm. Dort gibt es zwei Probleme. Das erste ist eher kosmetisch: die Buttonbar von RexMarkitup hat einen komischen Abstand nach unten (erstes Bild).
Das eigentliche Problem ist der Fullscreenmodus, der bei Verwendung mit MForm so verschoben ist, das er nicht mehr nutzbar ist (zweites Bild).

Hast du eine Idee, oder ist das eher ein Problem von RexMarkitup?

Ansonsten ein super Addon, genau wie Basecondition. Vielen Dank dafür!

Viele Grüße
Ingo

image
image

Angepasste Verlinkung

Hallo,

wir (gn2) würden gerne für unser neue Master-Installation MForm verwenden.
Was wir allerdings noch sehr vermissen ist eine erweiterte Verlinkung.

Momentan verwenden wir eine, von Dave + Christoph programmierte, Erweiterung. Diese ermöglicht uns nicht nur interne, sondern auch externe und Dokumentverlinkungen für ein Feld auszuwählen.

link-intern_extern_document

Wäre das nicht für MForm ganz praktisch und würde für dich in Frage kommen? :)

LG jessi

Validierungen

Klasse wäre wenn man die Eingabefelder analog xform validieren könnte,
also z.b. notempty
ein paar validierungen als standard und evtl. zusätzliche als plugin möglich machen ...

Warning Invalid argument

Warning: Invalid argument supplied for foreach() in /kunden/301311_96450/rp-hosting/1/1/webseiten/goetz2013/redaxo/include/addons/mform/lib/class.get_mform_array.php on line 529

Theme Zip Import- und Export- Funktion

Für die Themen von mform wäre es schön wenn eine Import- und Export-Funktion es ermöglichen würde schnell sein eigenes Thema hochladen oder ein Thema via Export sichern zu können.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.