Node Flags
From Achievo/ATK Wiki
Node flags can be used to influence the behaviour of node.
The atkNode class has a $flags param in the constructor. You can pass multiple flags by concatenating them with a pipe symbol (|).
Example:
$this->atkNode("employees", NF_ADD_LINK|NF_TRACK_CHANGES);
In atkMetaNode based nodes, you can pass flags as a protected member, like this:
class somenode extends atkMetaNode { protected $flags = array(NF_ADD_LINK, NF_TRACK_CHANGES); ...
Available flags
This is a list of flags that you can use:
- NF_ADD_LINK
- The add-screen is accessed by an 'Add' link instead of embedded directly in the admin screen. (Note: in atkMetaNode based nodes, this flag is automatically added.)
- NF_EDITAFTERADD
- When this flag is set, the add page is immediately followed by the edit page of the newly added record. This can be used when there are attributes (like atkOneToManyRelation) that can only be changed once the record is added, and you want to give the user the opportunity to edit them right after the record has been stored.
- NF_ADDAFTERADD
- When this flag is set, the user can add new records repeatedly.
- NF_TRACK_CHANGES
- When this flag is set, the postUpdate trigger is passed both the original and the new record, so you can compare the values. The original record is part of the passed $record parameter, it's stored under the 'atkorgrec' key, for example: var_dump($record[["atkorgrec"]);
- NF_READONLY
- The node is readonly. Add, edit and delete links are no longer present.
- NF_COPY
- Enable the record copy functionality. With this flag, users with 'add' privilege can copy records.
- NF_EDITAFTERCOPY
- Enable edit immediately after the record copy. With this flag, users with 'add' privilege can copy and edit records.
- NF_IMPORT
- Enable CSV import functionality. With this flag, users with 'add' privilege can import records from CSV files.
- NF_EXPORT
- Enable CSV export functionality. With this flag, users with 'view' privilege can export records to a CSV file.
- NF_MULTILANGUAGE (alias for NF_ML)
- To enable the auto-multilanguage feature for this node. Used in combination with AF_MULTILANGUAGE. Howto: Multilanguage_node (Note: this functionality is not available in the ATK-light version that ships with Achievo.).
- NF_NO_ADD
- Turn off add-functionality for this node
- NF_NO_DELETE
- Turn off delete-functionality for this node
- NF_NO_EDIT
- Turn off edit-functionality for this node
- NF_NO_VIEW
- Turn off view-functionality for this node
- NF_NO_SEARCH
- Turn off search-functionality for this node completely.
- NF_NO_EXTENDED_SEARCH
- Turn off extended search for this node. Searching through the search bar is still enabled.
- NF_NO_FILTER
- Setting this flag will cause the node to ignore any addFilter and ?atkfilter= calls.
- NF_NO_SECURITY
- This flag disables all security checks, meaning that any user can do anything to this node. (So be careful with this flag.)
- NF_LOCK
- Turn on (pessimistic) record locking for this node. When this flag is set, only one user at a time can view/edit a record. Other users see a lock icon and will get an error message if they try to edit the record anyway. Locks will automatically expire after a certain amount of inactivity.
- See for usage example the Record locking howto.
- NF_MULTI_RECORD_ACTIONS or NF_MRA
- With this flag enabled, some actions (like the delete action or custom actions) are allowed to operate on multiple records at once, from the admin view of the node. The flag adds a column of checkboxes to the recordlist, so the user can select which records to perform the action on.
- NF_CACHE_RECORDLIST
- This is a performance speedup flag. When this is set, the html output of the recordlist is cached so the records do not have to be loaded on each subsequent page request. The cache is cleared automatically when records are modified/added or deleted.
- NF_AUTOSELECT
- If this flag is set and the node's 'select' page is used (for example in an AF_LARGE screen for selecting a record in a relationship), then the record is autoselected if there is only one to choose from.
- NF_EXT_SORT
- Enable extended sorting (multicolumn sort).
- NF_ADD_DIALOG
- Use the dialog popup box when adding a new record for this node.
- NF_ADDORCOPY_DIALOG
- Use the dialog add-or-copy popup box when adding a new record for this node.
- NF_EDITAFTERCOPY
- Records may be copied and open for editing
ATK Attribute Flags | Module Flags | Node Flags