.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ================ EXT: mth\_feedit ================ :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed by: Morten Hansen :Changed: 2006-05-31T00:21:06 :Author: Morten Tranberg Hansen :Email: mth@daimi.au.dk :Info 3: :Info 4: .. _EXT-mth-feedit: EXT: mth\_feedit ================ Extension Key: **mth\_feedit** Copyright 2005, Morten Tranberg Hansen, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.com .. _Table-of-Contents: Table of Contents ----------------- **EXT: mth\_feedit 1** **Introduction 1** What does it do? 1 **Users manual 1** Quick start: 1 **Configuration 2** Reference 2 **Known problems 2** **To-Do list 2** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This is an API for creating and editing records in forntend based on fe\_adminLib. mth\_feedit is generating a template for you, witch it passes to fe\_adminLib. So it lets fe\_adminLib handle the data evaluation, saving and updating, and thats why all the configuration proberties for fe\_adminLib is also availiable for mth\_feedit. **Features:** If the extension rtehtmlarea is installed mth\_feedit will use this to generate rte-textfields, and if rlmp\_dateselectlib is installed mth\_feedit will use this extension to generate a nice dateselecter with input fields evaluated as 'date' and 'datetime'. The RTE content is transformed according to the TS Config in Page TS RTE.default.FE .. _Users-manual: Users manual ------------ **IMPORTANT NOTE:** For examples of how to use this API see extensions 'news\_feedit' or 'joboffers\_feedit'These two extensions makes use of flexform\_ds.cml and setFlexFormVariables from the res/ directory, which you might find useful to :) **Extensions using this API need to be USER functions, not USER\_INT functions.** .. _Quick-start: Quick start: ^^^^^^^^^^^^ This section will give you a short overview about the basic setup requirements for mth\_feedit to work with your extension. If you want to use mth\_feedit from your extension the you should first make sure that the class is availiable. This is done by: :: require_once(t3lib_extMgm::extPath('mth_feedit').'class.tx_mthfeedit.php'); In the top of your extension class. The next an final thing you'll have to do is to make an instance of the tx\_mthfeedit class and call the ini function, like this: :: $mthfeedit = t3lib_div::makeInstance('tx_mthfeedit'); $content = $mthfeedit->init($this,$conf); If you pass the right configuration for mth\_feedit in $conf (see next section), mth\_feedit will do the job for you. .. _Coding-features: Coding features: ^^^^^^^^^^^^^^^^ **Overriding functions** As you properly already know mth\_feedit is build on top fe\_adminLib. mth\_feedit takes care of creating the templates for you, and fe\_adminLib handles the dataparsing and communication with the database. The templates mth\_feedit generates is divided into some subparts: required, email, edit, editmenu, create, delete, setfixed. If you want to generate your own templates for one of these classes ,its possible to override each of the functions in mth\_feedit there is generating a template class in your plugin class. mth\_feedit simply checks the caller for these functions, and if it exists it will call them instead of its own. (see function getDefaultTemplate in mth\_feedit source) .. _Configuration: Configuration ------------- .. _Reference: Reference ^^^^^^^^^ mth\_feedit is build on top of fe\_adminLib, so it takes all the configuration from that one. See TSREF section on fe\_adminLib. .. ### BEGIN~OF~TABLE ### .. _ALL-PROPERTIES-FROM-fe-adminLib: **ALL PROPERTIES FROM fe\_adminLib** """""""""""""""""""""""""""""""""""" .. container:: table-row Property **ALL PROPERTIES FROM fe\_adminLib** Data type Description mth\_feedit can take all proberties from fe\_adminLib (see TSREF). **Examples:** :: table = tt_news The 'table' proberty from fe\_adminLib defines the table to edit records from. :: create.fields = title, text, author, date edit.fields = title, text, author, date The 'fields' proberty from fe\_adminLib difines witch fields trom the table there is allowed to be changed. :: pid = 1 The 'pid' proberty from fe\_adminLib difines the page where the records is and should be saved **Extra features** : \- For property overrideValues on edit and create, and for property defaultValues on create. If you have a field with evaluation type 'date' or datetime, and you set the defaultValue (or overrideValue) for that field to 'now+30' this value will be transformed into currenttime+30days (it is possible to use minus as well). Default .. _show-fields: show\_fields """""""""""" .. container:: table-row Property show\_fields Data type list Description Defines witch fields from the 'fields' proberties there should be shown in the frontend. NOTE: The order of the fields in the list is the order of how the fields will be showed. **Extra features:** \- If option divide2tabs is set it is possible to divide the frontend form into tabs. To choose how this division should be it is possible to insert divider fields for each tabs in the show\_fields list. The grammar of these is '--div--;tabLabel', where tabLabel is a key in the language file of your plugin. Example: :: create.fields = --div--;name, firstname, lastname, -div--;address, street, town, country This will result in a form like: --------------------------------------- \| **Your Name** \| Your Address \| --------------------------------------- Firstname: \_\_\_\_\_\_\_\_\_\_\_ Lastname: \_\_\_\_\_\_\_\_\_\_\_ And: --------------------------------------- \| Your Name\| **Your Address** \| --------------------------------------- Street: \_\_\_\_\_\_\_\_\_\_\_ Town: \_\_\_\_\_\_\_\_\_\_\_ Country: \_\_\_\_\_\_\_\_\_\_ Default .. _divide2tabs: divide2tabs """"""""""" .. container:: table-row Property divide2tabs Data type boolean Description If set, it is possible to divide the frontend form into tabs. These tabs shall be defined in the show\_fields list, else no tabs will be shown. (see option show\_fields) Default .. _required-marker: required\_marker """""""""""""""" .. container:: table-row Property required\_marker Data type String Description The marker there is displayed in front of required fields. Default \* .. _delete-preview: delete.preview """""""""""""" .. container:: table-row Property delete.preview Data type boolean Description Decides id there should be a preview mode before delete of a record. NOTE: This option is close related to the 'delete' option from fe\_adminLib whitch decides if it should be possible to delete a record Default 1 .. _create-preview-dontDisplayEmptyFields: create.preview.dontDisplayEmptyFields """"""""""""""""""""""""""""""""""""" .. container:: table-row Property create.preview.dontDisplayEmptyFields and edit.preview.dontDisplayEmptyFields Data type boolean Description It set empty fields will not be displayed in preview on the web or in emails. NOTE: If empty fields is not removed with this the label no\_value from locallang is displayed when fields is empty (this label is not saved to the DB, only displayed on the web and in emails). Default .. _fe-cruser-id: fe\_cruser\_id """""""""""""" .. container:: table-row Property fe\_cruser\_id Data type string Description This points to the field in the table where fe\_adminLib will save the feuser owner of the record. NOTE: If set, this will overwrite the following field in TCA $GLOBALS['TCA'][$theTable]['ctrl']['fe\_cruser\_id'] Example (from news\_feedit): fe\_cruser\_id = tx\_newsfeedit\_fe\_cruser\_id Default .. _fe-crgroup-id: fe\_crgroup\_id """"""""""""""" .. container:: table-row Property fe\_crgroup\_id Data type string Description This points to the field in the table where fe\_adminLib will save the fegroup there are allowed to edit the record. NOTE: If set, this will overwrite the following field in TCA $GLOBALS['TCA'][$theTable]['ctrl']['fe\_crgroup\_id'] Example (from news\_feedit): fe\_crgroup\_id = tx\_newsfeedit\_fe\_crgroup\_id Default .. _requireLogin: requireLogin """""""""""" .. container:: table-row Property requireLogin Data type boolean Description If set, a feuser has to be logged in to create or edit a record. Default .. _no-header: no\_header """""""""" .. container:: table-row Property no\_header Data type boolean Description If set, mth\_feedit will not display automatic generated h1 headers for the form. Default .. _text-in-top-of-form: text\_in\_top\_of\_form """"""""""""""""""""""" .. container:: table-row Property text\_in\_top\_of\_form Data type string/stdWrap Description Text shown in top of every form generated by mthfeedit. If the form needs som general explanation for the users, you should put it here. Default .. _text-in-top-of-preview: text\_in\_top\_of\_preview """""""""""""""""""""""""" .. container:: table-row Property text\_in\_top\_of\_preview Data type string/stdWrap Description Text shown in top of every preview generated by mthfeedit. If the preview needs som general explanation for the users, you should put it here. Default .. _keep-piVars: keep\_piVars """""""""""" .. container:: table-row Property keep\_piVars Data type list Description A comma seperated list of the piVars from the caller of mth\_feedit to include in the forms generated by mth\_feedit. **Example:** :: plugin.tx_daimievent_pi1.mthfeedit { keep_piVars = uid } The example will add the value of the piVar 'uid' in the plugin tx\_daimievent\_pi1 to the forms generated by mth\_feedit as a hidden input field. Default .. _help: help """" .. container:: table-row Property help Data type boolean Description If set, and context sensitive help is availiable, a little icon with help will be displayed together with the fields. See help.file under here. Default .. _help-file: help.file """"""""" .. container:: table-row Property help.file Data type Description The is the locallang csh file with the labels for the tabel. If no file is defined, no help text will be shown. **Example:** :: plugin.tx_joboffersfeedit_pi1.mthfeedit { help = 1 help.file = EXT:ab_minijoboffers/locallang_csh_jobs.php } Default .. _help-type-keys: help.type\_keys """"""""""""""" .. container:: table-row Property help.type\_keys Data type list Description List of type keys from csh array for each field to display in the help window. Known supported values are: description,details,syntax,seeAlso See the TYPO3 Core Doc: Inside TYPO3, for more informations. Default description .. _help-window-style: help.window.style """"""""""""""""" .. container:: table-row Property help.window.style && help.window.height && help.window.width Data type string Description This is visual options for the little help window (displayed when clicking the help icons, see option help). The style is the the stylesheet of the window, the height is the height of the window and the width is the width of the window :) **Example:** :: plugin.tx_newsfeedit_pi1.mthfeedit { help.window { style ( .tx-newsfeedit-pi1-help-header { font-weight:bold; } ) width = 450 height = 155 } } Default height = 40 width = 300 .. ###### END~OF~TABLE ###### [tsref: mth\_feedit] .. _generated: ((generated)) """"""""""""" .. _Example: Example ~~~~~~~ Here is an example of how to use the stuff from the reference (taken from the extension news\_feedit): :: plugin.tx_newsfeedit_pi1.mthfeedit { allowedGroups = 1 pid = 9 infomail = 1 email.from = FROM@EMAIL.COM email.fromName = FROM NAME email.admin = ADMIN@EMAIL.COM email.field = FIELD FROM RECORD WHERE USERS EMAIL SHOULD BE FOUND. help = 1 help { file = EXT:tt_news/locallang_csh_ttnews.php window { style ( .tx-newsfeedit-pi1-help-body { background-color:#eeeeee; font-size:small; } .tx-newsfeedit-pi1-help-header { font-weight:bold; } ) width = 450 height = 155 } } } .. _Known-problems: Known problems -------------- \- Let me know, if you find some .. _To-Do-list: To-Do list ---------- \- Nothing right now |img-1| EXT: mth\_feedit - 4 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102