Jump to content

Node Flags

From NusaATK
Revision as of 07:43, 19 January 2006 by bahtiar (talk | contribs) (Intro)

Intro

The atkNode class has a $flags param in the constructor. You can pass multiple flags by concatting them with a pipe symbol (|).

Example:

$this->atkNode("employees", NF_ADD_LINK|NF_TRACK_CHANGES);

Available flags

This is a list of flags that you can use:

The add-screen is accessed by an 'Add' link instead of embedded directly in the admin screen.

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_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_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_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

Turn off search-functionality for this node completely.

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 record locking for this node. When this is flag, only a single user can edit a record. Other users see a lock icon and will get an error message if someone tries to edit the record anyway. Locks will automatically expire after a certain amount of inactivity.

NF_MULTI_RECORD_ACTIONS or NF_MRA

With this flag disabled, 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.

Original Poster: Ivo