DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: FORMidable Utils

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Manuel Rego
Changed:2007-08-08T11:33:00
Author:Manuel Rego Casasnovas, Iván Gómez Rodríguez
Email:mrego@igalia.com, igomez@igalia.com
Info 3:
Info 4:

EXT: FORMidable Utils

Extension Key: gl_formidable_utils

Copyright 2000-2002, Manuel Rego Casasnovas, Iván Gómez Rodríguez, <mrego@igalia.com, igomez@igalia.com>

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

EXT: FORMidable Utils 1

Introduction 1

Users manual 1

Example: selector countries 1

Tutorial 2

_getCountries() 2

_getCountriesIsocodes($aData, $aParams, $oForm) 2

_getCountryZones($aData, $aParams, $oForm) 2

_getCountryZonesIsocodes($aData, $aParams, $oForm) 2

_getLanguages 2

_getLanguagesIsocodes($aData, $aParams, $oForm) 3

Known problems 3

To-Do list 3

Changelog 3

Introduction

This extension provides some functions to be called from the configuration files of Ameos FORMdiable (see extension ameos_formidable ). These functions return data from static tables (see extension static_info_tables ) in the correct format to show in a HTML selector of FORMidable forms.

This extension contains a set of functions for use as callbacks in LISTBOX renderlerlets of FORMidable forms.

Users manual

The class tx_glformidableutils_div has common functions for Ameos FORMdiable LISTBOXrenderlets.

Example: selector countries

  • FORMidable XML configuration file:

    <renderlet:LISTBOX name="country">
            <data defaultvalue="65">
                    <userobj>
                            <extension>tx_glformidableutils_div</extension>
                            <method>_getCountries</method>
                    </userobj>
            </data>
    
    <custom>size=”10”</custom>
    
    </renderlet:LISTBOX>
    
  • Result:

img-1

Tutorial

Next the functions of the class tx_glformidableutils_div are explained.

_getCountries()

Returns the list of countries from the table static_countries , with the country uid as value and the country name in the current language as caption.

_getCountriesIsocodes($aData, $aParams, $oForm)

The same that the previous function, but in this case with the country ISO code as value.

The param codetype can be specified from FORMidable, by default the codetype is '2':

<renderlet:LISTBOX name="country">
        <data defaultvalue="65">
                <userobj>
                        <extension>tx_glformidableutils_div</extension>
                        <method>_getCountries</method>
                        <params>
                                <param>
                                        <name>codetype</name>
                                        <value>3</value>
                                </param>
                        </params>
                </userobj>
        </data>
<custom>size=”10”</custom>
</renderlet:LISTBOX>

_getCountryZones($aData, $aParams, $oForm)

Returns the list of country zones from the table static_country_zones , with the country zone uid as value and the country zone name in the current language as caption.

The param field_name can be specified from FORMidable, by default the field_name is 'country'. This is the form field where the country is selected, the method get the country zones only for the country from this form field.

_getCountryZonesIsocodes($aData, $aParams, $oForm)

The same that the previous function, but in this case with the country zone ISO code as value.

Like the previous the param field_name can be specified from FORMidable. Morveover, like the function _getCountriesIsocodes , the param codetype can be specified from FORMidable as well.

_getLanguages

Returns the list of languages from the table static_languages , with the language uid as value and the language name in the current language as caption.

_getLanguagesIsocodes($aData, $aParams, $oForm)

The same that the previous function, but in this case with the language ISO code as value.

Known problems

There is a problem related with a bug in the loadTCA function. The problem is that have to add some lines for translating the data from static tables.

For more information see the bug: http://bugs.typo3.org/view.php?id=2397 . The thread where is the solution: http://lists.netfielders.de/pipermail/typo3-english/2007-Ma y/039325.html .

Solution : The function init in class tx_glformidableutils_div loads the additional fields for the static tables. It's necessaryto call this function before use the class.

tx_glformidableutils_div::init();

This is only a partial solution, in this function the method loadTcaAdditions is called for all the static_info_tables extensions publish in TER nowadays. But if you use an extension that is not included in this method you have to call manually to the function with loadTcaAdditions the next lines:

if (t3lib_extMgm::isLoaded('static_info_tables_##')) {
        tx_div::loadTcaAdditions(array('static_info_tables_##'));
}

However, if you note this you can inform me about this and I can add the news lines in the function.

To-Do list

Please contact me if you have any suggestion about this extension.

Changelog

07-08-08 Manuel Rego Casasnovas <mrego@igalia.com>

1.0.0: First public release

07-05-11 Manuel Rego Casasnovas <mrego@igalia.com>

Initial release

img-2 EXT: FORMidable Utils - 3