.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ==================================== EXT: SAV Library Extension Generator ==================================== :Created: 2008-12-05T07:38:36 :Changed: 2009-02-28T17:41:48 :Classification: sav_library :Keywords: Extension generator, SAV Library :Author: Laurent Foulloy :Email: yolf.typo3@orange.fr :Info 4: :Language: en |img-1| |img-2| EXT: SAV Library Extension Generator - sav\_library .. _EXT-SAV-Library-Extension-Generator: EXT: SAV Library Extension Generator ==================================== Extension Key: sav\_library Language: en Keywords: Extension generator, SAV Library Copyright 2000-2011, Laurent Foulloy, 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.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: SAV Library Extension Generator 1 <#__RefHeading__31472067>`_ **`Introduction 4 <#__RefHeading__9458_2085275629>`_** `What does it do? 4 <#__RefHeading__9460_2085275629>`_ `Screenshots 4 <#__RefHeading__9462_2085275629>`_ `Important development remarks 11 <#__RefHeading__10445_2085275629>`_ `Related extensions 11 <#__RefHeading__10447_2085275629>`_ **`Users manual 13 <#__RefHeading__9464_2085275629>`_** `Installation 13 <#__RefHeading__9466_2085275629>`_ **`Administration 14 <#__RefHeading__9468_2085275629>`_** `Updating previously generated extensions 14 <#__RefHeading__9470_2085275629>`_ `Running the tests 15 <#__RefHeading__9472_2085275629>`_ **`Configuration 16 <#__RefHeading__9474_2085275629>`_** `Introduction 16 <#__RefHeading__9476_2085275629>`_ `Flexform associated with the Plugin 16 <#__RefHeading__9478_2085275629>`_ `Changing the icons 18 <#__RefHeading__9480_2085275629>`_ `Changing the template for the views 18 <#__RefHeading__9482_2085275629>`_ `Changing the default CSS 18 <#__RefHeading__9484_2085275629>`_ `Configuration of the Queriers, Viewers, Item Viewers 18 <#__RefHeading__9486_2085275629>`_ `Modification of the SAV Library configuration 19 <#__RefHeading__9488_2085275629>`_ `Reference for the field configuration 19 <#__RefHeading__31550859>`_ `Field configuration by means of the page TS Config 30 <#__RefHeading__39463406>`_ `Maintenance configurations 30 <#__RefHeading__9490_2085275629>`_ `Configuration of the code generation 31 <#__RefHeading__9492_2085275629>`_ `Caching 31 <#__RefHeading__9494_2085275629>`_ **`Tutorial 1 : Contact List 33 <#__RefHeading__9496_2085275629>`_** `Introduction 33 <#__RefHeading__9498_2085275629>`_ `Creation of the extension 33 <#__RefHeading__9500_2085275629>`_ `Using the extension 43 <#__RefHeading__9502_2085275629>`_ `How to ? 46 <#__RefHeading__9504_2085275629>`_ **`Tutorial 2: CD Album 49 <#__RefHeading__33613803>`_** `Introduction 49 <#__RefHeading__9506_2085275629>`_ `Creation of the extension 49 <#__RefHeading__9508_2085275629>`_ `Using the extension 49 <#__RefHeading__9510_2085275629>`_ `How to ? 50 <#__RefHeading__9512_2085275629>`_ **`Tutorial 3: CD Album (Advanced) 55 <#__RefHeading__9514_2085275629>`_** `Introduction 55 <#__RefHeading__9516_2085275629>`_ `Creation of the extension 55 <#__RefHeading__9518_2085275629>`_ `How to ? 61 <#__RefHeading__9520_2085275629>`_ **`Tutorial 4: CD Album (Improved) 62 <#__RefHeading__9522_2085275629>`_** `Introduction 62 <#__RefHeading__9524_2085275629>`_ `Creation of the extension 62 <#__RefHeading__9526_2085275629>`_ `Using the extension 65 <#__RefHeading__9528_2085275629>`_ **`Tutorial 5: Extends test 67 <#__RefHeading__9530_2085275629>`_** `Introduction 67 <#__RefHeading__9532_2085275629>`_ **`Tutorial 6: Email and RTF 68 <#__RefHeading__9534_2085275629>`_** `Introduction 68 <#__RefHeading__9536_2085275629>`_ `The configuration explained 69 <#__RefHeading__9538_2085275629>`_ `How to ? 71 <#__RefHeading__9540_2085275629>`_ **`Tutorial 7: Guest book 72 <#__RefHeading__9542_2085275629>`_** `Introduction 72 <#__RefHeading__9544_2085275629>`_ `Extension overview 72 <#__RefHeading__9546_2085275629>`_ `The guest input form (FORM) 73 <#__RefHeading__9548_2085275629>`_ `The guest input list (LIST) 76 <#__RefHeading__9550_2085275629>`_ `The teaser (TEASER) 77 <#__RefHeading__9552_2085275629>`_ `Installation and configuration 78 <#__RefHeading__9554_2085275629>`_ `Template and CSS files 80 <#__RefHeading__9556_2085275629>`_ **`Tutorial 8: Fe Users Admin and Export 81 <#__RefHeading__9558_2085275629>`_** `Introduction 81 <#__RefHeading__9560_2085275629>`_ `Extension overview 81 <#__RefHeading__9562_2085275629>`_ `The user form (USER) 82 <#__RefHeading__9564_2085275629>`_ `The administration form (ADMIN) 83 <#__RefHeading__9566_2085275629>`_ `Installation and configuration 83 <#__RefHeading__9568_2085275629>`_ `Exporting data to CSV format 85 <#__RefHeading__9570_2085275629>`_ `Exporting data to other formats 86 <#__RefHeading__9572_2085275629>`_ **`Tutorial 9: Using XML JpGraph 90 <#__RefHeading__9574_2085275629>`_** `Introduction 90 <#__RefHeading__9576_2085275629>`_ `FE input events (Admin) 90 <#__RefHeading__9578_2085275629>`_ `Gantt graphs display (Display) 91 <#__RefHeading__9580_2085275629>`_ `Using the graph with a year selector 94 <#__RefHeading__9582_2085275629>`_ **`Tutorial 10: Using TypoScript (Gallery with google map) 97 <#__RefHeading__9584_2085275629>`_** `Introduction 97 <#__RefHeading__9586_2085275629>`_ `The “showAll” view 98 <#__RefHeading__9588_2085275629>`_ `The “inputForm” view 98 <#__RefHeading__9590_2085275629>`_ `The “showSingle” view 98 <#__RefHeading__9592_2085275629>`_ `Configuration of the plugin 99 <#__RefHeading__9594_2085275629>`_ **`Other examples 101 <#__RefHeading__39576314>`_** `Downloading documents (sav\_download) 101 <#__RefHeading__41091122>`_ `Minutes of meetings (sav\_meetings) 101 <#__RefHeading__39612912>`_ **`Known problems 103 <#__RefHeading__9596_2085275629>`_** **`To-Do list 104 <#__RefHeading__9598_2085275629>`_** **`Sponsors and credits 105 <#__RefHeading__9600_2085275629>`_** `Sponsors 105 <#__RefHeading__9602_2085275629>`_ `Credits 105 <#__RefHeading__9604_2085275629>`_ **`Changelog 106 <#__RefHeading__9606_2085275629>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ The SAV Library extension contains: - an “Extension Generator” based on the conventional kickstarter, - a library which is required to run the generated extensions. Thanks to simple configuration parameters it generates extensions **without any PHP coding** . The SAV Library Extension Generator includes: - Creation of multiple views of the data, - Front end input of the data, - Views with folders, - Simple interface in the Kickstarter with Context Sensitive Help, - Generation of emails, - Generation of RTF files using database tags, - Data export in CSV format, - Many other features. **Important: this extension is now obsolete. It is replaced by the SAV Library Plus extension which works with the SAV Library Kickstarter.** .. _Screenshots: Screenshots ^^^^^^^^^^^ .. _The-Extension-Manager-in-BE: The Extension Manager in BE """"""""""""""""""""""""""" .. _New-wizard-items-tab-selector-for-the-views-links-for-fast-access-to-the-fields: New wizard items, tab selector for the views, links for fast access to the fields ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-3| .. _Configuration-window-for-each-field-with-tab-selector-for-the-views: Configuration window for each field with tab selector for the views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-4| .. _Update-tool: Update tool ~~~~~~~~~~~ |img-5| .. _Configuration-of-the-generated-extension-by-flexform: Configuration of the generated extension by flexform ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-6| .. _Example-1-creating-text-and-image: Example 1 – creating text and image """"""""""""""""""""""""""""""""""" .. _Show-all-view: Show all view ~~~~~~~~~~~~~ |img-7| .. _Single-view: Single view ~~~~~~~~~~~ |img-8| .. _Input-view: Input view ~~~~~~~~~~ |img-9| .. _Example-2-creating-link-text-area-selector: Example 2 – creating link, text area, selector """""""""""""""""""""""""""""""""""""""""""""" .. _Show-all-view: Show all view ~~~~~~~~~~~~~ |img-10| .. _Single-View: Single View ~~~~~~~~~~~ |img-11| .. _Input-view: Input view ~~~~~~~~~~ |img-12| .. _Example-3-creating-folders-MM-table-in-a-sub-form: Example 3 – creating folders, MM table in a sub-form """""""""""""""""""""""""""""""""""""""""""""""""""" .. _Single-view: Single view ~~~~~~~~~~~ |img-13| .. _Input-view: Input view ~~~~~~~~~~ |img-14| .. _Example-4-Double-window-selector-table-in-a-sub-form-which-is-not-in-relation-with-items: Example 4 – Double-window selector, table in a sub-form which is not in relation with items """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. _Single-view: Single view ~~~~~~~~~~~ |img-15| .. _Input-view: Input view ~~~~~~~~~~ |img-16| .. _Example-6-Email-and-RTF: Example 6 – Email and RTF """"""""""""""""""""""""" .. _Input-view: Input view ~~~~~~~~~~ |img-17| .. _Example-7-Guest-book-multiple-forms: Example 7 – Guest book (multiple forms) """"""""""""""""""""""""""""""""""""""" .. _Guest-form-input: Guest form (input) ~~~~~~~~~~~~~~~~~~ |img-18| .. _Guest-form-input-validation: Guest form (input validation) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-19| |img-20| .. _List-form: List form ~~~~~~~~~ |img-21| .. _Teaser-form: Teaser form ~~~~~~~~~~~ |img-22| .. _Example-8-Fe-Users-Admin-and-Export: Example 8 – Fe Users Admin and Export """"""""""""""""""""""""""""""""""""" .. _Show-All-view-of-the-ADMIN-form-with-export-icon: Show All view of the ADMIN form with export icon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-23| .. _Export-form-using-a-previously-saved-configuration: Export form using a previously saved configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-24| .. _Example-9-XML-JpGraph-year-events-display-as-Gantt-graphs: Example 9 – XML JpGraph (year events display as Gantt graphs) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |img-25| .. _Example10-Using-TypoScript-gallery-with-google-map: Example10 – Using TypoScript (gallery with google map) """""""""""""""""""""""""""""""""""""""""""""""""""""" .. _Show-All-view: Show All view ~~~~~~~~~~~~~ |img-26| .. _Show-Single-view-with-a-google-map: Show Single view with a google map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |img-27| .. _Important-development-remarks: Important development remarks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When the development of this extension started, it was chosen to modify the Kickstarter using the XCLASS method. All the functionnalities of the Kickstarter are preserved and it can be used normally. The current version of the SAV Library Extension Generator works the **Kickstarter 0.4.0, 0.5.0, 0.5.1** . If you have developed extensions with the previous version of the SAV Library Generator, that is version 2.x.y, you will need to update all your extensions. A tool in the Extension Manager was specially designed to easily update extensions. However the Kickstarter is an old code which is quite difficult to change because it does not clearly separate the code generation and the BE interface. Furthermore, having the generator and the library in the same extension is not the best solution. Therefore, I have decided to develop a specific kickstarter for the SAV Library extension. This new kickstarter, called sav\_library\_kickstarter, is based on **fluid** and **extbase** and is available in the TER ( `https://typo3 .org/extensions/repository/view/sav\_library\_kickstarter/current/ `_ ). **Please use this new SAV Library Kickstarter for your developements** . The SAV Library extension still contains the kickstarter XCLASS files only for compatibility reasons with TYPO3 versions which doe not have “fluid” and “extbase”. **For now, the dependency between the extension “sav\_library” and “kickstarter” has been removed.** The latest developments of the SAV Library extension are available on TYPO3 Forge ( `Extension Generator `_ ). Remember that “It's not abug, it's amissingfeature”. If you find some, please use the bug tracker on the TYPO3 Forge. .. _Related-extensions: Related extensions ^^^^^^^^^^^^^^^^^^ Several examples of extensions generated by the SAV Library are available in the TER. - SAV Library Examples (“sav\_library\_exampleX”, where X is a number) - these extensions are described in the tutorial section. - Other examples can be found in the “Other examples” section of this manual: - Downloading documents (sav\_download) - Minutes of meetings (sav\_meetings) - SAV Library Filters (“sav\_filter\_name”, where name is the filter name) - these extensions are specially designed to work with the extensions generated by the SAV Library. - SAV Library Extends (“sav\_library\_extends”) - this extension was designed to help you to add or overload default methods used in the SAV Library Extension Generator. .. _Users-manual: Users manual ------------ .. _Installation: Installation ^^^^^^^^^^^^ If not installed, download the extension “kickstarter” and install it. Download the extension “sav\_library” and install it. Read the tutorial sections .. _Administration: Administration -------------- .. _Updating-previously-generated-extensions: Updating previously generated extensions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In case of a major release of the SAV Library Extension Generator you will need to update all the previously generated extensions. A special tool is available in the Extension Manager to perform this task easily. Click on the Extension Manager and select “SAV Library extensions update” in the selector box. |img-28| All the loaded extensions which have been generated the SAV Library Extension Generator are displayed. |img-29| For each extension, several information are displayed: The name of the extension, that is the extension key. By clicking on the name, the tool provides a quick access to an extension. It will be opened in the kickstarter. By default, the SAV Library Extension Generator will generate a XML configuration file in the “pi1” directory of the extension. You may prefer to use the “php-array” generation. In that case, please uncheck the checkbox in the column “XML Generation”. The list of the form used in the extension since one extension may contain several forms. For each form you can select if the plugin will behave as a USER for this form, that is caching will be possible. By default, the plugin will behave as a USER\_INT for all forms, that is no caching is available. If you want to make a form behaving as a USER, just check it. Check the update flag if you want to rebuild the extension. When clicking on the button “Update the extensions”, only the extensions with a “update” checkbox selected will be updated. The version of the SAV Library Extension Generator which has been used to generate the extension is displayed. If the version of the generator is older than 3.0.0, “Unknown” is displayed. The current version of the extension is displayed. Kickstarter 0.4.0 has introduced changes in the type of the field in the SQL generation. The “SAV Library extensions update” tool will inform you about the required changes. Click once again on the button “Update the extensions” to execute the SQL field updates. .. _Running-the-tests: Running the tests ^^^^^^^^^^^^^^^^^ A bench of unit tests has been developed for the SAV Library Extension Generator. To run the tests : Download the extension “phpunit” from the TER and install it. Download the extension “sav\_library\_example1” from the TER and install it. Click on PHPunit in the “Admin tools”. Select the test to run. New tests will be added in the next versions of the SAV Library Extension Generator. .. _Configuration: Configuration ------------- .. _Introduction: Introduction ^^^^^^^^^^^^ This section describes the different available configurations of the plugin generated by the SAV Library Extension Generator. **Read the tutorial section first** . .. _Flexform-associated-with-the-Plugin: Flexform associated with the Plugin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The configuration of **each generated extension** is done by means of a flexform. The flexform has three folders: - General - Input controls - Advanced |img-30| **Help** : click on the icon to get the context sensitive help. **Select form** : use this selector to select the form name. Let use recall that the “sav\_library” makes it possible to build several forms associated with the same extension, thus providing different views of your tables. **Show all if no filter** : if set, all items are displayed if no filter is applied, for example by means of the “sav\_filter\_abc” extension. **If no information available** : use the selector to choose what to display when no information are available. **Max number of items** : maximum number of items that will be displayed in a page. If set to 0, all items are displayed. **Help page** : use this selector to choose a page of your site which will be use as an help page for your extension. In this case, an icon is displayed in the title bar of your extension. |img-31| **Help** : click on the icon to get the context sensitive help. **Input on form** : if set, Front End inputs are allowed (set by default). **Allowed groups** : if you select user groups, user must belong to one of these groups to be allowed to input data in the Front End. **Input Admin field** : put here a field under the form “tableName.fieldName” (if you use only “fieldName”, the main table is taken as “tableName”). This will restrict the input to users that have “Admin” right for this field in their TS Config. For example, if one user has “extKey\_Admin=value1,value2” **in his TS Config** , he will be allowed to edit or delete items for which “fieldName” is equal to “value1” or “value2” for the extension “extKey”. The fields or the folders which have the attribute “editAdminPlus= 1;” can be modified if the user has the “Admin+” rights. For example, if the TS Config is “extKey\_Admin=value1+,value2” , the user is an “Admin+” for the records where “fieldName” is equal to “value1” and just “Admin” for the records where “fieldName” is equal to “value2”. Users become “Super Admin” if their TS Config is “extKey\_Admin=\*”. **No “new” button** : no new button is added to the form. It means that you can modify existing records but you cannot create new record. **No “edit” button** : an edit button will not be added in front of the records in “show All” views. **No “delete” button** : a delete button will not be added in front of the records in “show All” views. **Add a “delete” button only for records created by the user** : add a "delete" button only for records created by the user. **Input start date** : if set, inputs in the Front End will not be possible before this date. **Input end date** : if set, inputs in the Front End will not be possible after this date. **Apply date limit** : use the selector to set either “Nobody”, “All”, “Admin plus users”, “All excluding Super Admin”. The date limit is applied according to this selector. |img-32| **Help** : click on the icon to get the context sensitive help. **Permanent filter** : you can use this field to add a where clause that will be “anded” to the where clause of the form query. **Add a fragment (# content id) to links** : the content id is added as a fragment to the links. **Allow the use of the “query” property:** the “query” property makes it possible to execute queries in “input” or “update” forms. Because any query may be executed, for security reason, only admin users can check this field when this property is needed. **Allow the use of the exec function in export:** The use of the php exec function is allowed in export which makes the execution of text processors possible, for example. **Storage page** : this option makes it possible to store your record in a storage page, for example a “sysfolder”, otherwise records are stored in the current page. When this option is used, records are fetched in the storage page and in the pages defined in the “starting point” if any. **Apply caching to** : When the plugin is running as a USER for the form, that is when caching is required, these option control the caching for various buttons or links. If an option is set, a cHash will be added to the link. **Pages whose cache will be cleared on update in the input form** : When the plugin is running as a USER for the form, that is when caching is required, updating items in the input form will clear the cache for the current page by default. If you need to clear the cache for other pages, select them here. Use also this option when the plugin is running as a USER\_INT for the form and you need to clear the cache of another page used by a form for which caching is used. .. _Changing-the-icons: Changing the icons ^^^^^^^^^^^^^^^^^^ The extension “sav\_library” comes with default icon files associated with its various functionalities. There are two ways of changing the icons: Create a “res/icons” directory in the generated extension in which you put your icon files with the same names as in the default directory “res/icons” in the extension “sav\_library”. Create a directory where you want in the fileadmin directory, in which you put your icon files with the same names as in the default directory. Then, in the “Setup” of your template, write:plugin.tx\_yourExtensionNameWithoutUnderscores\_pi1.iconsDir = yourIconsDirwhere “yourExtensionNameWithoutUnderscores” is the key of the extension you have created with the generator, but without underscores if any, and “yourIconsDir” is the relative path of the directory where you have put your icon files. .. _Changing-the-template-for-the-views: Changing the template for the views ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The extension “sav\_library” comes with a default template file for the views. It is the file “sav\_library.tmpl” in the “res” directory of the “sav\_library” extension. There are two ways of changing the template: Put your template file in the “res” directory of your extension under the name “yourExtensionName.tmpl”, where “yourExtensionName” is the key of the extension you have created with the generator. Put your template file where you want in the fileadmin directory. Then, in the “Setup” of your template, write:plugin.tx\_yourExtensionNameWithoutUnderscores\_pi1.template = yourFileNamewhere “yourExtensionNameWithoutUnderscores” is the key of the extension you have created with the generator, but without underscores if any, and “yourFileName” is the filename with its relative path (i.e. fileadmin/....). .. _Changing-the-default-CSS: Changing the default CSS ^^^^^^^^^^^^^^^^^^^^^^^^ The extension “sav\_library” comes with a default CSS which is in the file “ext\_typoscript\_setup.txt” of the SAV Library directory. You may overload the styles in your CSS file to change them globally. You also may want to modify the default styles only for one specific extension. In that case, you just have to put a CSS file in the “res” directory of your extension under the name under the name “yourExtensionName.css”, where “yourExtensionName” is the key of the extension you have created with the generator. This CSS will be automatically added in the HTML section (see “sav\_library\_example7” for such a case). .. _Configuration-of-the-Queriers-Viewers-Item-Viewers: Configuration of the Queriers, Viewers, Item Viewers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The extension “sav\_library” comes with a default configuration for queries, viewers, item viewers. It can be easily changed. The configuration is defined by the file “sav\_library.xml” which is in the “res” directory of the “sav\_library” extension. The xml file contains three parts: - Definition of the queriers - Definition of the viewers - Definition of the item viewers .. _Definition-of-the-queriers: Definition of the queriers """""""""""""""""""""""""" The queriers are organized in three classes: the select queriers (one for each type of view), the delete querier and the update querier. Between the tags, there is the method name that should be called to execute the querier. For example, UPDATE\_defaultQuerier is the method that will be called by default for UPDATE. :: UPDATE_defaultQuerier .. _Definition-of-viewers: Definition of viewers """"""""""""""""""""" The principle is the same as for the queriers. .. _Definition-of-the-item-viewers: Definition of the item viewers. """"""""""""""""""""""""""""""" The principle is more complex. Let us explain it from the example of the Date viewer: :: input eval isEqual date All item viewers are associated with two methods. One is for the “normal” mode and one for the “edit” mode. By convention, for the previous example, the method names will respectively be “viewDate” and “viewDateEditMode”. The definition of the item viewer contains a type tag and conditions. The type and the conditions are built from the TCA. In the example, for a date-type field, the type is “input” and the “eval” is set to “date”. Therefore, to detect this case, one condition is built to check if the field “eval” is equal to “date”. The equality verification is done using the “ope” tag “isEqual”. Several operators (ope) are provided: isEqual, isArray, isNotArray, arrayKeyExists, isNull, isNotNull. They are defined as methods in the file sav\_library.php. .. _Modification-of-the-SAV-Library-configuration: Modification of the SAV Library configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You may want to change the configuration and adapt it to your specific needs. For this purpose, a special extension called “sav\_library\_extends” was developed to extend the SAV Library. Download this extension from the TER and install it. In the extension directory, you will find several classes which extends the SAV Library classes by means of XCLASS. Looking to the file “sav\_library\_extends.xml” in the directory “res”, you will see that a new item viewer “Example” is added. It is associated with a new type “example”. Then, check the class “ux\_tx\_savlibrary\_defaultItemviewers” in the file “class.ux\_tx\_savlibrary\_defaultItemviewers.php” to understand how to add the new item viewer. Check also the class “ux\_tx\_savlibrary\_defaultVerifiers” in the file “class.ux\_tx\_savlibrary\_defaultVerifiers.php” to see how to add a new verifier. Now download the extension “sav\_library\_example5” and install it. It is a very simple example. Edit it in the kickstarter to see how the new type was associated with the field. Finally, use the extension in FE. Type “Hello” in the field to see the effect of the new verifier. .. _Reference-for-the-field-configuration: Reference for the field configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The SAV Library Extension Generator is based on the kickstarter. Therefore, the TCA configuration generated by the kickstarter is available and can be changed for each view by means of the field configuration interface. In the example below, the default width (size attribute in the TCA) is replaced by the value 40. |img-33| The SAV Library Extension Generator makes it possible to enter data in the Front End. However, since extensions are generated by means of the kickstarter, in most cases data can also be input in the Back End using the regular interface. The following configurations have been added for the SAV Library Extension Generator. They are organized in the alphabetic order and the TCA type is recalled in parentheses. Of course, no type is provided for the general configuration which can be applied to any field and to the function options. .. _Checkbox-single-field-type-check: Checkbox, single (field type: check) """""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _displayAsImage: displayAsImage ~~~~~~~~~~~~~~ .. container:: table-row Property displayAsImage Data type boolean Description If set, the check box is displayed as an image instead of a label. Default 0 .. _doNotDisplayIfNotChecked: doNotDisplayIfNotChecked ~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property doNotDisplayIfNotChecked Data type boolean Description If set, do not display the check box value (default is "No") if it is not checked (obviously it does not apply when in edit mode). Default 0 .. ###### END~OF~TABLE ###### .. _Checkbox-4-boxes-or-10-boxes-field-type-check-4-or-check-10: Checkbox, 4 boxes or 10 boxes (field type: check\_4 or check\_10) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _cols: cols ~~~~ .. container:: table-row Property cols Data type integer Description Number of columns to display. Default 1 .. _displayAsImage: displayAsImage ~~~~~~~~~~~~~~ .. container:: table-row Property displayAsImage Data type boolean Description If set, the check boxes are displayed as images instead of labels. Default 0 .. _doNotDisplayIfNotChecked: doNotDisplayIfNotChecked ~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property doNotDisplayIfNotChecked Data type boolean Description If set, do not display the check box value (default is "No") if it is not checked (obviously it does not apply when in edit mode). Default 0 .. _nbItems: nbItems ~~~~~~~ .. container:: table-row Property nbItems Data type integer Description Number of items to display. Default .. ###### END~OF~TABLE ###### .. _Database-relation-selectorbox-select-global-field-type-rel: Database relation - selectorbox, select global (field type: rel) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _aliasSelect: aliasSelect ~~~~~~~~~~~ .. container:: table-row Property aliasSelect Data type Field name Description Defines an alias used in the SELECT query. Markers ###fieldname### can be used, fieldname must be in the relation table. Default .. _labelSelect: labelSelect ~~~~~~~~~~~ .. container:: table-row Property labelSelect Data type Field name Description Defines the label from the field name for the selector. Default .. _additionalTableSelect: additionalTableSelect ~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property additionalTableSelect Data type Comma-separated table names Description Add the table names in the select query. It can be used when tables need to be joined. Default .. _orderSelect: orderSelect ~~~~~~~~~~~ .. container:: table-row Property orderSelect Data type String Description Define the order clause for the selector. In general : fieldname [desc]. Default .. _whereSelect: whereSelect ~~~~~~~~~~~ .. container:: table-row Property whereSelect Data type String Description Defines the WHERE clause for the selector. It can be: . a conventional MySQL clause. \- The marker ###user### can be used. It will be replaced by the user uid. \- The marker ###uid### can be used. it will be replaced by the main current record. \- The marker ###CURRENT\_PID### can be used. It will be replaced by the current page uid. \- The marker ###STORAGE\_PID### can be used. It will be replaced by the storage page uid. . ###group\_list = list\_of\_comma\_separed\_fe\_groups###. To be used with a selector on fe\_users. It checks if the user belongs to the group list. . ###group\_list != list\_of\_comma\_separed\_fe\_groups###. To be used with a selector on fe\_users. It checks if the user does not belong to the group list. Default .. _groupBySelect: groupBySelect ~~~~~~~~~~~~~ .. container:: table-row Property groupBySelect Data type String Description Defines the GROUP BY clause for the selector. Default .. _content: content ~~~~~~~ .. container:: table-row Property content Data type SQL SELECT statement Description SQL SELECT statement must have an alias "uid" and an alias "label" which will be used as the value to display. Special markers can be used in the statement : . ###uid### will be replaced by the current record uid. . ###uidSelected### will be replaced by the selected item. . ###user### will be replaced by the user id. . ###cruser### will be replaced by the user id. The following example returns a selectorbox with the usernames that are linked with the user by a MM relation : :: content = SELECT fe_users.uid as uid, fe_users.name as label FROM tx_mytable_rel_myfield_mm,fe_users WHERE tx_mytable_rel_myfields_mm.uid_local=###user### AND tx_mytable_rel_myfields_mm.uid_foreign=fe_users.ui ORDER by label; Default .. _separator: separator ~~~~~~~~~ .. container:: table-row Property separator Data type string Description It should be used when the max number of relations is greater than 1 (not true MM-relation) to replace the default
separator between items in showAll or showSingle views. Default .. _specialFields: specialFields ~~~~~~~~~~~~~ .. container:: table-row Property specialFields Data type comma-separated list of fields Description The value of the fields will be propagated in the ###special[fieldname]### marker when available. Default .. _singleWindow: singleWindow ~~~~~~~~~~~~ .. container:: table-row Property singleWindow Data type boolean Description In case of a MM relation, a double window is used to select items. When this option is used, a single selectorbox in multiple mode is used. Default 0 .. _overrideEnableFields: overrideEnableFields ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property overrideEnableFields Data type boolean Description If set, the method enableFields of the class tslib\_cObj which filters out records with start/end times or hidden/fe\_groups fields is not applied to the query associated with the selectorbox. It may be used in specific cases when you needed to retreive all the records. Default 0 .. _overrideStartingPoint: overrideStartingPoint ~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property overrideStartingPoint Data type boolean Description By default, when starting points are provided, information associated with the selector is searched in these page. This property overrides the default behavior. Default 0 .. ###### END~OF~TABLE ###### .. _Database-relation-field-with-element-browser-field-type-rel: Database relation - field with element browser (field type: rel) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _addDelete: addDelete ~~~~~~~~~ .. container:: table-row Property addDelete Data type boolean Description A delete icon will be added in front of each item. Default 0 .. _addUpDown: addUpDown ~~~~~~~~~ .. container:: table-row Property addUpDown Data type boolean Description Two buttons (up and down) will be added. They can be used to reorganize the order of the subform items. Default 0 .. _addSave: addSave ~~~~~~~ .. container:: table-row Property addSave Data type boolean Description A save button and an anchor will be added. It simplifies the saving when several items are in the subform and the height of an item is important. Default 0 .. _cutNewButtonIfNotSaved: cutNewButtonIfNotSaved ~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property cutNewButtonIfNotSaved Data type boolean Description The new button of the subform will be cut if the form in which the subform takes place is not saved. Default 0 .. _keepFieldsInSubForm: keepFieldsInSubForm ~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property keepFieldsInSubForm Data type comma-separated list of fields Description The values of the fields (use tableName.fieldName) from the parent form will be kept in the subform. It can be used to deal with these values in the subform. If \* is used instead of the comma-separated list of fields, all fields are kept. Default .. _labelOnTitle: labelOnTitle ~~~~~~~~~~~~ .. container:: table-row Property labelOnTitle Data type boolean Description The label will be displayed in the title of the subform in input mode. Default 0 .. _maxSubItems: maxSubItems ~~~~~~~~~~~ .. container:: table-row Property maxSubItems Data type integer Description Number of items that will be displayed in the subform. All items are displayed if set to 0. If not set, the "maxitems" value in the TCA, that is the "Max number of relations" in the Kickstarter, is used. Default .. _noFirstLast: noFirstLast ~~~~~~~~~~~ .. container:: table-row Property noFirstLast Data type boolean Description First and last buttons in the browser associated with the "subFormAlt" template will not be shown. Default 0 .. _subFormTemplate: subFormTemplate ~~~~~~~~~~~~~~~ .. container:: table-row Property subFormTemplate Data type string Description Name of the template (e.g. subFormAlt). By default the template "subForm" is used. Default .. ###### END~OF~TABLE ###### .. _Date-field-type-date: Date (field type: date) """"""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _format: format ~~~~~~ .. container:: table-row Property format Data type Date format Description Sets a format to display the date. The format is the same as in strftime php function. Example: full weekday and month names plus year :: format = %A %B %Y; Default %d/%m/%Y .. _noDefault: noDefault ~~~~~~~~~ .. container:: table-row Property noDefault Data type boolean Description Do not display the default date. Default 0 .. _resetToDefault: resetToDefault ~~~~~~~~~~~~~~ .. container:: table-row Property resetToDefault Data type boolean Description If set, the field value is reset to the current date in the input mode. Default 0 .. ###### END~OF~TABLE ###### .. _Date-and-time-field-type-datetime: Date and time (field type: datetime) """""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _format: format ~~~~~~ .. container:: table-row Property format Data type Date format Description Sets a format to display the date. The format is the same as in strftime php function. Example: full weekday and month names plus year :: format = %A %B %Y at %H:%M; Default %d/%m/%Y %H:%M .. _noDefault: noDefault ~~~~~~~~~ .. container:: table-row Property noDefault Data type boolean Description Do not display the default date and time. Default 0 .. _resetToDefault: resetToDefault ~~~~~~~~~~~~~~ .. container:: table-row Property resetToDefault Data type boolean Description If set, the field value is reset to the current date in the input mode. Default 0 .. ###### END~OF~TABLE ###### .. _Files-and-images-field-type-files: Files and images (field type: files) """""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _addIcon: addIcon ~~~~~~~ .. container:: table-row Property addIcon Data type boolean Description Adds an icon in front of the hyperlink associated with the file. Default 0 .. _uploadFolder: uploadFolder ~~~~~~~~~~~~ .. container:: table-row Property uploadFolder Data type string Description Sets the folder path where the file is stored. It overwrites the same attribute in the TCA. Default .. _addToUploadFolder: addToUploadFolder ~~~~~~~~~~~~~~~~~ .. container:: table-row Property addToUploadFolder Data type string Description Adds a subpath to the UploadFolder path. Default .. _addToUploadFolderFromField: addToUploadFolderFromField ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property addToUploadFolderFromField Data type Field name Description Adds the content of the field whose name is given by "field\_name" to the uploadFolder attribute. This information is separated with an underscore. Example : if the field\_name is "my\_field" and its contents is "123", then :: AddToUploadFolderFromField = my_field; will add "\_123" to the uploadFolder name. Default .. _size: size ~~~~ .. container:: table-row Property size Data type integer Description Sets the size attribute. It overwrites the same attribute in the TCA. Default .. _iframe: iframe ~~~~~~ .. container:: table-row Property iframe Data type boolean Description Opens the image in an iframe. Default .. _width: width ~~~~~ .. container:: table-row Property width Data type integer Description Sets the width of an image or of the iframe. Default .. _height: height ~~~~~~ .. container:: table-row Property height Data type integer Description Sets the height of an image or of the iframe. Default .. _message: message ~~~~~~~ .. container:: table-row Property message Data type string Description If the file is not an image, an hyperlink is created with the string. Default .. _fieldMessage: fieldMessage ~~~~~~~~~~~~ .. container:: table-row Property fieldMessage Data type Field name Description Sets the attribute "message" with the content of the field whose name is given by field\_name. Default .. _alt: alt ~~~ .. container:: table-row Property alt Data type string Description Provides the HTML alt attribute for an image. Default .. _fieldAlt: fieldAlt ~~~~~~~~ .. container:: table-row Property fieldAlt Data type Field name Description Sets the "alt" attribute with the content of the field whose name is given by field\_name. Default .. _default: default ~~~~~~~ .. container:: table-row Property default Data type string Description Defines the default image if the content of the field is null otherwise the default image is “unknown.gif” taken in the directory sav\_library/res/images. Default .. _tsProperties: tsProperties ~~~~~~~~~~~~ .. container:: table-row Property tsProperties Data type string Description It makes it possible to use the graphic possibilities of TYPO3. If set, an IMAGE cObject is generated with the given TS properties. Do not forget that the configuration field is ended by a semi-column, therefore if you need a semi-column in your TS write it “\;” Default .. ###### END~OF~TABLE ###### .. _Functions: Functions """"""""" Functions are applied to the value of the field. It can be also applied to left and right contents. In this case, "Left" or "Right" should be added to the function name and the optional attributes. .. ### BEGIN~OF~TABLE ### .. _Property: Property: ~~~~~~~~~ .. container:: table-row a Property: Data type Data type: Description Description: Default Default: .. _func-makeDateFormat: func = makeDateFormat; ~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeDateFormat; Data type Description This function generates a format for a unix time stamp date. Optional attributes can be added: . format = string; The string should be a format that makes sense for the php-function strftime(). Default .. _func-makeImage: func = makeImage; ~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeImage; Data type Description This function builds an IMG tag where the field value is the name of the image file. Additional parameter can be used. . folder = string; (string will be the folder where the file should be). . width = integer; (width of the image in pixels). . height = integer; (height of the image in pixels). . alt = string; (string will be the "alt" attribute of the image). . fieldAlt = field\_name; (the "alt" attribute will be the value of the fieldname for the current record). Default .. _func-makeEmailLink: func = makeEmailLink; ~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeEmailLink; Data type Description This function generates an email link associated with the field. Optional attributes can be added: . message = string; Message associated with the link. . fieldMessage = fieldName; Sets the attribute "message" with the content of the field whose name is given by fieldName. Default .. _func-makeNewWindowLink: func = makeNewWindowLink; ~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeNewWindowLink; Data type Description This function generates an hyperlink associated with the value of the field which opens a new window. Paramaters are : . windowUrl = string; string is the url. The marker ###special[fieldname]### from selectors can be used. This parameter is not necessary if the field is an image. Optional attributes can be added: . windowText = string; string will be added above the image. The marker ###special[fieldname]### from selectors can be used. . windowBodyStyle = string; string will be added as the style attribute to the body html tag. Do not forget to use \; for style attributes, since the semi-colon is use to split field attributes, and do not forget to end your definition by a semi-colon. Example: :: windowBodyStyle = fontweight:bold\;font-color:blue\;; . message = string; Message associated with the link. . fieldMessage = fieldName; Sets the attribute "message" with the content of the field whose name is given by fieldName. Default .. _func-makeItemLink: func=makeItemLink; ~~~~~~~~~~~~~~~~~~ .. container:: table-row a func=makeItemLink; Data type Description This function generates an hyperlink associated with the value of the field. It will open the "showSingle" view associated with the selected item. Optional attributes can be added: . folderTab = string; (string is the folder tab name, if the extension uses serveral folders). . page = string; (same as folderTab but deprecated). . updateForm = 1; makes it possible to open an "update" view instead of the "Show single" view. . inputForm = 1; makes it possible to open an "Input form" view instead of the "Show single" view. Default .. _func-makeLink: func = makeLink; ~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeLink; Data type Description This function generates an internal link (typolink). Optional attributes can be added: . folder = string; The string will be the folder where the file should be). . target = string; The string defines the target parameter. . class = string; Name of the class associated with the link. . message = string; Message associated with the link. . fieldMessage = fieldName; Sets the attribute "message" with the content of the field whose name is given by fieldName. . setUid = integer; the integer defines the page uid associated with the link. . valueIsUid = 1; The field value is used as the uid of the page associated with the link. Default .. _func-makeExtLink: func = makeExtLink; ~~~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeExtLink; Data type Description This function generates an hyperlink associated with the value of the field. It will open the "showSingle" view associated with the selected item in another extension. The following attributes must be provided: . ext = string; (string is the extension name followedby the form name. Example "myext\_intranet"). . pageId = integer; (integer is the page id where the extension is the content element). . contentId = integer; (integer is the content id of the extension). Optional attributes can be added: . folderTab = string; (string is the folder tab name, if the extension uses serveral folders). . page = string; (same as folderTab but deprecated). . setUid = this; The uid of the record to open, is given by the value of the field. . restrictLinkTo = ###usergroup=group\_name###; the link will be displayed if the user belongs to the group\_name. . restrictLinkTo = ###usergroup!=group\_name###; the link will be displayed if the user does not belong to the group\_name. Default .. _func-makeUrlLink: func = makeUrlLink; ~~~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeUrlLink; Data type Description This function generates a link for an external url. Optional attributes can be added: . link = string; The string will be used for the link instead of the field value. . fieldLink = fieldName; Sets the attribute "link" with the content of the field whose name is given by fieldName. . message = string; Message associated with the link. . fieldMessage = fieldName; Sets the attribute "message" with the content of the field whose name is given by fieldName. Default .. _func-makeXmlLabel: func = makeXmlLabel; ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row a func = makeXmlLabel; Data type Description This function generates the label from a xml language file. It works with the following parameter: . xmlLabel = string; the string is the label definition. For example, assume that the value comes from a selectorbox whose label definition is in the file locallang\_db.xml in the extension "my\_ext". Assume also that the field is "my\_field". Then, to obtain the label one has to write :: xmlLabel = LLL:EXT:my_ext/locallang_db.xml:tx_myext.my_field.I.; Default .. ###### END~OF~TABLE ###### .. _General-attributes: General attributes """""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _addEdit: addEdit ~~~~~~~ .. container:: table-row Property addEdit Data type boolean Description When the field is used in an "Update form" view, it will add an input element for update that can be used with the marker ###field\_name\_Edit### where "field\_name" is the name of the field. See also the help for Form views (showAllItemTemplate) to see how to use markers ###field[field\_name, label]###. Default 0 .. _addEditIfNull: addEditIfNull ~~~~~~~~~~~~~ .. container:: table-row Property addEditIfNull Data type boolean Description Same as addEdit but the element will be added only if the field is null. Default 0 .. _addEditIfAdmin: addEditIfAdmin ~~~~~~~~~~~~~~ .. container:: table-row Property addEditIfAdmin Data type boolean Description Same as addEdit but the element will be added only if the user has the input right for the plugin. Default 0 .. _addLeftIfNotNull: addLeftIfNotNull ~~~~~~~~~~~~~~~~ .. container:: table-row Property addLeftIfNotNull Data type string Description String will be added to the left if the field value is not null. Default 0 .. _addLeftIfNull: addLeftIfNull ~~~~~~~~~~~~~ .. container:: table-row Property addLeftIfNull Data type string Description String will be added to the left if the field value is null. Default .. _addNewIcon: addNewIcon ~~~~~~~~~~ .. container:: table-row Property addNewIcon Data type integer Description A new icon, will be displayed in front of the field during the number of days given by the int number. Default .. _addRighIfNotNull: addRighIfNotNull ~~~~~~~~~~~~~~~~ .. container:: table-row Property addRighIfNotNull Data type string Description String will be added to the right if the field value is not null. Default .. _addRighIfNull: addRighIfNull ~~~~~~~~~~~~~ .. container:: table-row Property addRighIfNull Data type string Description String will be added to the right if the field value is null. Default .. _alias: alias ~~~~~ .. container:: table-row Property alias Data type Field name Description The displayed value will be provided by the fieldname value for the current record. Default .. _classLabel: classLabel ~~~~~~~~~~ .. container:: table-row Property classLabel Data type string Description The default class "label" associated with the label of the displayed value will be replaced by the string. Default .. _classValue: classValue ~~~~~~~~~~ .. container:: table-row Property classValue Data type string Description The default class "value" associated with the displayed value will be replaced by the string. Default .. _classHTMLTag: classHTMLTag ~~~~~~~~~~~~ .. container:: table-row Property classHTMLTag Data type string Description The string will be added as a class to the HTML tag associated with the displayed item (not always available). Default .. _styleLabel: styleLabel ~~~~~~~~~~ .. container:: table-row Property styleLabel Data type string Description The string will be added as a style attribute associated with the label of the displayed value. Default .. _styleValue: styleValue ~~~~~~~~~~ .. container:: table-row Property styleValue Data type string Description The string will be added as a style attribute associated with the displayed value. Default .. _styleHTMLTag: styleHTMLTag ~~~~~~~~~~~~ .. container:: table-row Property styleHTMLTag Data type string Description The string will be added as a style attribute to the HTML tag associated with the displayed item (not always available). Default .. _cutIfNull: cutIfNull ~~~~~~~~~ .. container:: table-row Property cutIfNull Data type boolean Description Cut the field if null. Default 0 .. _cutIf: cutIf ~~~~~ .. container:: table-row Property cutIf Data type expression Description Expression can be: . fieldName=value Cuts the field if current value of the field is equal to the given value. The markers ###user### or ###cruser### (same as user but should be used if a new record is created) will be replaced by the user id. Use EMPTY for the value to test an empty field. . fieldName!=value Cuts the field if current value of the field is not equal to the given value. Same markers as above can be used. . ###usergroup=group\_name### The field is cut if the group “group\_name” is a valid group for the current user. . ###usergroup!=group\_name### The field is cut if the group “group\_name” is not a valid group for the current user. . group=group\_name The field is cut if the group “group\_name” is a valid group for the current record. It checks the usergroup field in the local table if any. . group!=group\_name The field is cut if the group “group\_name” is not a valid group for the current record. It checks the usergroup field in the local table if any. Default .. _cutLabel: cutLabel ~~~~~~~~ .. container:: table-row Property cutLabel Data type boolean Description Cuts the label associated with the field. Default 0 .. _edit: edit ~~~~ .. container:: table-row Property edit Data type boolean Description Makes the field not editable in an input form. Default 1 in input forms .. _editAdminPlus: editAdminPlus ~~~~~~~~~~~~~ .. container:: table-row Property editAdminPlus Data type boolean Description Makes the field editable in an input form, if the user has the "Admin+" right. To be an "Admin" user, his/her TSConfig must contain a line as follows: . extKey\_Admin=value where “extKey” is the extension key and value is one of the possible value of the "Input Admin Field" defined in the flexform associated with the extension. The user becomes an "Admin+" user, if his/her TSConfig contains a line as follows: . extKey\_Admin=value+ Default 0 .. _func: func ~~~~ .. container:: table-row Property func Data type Function name Description See the section devoted to functions. Default .. _funcAddLeftIfNotNull: funcAddLeftIfNotNull ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property funcAddLeftIfNotNull Data type string Description String will be added to the left if the result of the applied function, defined by "func=function\_name;" property, is not null. Default .. _funcAddLeftIfNull: funcAddLeftIfNull ~~~~~~~~~~~~~~~~~ .. container:: table-row Property funcAddLeftIfNull Data type string Description String will be added to the left if the result of the applied function, defined by "func=function\_name;" property, is null. Default .. _funcAddRightIfNotNull: funcAddRightIfNotNull ~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property funcAddRightIfNotNull Data type string Description String will be added to the right if the result of the applied function, defined by "func=function\_name;" property, is not null. Default .. _funcAddRightIfNull: funcAddRightIfNull ~~~~~~~~~~~~~~~~~~ .. container:: table-row Property funcAddRightIfNull Data type string Description String will be added to the right if the result of the applied function, defined by "func=function\_name;" property, is null. Default .. _fusion: fusion ~~~~~~ .. container:: table-row Property fusion Data type {begin, end} Description . fusion = begin; Starts the fusion of the fields, that is the following fields will be displayed on the same line. . fusion = end; Ends the fusion of the fields, that is the following field will be displayed on the next line. Default .. _label: label ~~~~~ .. container:: table-row Property label Data type string Description The displayed label will be provided by the string. Default .. _mail: mail ~~~~ .. container:: table-row Property mail Data type boolean Description A mail will be associated with the field. If the field is a checkbox, it is used as a flag to verify is the mail has to be sent. Mail information are the following and can be used as properties: . fieldForCheckMail=field\_name; The mail will be sent if the value of the fieldname for the current row is not null. . mailIfFieldSetTo=string; The mail will be sent if the value of the fieldname for the current row was previoulsy null or zero and is set to the given string value. . mailSender=string; mail of the sender. Marker ###user\_email### will be replaced by the user email. . mailReceiver=string; mail of the person who will receive the mail and process the information. . mailReceiverFromField=field\_name; The field\_name contains the mail of the person who will receive the mail and process the information. . mailReceiverFromQuery=MySQL\_Query; The receiver is obtained from a select query with an alias "value" that will used to retrieve the receiver. Example: :: SELECT email AS value FROM fe_users WHERE ... . mailSubject=string; subject of the mail. Markers ###fieldname### are allowed and will be replaced by their current value. . mailMessage=string, mail message. Markers ###fieldname### are allowed and will be replaced by their current value. . mailcc=string; if set the string is used as Cc: for the mail. Localization by means of the file locallang.xml can be used with $$$tag$$$ which will be replaced by its value according to the configuration language. . mailMessageLanguage=string; This parameter will force the language for the message to the value of the string. . mailMessageLanguageFromField=fieldname; This parameter will force the language for the message to the value of the field (for example a selector box). Default 0 .. _mailAlways: mailAlways ~~~~~~~~~~ .. container:: table-row Property mailAlways Data type boolean Description **The mail property must be set (mail = 1;) when using this property.** The mail is always sent when saving. Mail information are the following: . mailSender=string; mail of the sender. Marker ###user\_email### will be replaced by the user email. . mailReceiver=string; mail of the person who will receive the mail and process the information. . mailReceiverFromField=field\_name; The field\_name contains the mail of the person who will receive the mail and process the information. . mailReceiverFromQuery=MySQL\_Query; The receiver is obtained from a select query with an alias "value" that will used to retreive the receiver. Example: :: SELECT email AS value FROM fe_users WHERE ... . mailSubject=string; subject of the mail. Markers ###fieldname### are allowed and will be replaced by their current value. . mailMessage=string, mail message. Markers ###fieldname### are allowed and will be replaced by their current value. . mailcc=string; if set the string is used as Cc: for the mail. Localization by means of the file locallang.xml can be used with $$$tag$$$ which will be replaced by its value according to the configuration language. . mailMessageLanguage=string; This parameter will force the language for the message to the value of the string. . mailMessageLanguageFromField=fieldname; This parameter will force the language for the message to the value of the field (for example a selector box). Default 0 .. _mailAuto: mailAuto ~~~~~~~~ .. container:: table-row Property mailAuto Data type boolean Description **The mail property must be set (mail = 1;) when using this property.** The mail is sent when saving, if the field is not empty and if one field in the form is changed. Mail information are the following: . mailSender=string; mail of the sender. The marker ###user\_email### will be replaced by the user email. . mailReceiver=string; mail of the person who will receive the mail and process the information. . mailReceiverFromField=field\_name; The field\_name contains the mail of the person who will receive the mail and process the information. . mailReceiverFromQuery=MySQL\_Query; The receiver is obtained from a select query with an alias "value" that will used to retreive the receiver. Example: :: SELECT email AS value FROM fe_users WHERE ... . mailSubject=string; subject of the mail. Markers ###fieldname### are allowed and will be replaced by their current value. . mailMessage=string, mail message. Markers ###fieldname### are allowed and will be replaced by their current value. . mailcc=string; if set the string is used as Cc: for the mail. Localization by means of the file locallang.xml can be used with $$$tag$$$ which will be replaced by its value according to the configuration language. . mailMessageLanguage=string; This parameter will force the language for the message to the value of the string. . mailMessageLanguageFromField=fieldname; This parameter will force the language for the message to the value of the field (for example a selector box). Default 0 .. _onLabel: onLabel ~~~~~~~ .. container:: table-row Property onLabel Data type boolean Description The value will be displayed in place of the label. Not so useful since the label can be cut. Default 0 .. _orderLinkInTitle: orderLinkInTitle ~~~~~~~~~~~~~~~~ .. container:: table-row Property orderLinkInTitle Data type boolean Description If this property is set, it makes it possible to generate an hyperlink in the title bar of the "showAll" view. The hyperlink is associated with the field if the marker ###fieldname### is used in the "showAllTitle" section. Order clauses have to be defined in the "Where Tags" section of the "Query Form" with "+" and "-" sign added after "fieldname". Use for example: 'fieldname+' => array('order' => 'tablename.fieldname'), 'fieldname-' => array('order' => 'tablename.fieldname desc'), Default .. _orderLinkInTitleSetup: orderLinkInTitleSetup ~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property orderLinkInTitleSetup Data type string Description This property controls the display of the link when “orderLinkInTitle” is set. The format is “param1:param2:param3” where “param1” to “param3” can take the following values: . value: the field value is displayed, . link: the field value is displayed with a link with toggle the sort, . asc: an icon is displayed with a link to make an ascending sort, . desc: an icon is displayed with a link to make a descending sort, . ascdesc: two icons are displayed with separate links to make an ascending or descending sort. . if there is no value, nothing is displayed. (see How to change the order of the item list by clicking on the label in the title bar ? for examples). Default :link: .. _query: query ~~~~~ .. container:: table-row Property query Data type SQL statements Description The query will be executed once the input form data have been saved. Therefore, it can only be used with "input" or "update" views. **Because any query may be executed, for security reason, this property can only be used if an admin user has checked the field “Allow the use of the “query” property” in the advanced folder of the flexform.** It may be useful, for example, to update a specific table when the current data are saved. Several queries can be used in the SQL statements. Each query must be separated using "\;". Special markers can be used in the statement: . ###uid### will be replaced by the current record uid. . ###CURRENT\_PID### will be replaced by the current page uid. . ###STORAGE\_PID### will be replaced by the storage page uid. . ###user### will be replaced by the user id. . ###value### will be replaced by the current value for the field. Default .. _queryOnValue: queryOnValue ~~~~~~~~~~~~ .. container:: table-row Property queryOnValue Data type string Description The query, as defined above, will be executed if the current field value is equal to the right hand side string. Default .. _queryForEach: queryForEach ~~~~~~~~~~~~ .. container:: table-row Property queryForEach Data type Field name Description If the field is a true MM relation, the query, as defined above, will be executed for all the record in the relation. The special marker ###field\_name###, where "field\_name" is the field where the relation is defined, can be used to identify the record. It will be replaced by the uid of the associated record. Default .. _reqValue: reqValue ~~~~~~~~ .. container:: table-row Property reqValue Data type SQL SELECT statement Description SQL SELECT statement must have an alias "value" which will be used as the value to display. Special markers can be used in the statement : . ###uid### will be replaced by the current record uid. . ###uidItem### will be replaced by the uid of the current subform item. . ###user### will be replaced by the user id. . ###row[field\_name]### where field\_name is the name of a field in the current record, will be replaced by its current value. The following example returns the name of the user who has created the current record, assuming that tx\_mytable is the local table: :: reqValue= SELECT name AS value FROM fe_users WHERE uid=(SELECT cruser_id FROM tx_mytable WHERE uid=###uid###); Default .. _setExtendLink: setExtendLink ~~~~~~~~~~~~~ .. container:: table-row Property setExtendLink Data type Table name Description The table name will be left-joined to existing tables. Default .. _stdWrapValue: stdWrapValue ~~~~~~~~~~~~ .. container:: table-row Property stdWrapValue Data type TS syntax Description It defines a conventional TypoScript stdWrap property. You can add here full TS syntax. Do not forget that the configuration field is ended by a semi-column, therefore if you need a semi-column in your TS write it "\;" Default .. _tsObject: tsObject ~~~~~~~~ .. container:: table-row Property tsObject Data type cObject Description It defines a TS content object (e.g. TEXT, IMAGE, ...) Default .. _tsProperties: tsProperties ~~~~~~~~~~~~ .. container:: table-row Property tsProperties Data type String Description It defines the properties of the TS cObject. Do not forget that the configuration field is ended by a semi-column, therefore if you need a semi-column in your TS write it “\;”. Default .. _value: value ~~~~~ .. container:: table-row Property value Data type String Description The value of the field will be directly provided by the string instead of the record value. Localization by means of the file locallang.xml can be used with $$$tag$$$ which will be replaced by its value according to the configuration language. Markers ###fieldname### are allowed and will be replaced by their current value. Default .. _verifier: verifier ~~~~~~~~ .. container:: table-row Property verifier Data type Verifier name Description Verifiers can be used to check if a field satisfy a constraint. Each field can have one verifier. Each verifier is associated with a parameter. Verifiers can be defined by the user. They must be added in the class tx\_savlibrary\_verifiers defined in the file: class.tx\_savlibrary\_verifiers.php. The verifier name can be : . isValidPattern . isValidLength . isValidInterval . isValidQuery Default .. _verifierMessage: verifierMessage ~~~~~~~~~~~~~~~ .. container:: table-row Property verifierMessage Data type string Description It replaces the default message. Localization by means of the file locallang.xml can be used with $$$tag$$$ which will be replaced by its value according to the configuration language. The marker $$$label[fieldName]$$$ will be replaced by the fieldName title according to the localization. Default .. _verifierParam: verifierParam ~~~~~~~~~~~~~ .. container:: table-row Property verifierParam Data type expression Description The expression can be : . a regular expression for the verifier "isValidPattern". For example /^[A-Za-z0-9\_]\*$/ will allow any input which contains letters, numbers or underline characters. . an integer value for the verifier "isValidLength". . an interval [a, b] where a and b are integers for the verifier "isValidInterval". . a SELECT query for "isValidQuery". The marker ###value### in the query will be replaced by the value of the field. The marker ###uid### will be replaced by the uid of the current record. Default .. _verifierSetWarning: verifierSetWarning ~~~~~~~~~~~~~~~~~~ .. container:: table-row Property verifierSetWarning Data type boolean Description If set an error detected by the verifier becomes a warning. In that case, the field content is written in the database (which is not the case for errors) and a message is displayed. Default 0 .. _wrapItem: wrapItem ~~~~~~~~ .. container:: table-row Property wrapItem Data type string Description The string will be used to wrap the item. The syntax in the same as in TypoScript. Localization by means of the file locallang.xml can be used with $$$tag$$$ which will be replaced by its value according to the configuration language. The marker $$$label[fieldName]$$$ will be replaced by the fieldName title according to the localization. Default .. ###### END~OF~TABLE ###### .. _Links-field-type-link: Links (field type: link) """""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _generateRTF: generateRTF ~~~~~~~~~~~ .. container:: table-row Property generateRTF Data type boolean Description Sets the RTF generator. Default 0 .. _templateRTF: templateRTF ~~~~~~~~~~~ .. container:: table-row Property templateRTF Data type File name Description Defines the template to be used by the RTF generator. Field markers ###tableName.fieldName### or ###fieldName### (for aliases) can be used. Default .. _saveFileRTF: saveFileRTF ~~~~~~~~~~~ .. container:: table-row Property saveFileRTF Data type File name Description Name under which the generated file will be saved. Field markers ###tableName.fieldName### or ###fieldName### (for aliases) can be used. Default .. _tableName-fieldName: tableName.fieldName ~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property tableName.fieldName Data type expression Description Expression can be string1->string2 or NL-> string2 In an rtf document, if the field marker ###tableName.fieldName### exists string1 will be replaced by string2. String1 can be NL (for the ASCII character LF). It may be useful when one wants to input data in a textarea and display them in one line with a given separator in the file. Default .. _link: link ~~~~ .. container:: table-row Property link Data type string Description The string will be used for the link instead of the field value. Default .. _fieldLink: fieldLink ~~~~~~~~~ .. container:: table-row Property fieldLink Data type fieldName Description Sets the attribute "link" with the content of the field whose name is given by fieldName. Default .. _message: message ~~~~~~~ .. container:: table-row Property message Data type string Description Message associated with the link. Default .. _fieldMessage: fieldMessage ~~~~~~~~~~~~ .. container:: table-row Property fieldMessage Data type fieldName Description Sets the attribute "message" with the content of the field whose name is given by fieldName. Default .. ###### END~OF~TABLE ###### .. _Radio-buttons-field-type-radio: Radio buttons (field type: radio) """"""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _cols: cols ~~~~ .. container:: table-row Property cols Data type integer Description Number of columns to display. Default 1 .. _default: default ~~~~~~~ .. container:: table-row Property default Data type integer Description Default value. Default .. _displayAsImage: displayAsImage ~~~~~~~~~~~~~~ .. container:: table-row Property displayAsImage Data type boolean Description If set to 1, radio buttons are displayed as images instead of labels. Default 0 .. _horizontalLayout: horizontalLayout ~~~~~~~~~~~~~~~~ .. container:: table-row Property horizontalLayout Data type bollean Description If set to 1, radio buttons are displayed horizontally in edit forms. Default 0 .. ###### END~OF~TABLE ###### .. _Selectors-field-type-select: Selectors (field type: select) """""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _func: func ~~~~ .. container:: table-row Property func Data type Function name Description It associates a function with the selectorbox items. The parameter function\_name can be: . makeItemLink . makeExtLink . makeLink . makeUrlLink . makeEmailLink See functions for the associated parameters. Default .. _separator: separator ~~~~~~~~~ .. container:: table-row Property separator Data type character or string Description It can be used with selector boxes associated with a MM relation to replace the default
separator between items in showAll or showSingle views. Default .. ###### END~OF~TABLE ###### .. _String-Input-field-type-input: String Input (field type: input) """""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _size: size ~~~~ .. container:: table-row Property size Data type integer Description Size of the field. Default 30 .. _keepZero: keepZero ~~~~~~~~ .. container:: table-row Property keepZero Data type boolean Description If set and the field is equal to zero the "0" is displayed otherwise an empty field is displayed. Default 0 .. ###### END~OF~TABLE ###### .. _Textarea-field-type-textarea: Textarea (field type: textarea) """"""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _cols: cols ~~~~ .. container:: table-row Property cols Data type integer Description Defines the number of cols of the textarea. This attribute overwrites the same attribute in the TCA. Default .. _rows: rows ~~~~ .. container:: table-row Property rows Data type integer Description Defines the number of rows of the textarea. This attribute overwrites the same attribute in the TCA. Default .. ###### END~OF~TABLE ###### .. _Textarea-with-RTE-field-type-textarea-rte: Textarea with RTE (field type: textarea\_rte) """"""""""""""""""""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _height: height ~~~~~~ .. container:: table-row Property height Data type integer Description Defines the height of the textarea. The integer value represents the height in pixels (45 pixels are automatically added). Default .. _width: width ~~~~~ .. container:: table-row Property width Data type integer Description Defines the width of the textarea. The integer value represents the width in pixels. Default .. ###### END~OF~TABLE ###### .. _XML-JpGraph-field-type-graph: XML JpGraph (field type: graph) """"""""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _graphTemplate: graphTemplate ~~~~~~~~~~~~~ .. container:: table-row Property graphTemplate Data type string Description File name of the XML template from the site root. Default .. _markers: markers ~~~~~~~ .. container:: table-row Property markers Data type string Description Comma-separated list of definitions. Example: “marker#begin = ###beginPeriod###” means that the “marker” whose id is “begin” in the template will be replaced by the marker “###beginPeriod###”, that is by the alias “beginPeriod”. Default .. ###### END~OF~TABLE ###### .. _Field-configuration-by-means-of-the-page-TS-Config: Field configuration by means of the page TS Config ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The configuration of any field can be changed by means of the page TS Config. The syntax is the following: **tx\_extensionKey.formName.viewType.fieldName.fieldProperty = propertyValue.** For example, assume that one wants to change the width and the height of the image in the “All” view in the example 1. - The “extensionKey” must have no underscore, i.e. “savlibraryexample1”, - the “formName” is “Contact”, - the “viewType” is “showAll” (use “showSingle” or “inputForm” for the other types), - the “fieldName” is “image”, - the “fieldProperty” is “width” or “height. It leads to the following configuration: :: tx_savlibraryexample1.Contact.showAll.image.width =200 tx_savlibraryexample1.Contact.showAll.image.height = 200 .. _Maintenance-configurations: Maintenance configurations ^^^^^^^^^^^^^^^^^^^^^^^^^^ The SAV Library Extension Generator includes flags to deal with maintenance operation. A global maintenance flag is available at the SAV Library level using the Extension Manager. If you check the flag, a maintenance message will be displayed by all extensions built with the SAV Library and filters will not be displayed. If you provide a list of users'id, separated by a comma, then these users will still see the extensions and the filters. Global maintenance is useful for developers when global changes are performed on the SAV Library. |img-34| The maintenance can also be performed at the extension level. In order to have a maintenance flag in the Extension Manager, you must select “Add maintenance” when saving you extension in the Kickstarter. A flag will be added for the extension, in the Extension Manager. If you check it, a maintenance message will be displayed except for allowed users in the configuration of the SAV Library. |img-35| .. _Configuration-of-the-code-generation: Configuration of the code generation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can either choose to have the configuration generated as a XML file or directly included as a php array in the pi1 class of the generated extension. Let us assume that we are generating the extension “sav\_library\_example1”. - If you select the checkbox “Generate XML configuration”, the configuration will be saved in the file “pi1/ tx\_savlibraryexample1\_ pi1.xml”. The method initExtConfig() is automatically modified to read the configuration from the XML file. This configuration is set by default when the SAV Library Extension Generator is switched on. - If you do not select this checkbox, the configuration generated by the kickstarter is saved in the file “pi1/class.tx\_savlibraryexample1\_ pi1.php” under the form of a php-array in the method initExtConfig(). .. _Caching: Caching ^^^^^^^ A caching feature was introduced with the version 3.1.0 of the SAV Library Extension Generator. The plugin behaviour may be changed for each form. By default, the plugin runs as USER\_INT for each form, that is no caching is performed. By selecting the checkbox “Allow caching” in the “Forms” section of the Kickstarter, the plugin will run as USER for this form. It means that caching will be set. A “cHash” parameter is added to each item links used to access to the “showSingle” view associated with the item. |img-36| A “cHash” parameter can also be added to other links such as: - the close button, - arrows in form and/or subform, - page selector in form and/or subform. This configuration is possible in the “Advanced” folder tab of the flexform associated with the plugin (see below). When the plugin is running as USER (caching enabled) and an item is updated in the “inputForm” view, the cache of the current page is cleared on saving so that updated information could be displayed. If you need to clear the cache of other pages, select this pages in the flexform. When the plugin is running as USER\_INT (caching disabled) and an item is updated in the “inputForm” view, it may be needed to clear the cache of pages where another form of the same extension is running as USER. For example, it is the case when one uses an administration form and other forms to display the data. Select the pages whose cache must be cleared in the flexform. |img-37| .. _Tutorial-1-Contact-List: Tutorial 1 : Contact List ------------------------- .. _Introduction: Introduction ^^^^^^^^^^^^ This example is taken from `http://www.typo3journal.info/articles/developpement.html `_ . It creates a contact list with the first name, last name, street, zip code, city and an image of the contact. You can download this example from the TER (sav\_library\_example1). Install it and enjoy. The following sections explain how to create the extension and the new features, if you do not download it. .. _Creation-of-the-extension: Creation of the extension ^^^^^^^^^^^^^^^^^^^^^^^^^ Create the extension by filling the language, plugin, table, field sections using the Kickstarter as in the original tutorial. |img-38| .. _Starting-the-SAV-Extension-Generator: Starting the SAV Extension Generator """""""""""""""""""""""""""""""""""" Click on the “cross” icon at the right hand side of “SAV Extension generator”. |img-39| Click on the “Context Sensitive Help” icon and **read the description associated with each field** . Validate the check box “Generate Form” and update. Now, the extension generator is active. .. _Definition-of-the-form-views: Definition of the form views """""""""""""""""""""""""""" The extension generator allows to define as many views as you want of the same extension. Four types of view may be used: - “Show all” views which display all the items associated with a query, - “Show single” views which display only one item, - “Input form” views which make it possible to input items in front end, - “Alt form” views which are used to develop update or print views. A conventional extension deals with one form with three views : one “Show all” view to present items, one “Show Single” view to display one item and an “Input form” view to input items. However, you may only have one “Show all” view. You may also have several forms. In order to define your views, click on the “cross” icon at the right hand side of “Form views”. Click on the “Context Sensitive Help” icon and **read the description associated with each field** . |img-40| |img-41| Give a title to your view (for example “All”, “Single”, “Input”), set its type with the selector and update. The caption below shows a “show all” view named ”All”. |img-42| Fill the showAllItemTemplate field. In general, it is an