Jump to content

Relation Flags

From NusaATK

Intro

Most relations have a $flags param in the constructor. You can pass multiple flags by concatenating them with a pipe symbol (|).

Example:

 $rel = &new atkOneToManyRelation("notes","node.notes","note_related_id", AF_HIDE_LIST);

Available flags

This is a list of flags that you can use:

(atkextendableshuttlerelation) AF_SHUTTLERELATION_NO_AUTOLOAD
Do not load the available records. Leave it to a partial update. Often used with the shuttlecontrols when editing large tables
(atkmanyboolrelation) AF_MANYBOOL_AUTOLINK
Shows add links to add records for the related table
(atkmanyboolrelation) AF_MANYBOOL_NO_TOOLBAR
Hides the 'Select All/Select None/Invert Selection' toolbar.
(atkmanytomanyselectrelation) AF_MANYTOMANYSELECT_DETAILEDIT
????
(atkmanytomanyselectrelation) AF_MANYTOMANYSELECT_DETAILADD
????
(atkmanytomanyselectrelation) AF_MANYTOMANYSELECT_NO_AUTOCOMPLETE
????
(atkmanytoonerelation) AF_RELATION_AUTOLINK
If this flag is set, the edit-dropdown will have 2 additional links; one to edit the currently selected record, and one to add a new record to the dropdown. When displaying the attribute, for example in recordlists, the displayed value is automatically displayed as a link to the view-page of the selected record.
(atkmanytoonerelation) AF_MANYTOONE_AUTOLINK = AF_RELATION_AUTOLINK
Create edit/view links for the items in a manytoonerelation dropdown.
(atkmanytoonerelation) AF_RELATION_NO_NULL_ITEM
If this flag is set, and $config_list_obligatory_null_item is set to true, to prevent relations from selecting a default record, then this will remove that null item for the relation that has this flag.
(atkmanytoonerelation) AF_MANYTOONE_NO_NULL_ITEM = AF_RELATION_NO_NULL_ITEM
Do not add null option ever
(atkmanytoonerelation) AF_RELATION_AUTOCOMPLETE
Instead of a dropdown, the user is presented with a text box that features autocompletion when typing.
(atkmanytoonerelation) AF_MANYTOONE_AUTOCOMPLETE
= AF_RELATION_AUTOCOMPLETE Use auto-completion instead of drop-down / selection page
(atkmanytoonerelation) AF_MANYTOONE_LAZY
By default, when loading records in a node, the destination record of manytoonerelations is loaded directly with the main query. When this flag is set, it is only loaded when it is needed in an edit screen.
(atkmanytoonerelation) AF_MANYTOONE_OBLIGATORY_NULL_ITEM
When AF_OBLIGATORY is used, this makes sure that the first option of the drop down list is set to "none". May be handy if onChange event is set on relation.
(atkmanytoonerelation) AF_DONT_SPLIT
In dropdown search -TRUE don't split string on spaces do search NULL or FALSE split and do OR search (default action)
(atkmatrixrelation) AF_MATRIX_ACYCLIC
Checks if a matrix is acyclic (NB attribute no longer supported or maintained)
(atkonetomanyrelation) AF_RESTRICTED_DELETE Only allow deletion of master item when there are no child records.
(atkonetomanyrelation) AF_ONETOMANY_ADD_DIALOG
Use pop-up dialogs for adding records
(atkonetomanyrelation) AF_ONETOMANY_EMBED = AF_ONETOMANY_ADD_DIALOG
If this flag is set, the 'add' form for new child records is loaded inline, rather than in a new page. @deprecated Replaced by AF_ONETOMANY_ADD_DIALOG.
(atkonetomanyrelation) AF_ONETOMANY_ADDORCOPY_DIALOG
Use pop-up dialog for whatever a new record must be copied or must be added.
(atkonetomanyrelation) AF_ONETOMANY_SHOW_ADD
Using this flag it's possible to use the atkOneToManyRelation when you still need to add the master record. The detail records will be temporarily stored in the session until the master record is added. WARNING: Not on by default because this only works in simple cases, not having an id will lead to strange results for Nodes that use the foreign key in their descriptor, Nodes with unique records (AF_UNIQUE always just checks the database) and Combined primary keys
(atkonetoonerelation) AF_ONETOONE_ADD
Override the default no add flag
(atkonetoonerelation) AF_ONETOONE_ERROR
For backwardscompatibility reasons, the atkOneToOneRelation does not validate input of the destination node. If this flag is set, validation is done.
(atkonetoonerelation) AF_ONETOONE_INTEGRATE
If a node has a onetoone relationship with another node, the edit fields of the other node are indented slightly to indicate that they belong to the other node. If the AF_ONETOONE_INTEGRATE flag is set, the other nodes' edit fields are displayed in such a manner that it is invisible to the user that they are part of another node. The user sees the entire edit-page as if all fields belonged to the same node.
(atkonetoonerelation) AF_ONETOONE_LAZY
Use lazy loading instead of query addition.
(atkonetoonerelation) AF_ONETOONE_RESPECT_TABS
Respects tab/sections that have been assigned to this attribute instead of using the tabs assigned for the attributes in the destination node. This flag is only useful in integration mode.