|Homepage||Robin Richmond's Genealogy Database|
|Mod Support||My Mod Support form or TNG Community Forums|
|Contact Developer||My Mod Support form|
|Min TNG V||10.1|
|Max TNG V||at least 11.1.2|
Modifies admin_genconfig.php, admin_updateconfig.php, English cust_text.php;
This is a utility mod that supports other mods, but is not required by them.
Purpose of the Mod
To support the use of Field Buttons by other mods, by installing
- Administrative setup form fields that implement a new TNG system variable, $tngconfig['rrfieldbuttonflags']], which allows Field Buttons types to be disabled.
This mod is needed only if a TNG site administrator,
- Installs at least one mod that defines Field Buttons in a form that is changed by that mod, and
- Wants to see Field Buttons in forms.
That is, if this mod has not been installed, Field Buttons that have been defined by various other mods will simply not appear. Thus, mods that install Field Buttons are not strictly dependent on the Field Buttons mod.
Field Buttons are hyperlinks formatted as buttons, that, with a single click, assign a particular value to an "attached" form field. There are four types of field buttons:
- X - Clear the field
- R - Reset/Reload the initial value; the value that was in place when the form was loaded.
- D - Default - Set the value to a default that was defined elsewhere, such as by a TNG system parameter or Mod Manager option.
- A - Set an 'All items' value. (At this writing, A buttons have been used only with "Results Per Page" fields.)
Note that it would be very rare for all four buttons to be attached to one form field. Only the applicable buttons should be attached to any given form field.
The four letters X, R, D, and A are used in documentation and in code to identify the field buttons, and they are the default on-screen labels for the buttons. But the labels are configurable through a translation string. In addition, a set of four fields in the Admin >> Setup >> General Settings >> Miscellaneous screen allow individual buttons to be suppressed in all forms on the TNG site.
Buttons are "attached" to a form field in that
- They follow it without intervening spaces, and the form field and its Field Buttons are wrapped by a tag that doesn't allow line breaks, and
- The buttons' field names are based on the fieldname of the field that they are attached to. The buttons' field names are essentially what causes them to modify their form field.
This screen clip illustrates 5 field buttons on 2 fields in the Admin>>Reports program that has been modified by the Admin_Reports_List mod.
- The search field has X and R buttons. There is no meaning in the search field to a default value (remember, the initial value is covered by the R button) or an "all items" value (which would just be an empty search field, and the X button serves the purpose of clearing the field.)is perhaps an empty field).
- The 'Results per page" has R, D, and A buttons.
- The R button restores the initial value - the value that was present when the form was loaded.
- The D button sets a default value, which, in this case, is the TNG system variable $maxsearchresults.
- And the A button sets a value that represents 'All Items'. That value is the word 'all' (or its translation).
- the X button is not needed when a field value is already empty,
- the R button is not needed when the current value is the initial value,
- the D button is not needed when current value is the default value, and
- the R button is not needed when the current value is the 'All Items' value.
When a button is not needed, it is shaded out, but still physically present on the screen.
We can tell just by looking a the screen clip above that is does not represent the initial state of a form, because we can see the R buttons. R buttons are always shaded out when the form is first loaded, because, by definition, the form field values when the form is loaded are the initial values. Here's what the same form might look like when first loaded, if the search value is empty, and the Results per page value is the site default value (in this case, 30).
The search field's R and X buttons are both shaded out, but still present (and barely visible). The 'Results per page' field's R and D buttons are also shaded out, and only its A button is visible.
If the user enters the search string "children", and click on the A button, we'll see this:
where the search field's X button is visible because the search field has a non-empty value, both R buttons are visible because both fields have changed, and the 'Results per page' field's D button is visible because the field's value is not the default of 30. Now, only the A button is shaded out.
Adding Field Buttons to Forms
- An ID, and
- A specific style class for each field button that will be attached to the form field (see examples below).
In addition, the program must:
The program can define the form field ID and/or classes either
- By modifying the HTML code directly, or
See details and examples in the Implementation Details section below.
Compatibility With Other Mods
This mod is compatible with other mods that modify the Admin >> Setup >> General Settings screen.
This mod is not dependent on any other mods, nor are any other mods strictly dependent on this mod. But, as noted above, when other mods install Field Buttons, this mod must be installed in order for those field buttons to be visible.
Mods that implement Field Buttons include
- Admin_Branches, Admin Cemeteries Search, Admin Places Search, and Admin Reports Search, all of which attach field buttons to the Search field and a new 'Results per page' field.
- Cemetery Edit - attaches field buttons to 5 text fields, including the textarea field for Notes.
- Mod Manager Compare, where the kickoff form for the new Mod Comparison report contains several field buttons.
- A working TNG installation.
- An installed current version of the Mod Manager.
- You should backup files listed in the panel on the right.
- Remove and delete previous version of this mod.
- Backup the files updated by this mod. They are listed in the panel at the upper right.
- Download the .zip file, Extract its .cfg file to the mods folder.
- Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.
In the event of a problem
| AFTER: The Mod Comparison Report kickoff form, just after being loaded, where 3 fields have X, R, and D buttons. (All 3 have default values that are defined by the Mod Manager Options.)