OldSchoolForms

OldSchoolForms

Intro

OldSchoolForms need a config.xml and a simple start script per table.
the index.php looks like this. the config.xml file is in the same directory.

<?php
include ("../../conf/config.inc.php");
new bx_editors_dbform_main();
?>

You can generate a skeleton config.xml out of the DB definitions with the help of MDB2 and a little xslt.
You'll find the needed tools in inc/bx/tools/mdb2forms ( http://svn.liip.ch/repos/public/bxcmsng/trunk/inc/bx/tools/mdb2forms/ )

Field Types

text

<bxco:field name="titel" type="text" descr="titel"></bxco:field>

fixed (uneditable)

<bxco:field name="id" type="fixed" descr="ID"></bxco:field>

There's also the subtype named datetime for nicer formatting of date fields

select

<bxco:field name="cat" type="select" descr="Geschäftsbereich">
<bxco:options texts="Eventservices|Interiors|Exhibits|" values="eventservices|interiors|exhibits|"/>
</bxco:field>

the | at the end in bxco:options is important...

foreign fields

<bxco:field name="personenforeignid" descr="Kontaktperson" type="foreign">
<bxco:foreign table="personen" field="concat(name,' ',vorname)" orderby="name, vorname"/>
</bxco:field>

n2m

(better example needed)

<bxco:field name="Document2Object" type="n2m" alternativeDescr="Document" descr="Parent::Document">
<bxco:n2m thisfield="foreignobjectid" thatfield="foreigndocumentid" objectfield="objectname" objectfieldvalue="Projekte"/>
<bxco:foreign>
<bxco:table name="Document" field="title" orderby="title"/>
</bxco:foreign>
</bxco:field>

objectfieldvalue is optional

date/time

<bxco:field name="dc_date" type="datetime" descr="Datum"/>

date and time are also allowed as type

image upload

<bxco:field name="bild" type="file" subtype="image" descr="BILD">
<bxco:imagefields width="imgwidth" height="imgheight" format="imgformat"/>
</bxco:field >

bxco:imagefields is optional. the fields in width, format, height have to exists in the db.

the attribute downloaddir in in ''bxco:fields" has also to be set and writable.

file upload

<bxco:field name="pdf" type="file" descr="PDF" info="fileinfo">
<bxco:fileinfofields size="pdfsize" mimetype="filedata_mimetype"/>
</bxco:field >

bxco:fileinfofields plus the attribute info are optional. The fields in size and mimetype have to exists in the db. And they are optional, too.

the attribute downloaddir in in ''bxco:fields" has also to be set and writable.

Chooser

<bxco:chooser field="title" orderby="title" />

as child of bxco:chonfig

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
These projects are supported by Liip AG