ATK Attribute Flags
Appearance
Intro
Most attributes have a $flags param in the constructor. You can pass multiple flags by concatenating them with a pipe symbol (|).
Example:
$this->add(new atkAttribute("name", AF_SEARCHABLE|AF_OBLIGATORY));
Available attribute flags
This is a list of all attribute flags Note that atkattribute flags are also generally applicable to other attributes
- (atkattribute ) AF_OBLIGATORY
- Value must be entered
- (atkattribute ) AF_UNIQUE
- Value must be unique
- (atkattribute ) AF_PRIMARY| AF_OBLIGATORY
- Part of the primary-key node, also makes it obligatory
- (atkattribute ) AF_AUTO_INCREMENT
- Auto-increment field
- (atkattribute ) AF_AUTOINCREMENT = AF_AUTO_INCREMENT
- (Alias for AF_AUTO_INCREMENT (auto-increment flag is often mistyped)
- (atkattribute ) AF_HIDE_LIST
- Don't show in record lists hide flag
- (atkattribute ) AF_HIDE_ADD
- Don't show on add pages hide flag
- (atkattribute ) AF_HIDE_EDIT
- Don't show on edit pages hide flag
- (atkattribute ) AF_HIDE_SELECT
- Don't show on select pages hide flag
- (atkattribute ) AF_HIDE_VIEW
- Don't show on view pages hide flag
- (atkattribute ) AF_HIDE_SEARCH
- Not searchable in extended search
- (atkattribute ) AF_FORCE_LOAD
- Normally, when an attribute is hidden, its value is not loaded from the database. Sometimes however you need the value, even though it is hidden (for example to influence the display of another attribute). In this case, the AF_FORCE_LOAD flag will ensure that the attribute value is always loaded, regardless of whether it's hidden or not.
- (atkattribute ) AF_HIDE = AF_HIDE_EDIT | AF_HIDE_ADD | AF_HIDE_LIST | AF_HIDE_SEARCH | AF_HIDE_VIEW | AF_HIDE_SELECT
- Attribute is always hidden. Note that this will typically cause the attribute not to be loaded and not available in $record;( if this is undesirable add the flag AF_FORCE_LOAD)
- (atkattribute ) AF_READONLY_ADD
- Readonly in add
- (atkattribute ) AF_READONLY_EDIT
- Readonly when edited
- (atkattribute ) AF_READONLY = AF_READONLY_EDIT | AF_READONLY_ADD
- Always readonly
- (atkattribute ) AF_NO_LABEL
- Don't display the attribute name as a label in front of the attribute. The attribute is displayed directly at the position the label would normally be.
- (atkattribute ) AF_NOLABEL = AF_NO_LABEL
- No label in forms
- (atkattribute ) AF_BLANK_LABEL
- Don't display the attribute name as a label in front of the attribute. The difference with AF_NO_LABEL is that with this flag the label is replaced with empty space, leaving the attribute itself at its original position.
- (atkattribute ) AF_BLANKLABEL = AF_BLANK_LABEL
- Blank label in forms
- (atkattribute ) AF_NO_SORT
- Cannot be sorted in recordlists.
- (atkattribute ) AF_NOSORT = AF_NO_SORT
- Cannot be sorted in recordlists
- (atkattribute ) AF_SEARCHABLE
- Attribute is searchable in list views
- (atkattribute ) AF_TOTAL
- In recordlists, the column for this attribute is automatically totalized, and the total is displayed in an extra row right under the recordlist.
- (atkattribute ) AF_POPUP
- Attributes that support this flag, like the atkFileAttribute, open a popup instead of showing their contents directly in the recordlist.
- (atkattribute ) AF_CASCADE_DELETE )
- Attributes that support cascade deletes, like the atkOneToManyRelation, will perform delete functionality when this flag is set and a record is deleted.
- (atkattribute ) AF_LARGE
- Attributes that support this flag use this flag as a hint that a large number of records will need to be processed. The atkManyToOneRelation uses this flag to prevent dropdowns with too many records.
- (atkattribute ) AF_NO_FILTER
- Attributes that support this flag, like the atkManyToOneRelation, will use this flag to determine whether filters on related nodes should be executed.
- (atkattribute ) AF_PARENT
- When using an atkTreeNode instead of atkNode, this flag tells the node that the attribute is the foreign key in the parent/child relation
- (atkattribute ) AF_NO_QUOTES
- No quotes are used when adding to database
- (atkattribute ) AF_ML
- Multi-language field
- (atkattribute ) AF_MULTILANGUAGE = AF_ML
- Indicates which attribute is used to store the languagecode. Used in combination with NF_MULTILANGUAGE
- (atkattribute ) AF_AUTOKEY = AF_PRIMARY | AF_HIDE |AF_AUTOINCREMENT
- Shortcut for hidden auto-incremented primary key
- (atkboolattribute ) AF_BOOL_OBLIGATORY
- Normally a atkBoolAttribute is not flagged obligatory, and if the standard AF_OBLIGATORY flag is set it is automatically removed when the attribute is constructed. If you really really really wants to show this attribute as obligatory, use this flag.
- (atkboolattribute ) AF_BOOL_INLINE_LABEL
- Show an extra label right next to the checkbox. ATK searches the language file for the following variants <attribute>_label, <attribute> (next to the module/node prefixes). Don't forget to add the AF_BLANK_LABEL flag if you don't want to show the normal label.
- (atkboolattribute ) AF_BOOL_DISPLAY_CHECKBOX
- Display checkbox in view / list mode instead of "yes" or "no".
- (atkdateattribute ) AF_DATE_STRING
- Date must be entered as a string, instead of using the date-selection dropdowns. Any string accepted by the php function strtotime is valid input when this flag is set.
- (atkdateattribute ) AF_DATE_EMPTYFIELD With this flag set, it is possible for the user to select a null-date.
- (atkdateattribute ) AF_DATE_NO_CALENDAR
- Do not append the popup calendar.
- (atkdateattribute ) AF_DATE_DISPLAY_DAY
- Show the day of the week in the display
- (atkdateattribute ) AF_DATE_EDIT_NO_DAY
- Don't display the day of the week in edit mode
- (atkdateattribute ) AF_CLEAR_TOUCH_BUTTONS
- Display buttons to clear and 'touch' date
- (atkdatetimeattribute ) AF_CLEAR_TOUCH_BUTTONS
- Display buttons to clear and 'touch' date
- (atkdummyattribute ) AF_DUMMY_SHOW_LABEL
- Make the attribute label its field. Use the flag AF_NOLABEL if you want to start at the beginning of the line.
- (atkdurationattribute ) AF_DURATION_STRING
- Date must be entered as an english date string (strtotime)
- (atkfileattribute ) AF_FILE_NO_UPLOAD
- Disable uploading of files
- (atkfileattribute ) AF_FILE_NO_SELECT
- Disable the dropdown to select existing files. If this flag is set, the user can only upload a new file or keep the existing one.
- (atkfileattribute ) AF_FILE_NO_DELETE
- Remove the ability to delete the files (from the database. The physical file is never removed, unless the AF_FILE_PHYSICAL_DELETE flag is set).
- (atkfileattribute ) AF_FILE_NO_AUTOPREVIEW
- By default, the atkFileAttribute tries to determine the filetype of the uploaded file, and if it's an image, display the image. If this flag is set, the detection is turned off and images are not displayed.
- (atkfileattribute ) AF_FILE_PHYSICAL_DELETE
- If the file is removed from the database, the physical file is also removed from the server.
- (atkfileattribute ) AF_FILE_POPUP AF_POPUP
- Instead of directly displaying the image, the attribute will display a link to a popup, if this flag is set
- (atkipattribute ) AF_IP_ALLOW_WILDCARDS
- Allow *
- (atkipattribute ) AF_IP_STORENUMERIC
- Store as numeric value
- (atkipattribute ) AF_IP_SINGLEFIELD
- Single field xxx.xxx.xxx.xxx instead of deault 4 fields xxx xxx xxx xxx
- (atklistattribute ) AF_NO_TRANSLATION
- Do not translate the options
- (atklistattribute ) AF_LIST_NO_OBLIGATORY_NULL_ITEM
- Do not add a default null option.
- (atklistattribute ) AF_LIST_NO_NULL_ITEM
- Do not add null option ever
- (atklistattribute ) AF_LIST_OBLIGATORY_NULL_ITEM
- Add a default null option to obligatory items
- (atklivetextpreview AF_LIVETEXT_SHOWLABEL = AF_DUMMY_SHOW_LABEL
- Label the preview
- (atklivetextpreview AF_LIVETEXT_NL2BR
- “nl2br” the data before display
- (atkmultiselectattribute ) AF_NO_TOGGLELINKS
- ????
- (atkmultiselectattribute ) AF_CHECK_ALL
- ????
- (atkmultiselectattribute ) AF_LINKS_BOTTOM
- ????
- (atkpasswordattribute ) AF_PASSWORD_NOVALIDATE
- Disables password check when editing password field
- (atkpasswordattribute ) AF_PASSWORD_NO_VALIDATE
- By default, to change a password, the user must also enter the current password. If this flag is set, entering the current password is not necessary (useful for edit-screens where administrators must manage useraccounts and need to change users' passwords).
- (atkpasswordattribute ) AF_PASSWORD_NOVALIDATE = AF_PASSWORD_NO_VALIDATE
- By default, to change a password, the user must also enter the current password. If this flag is set, entering the current password is not necessary (useful for edit-screens where administrators must manage useraccounts and need to change users' passwords).
- (atkpasswordattribute ) AF_PASSWORD_NO_ENCODE
- Don’t encode (with md5)
- (atkradioattribute ) AF_DISPLAY_VERT
- Displays the set of radio buttons vertically instead of horizontal default
- (atktabbedpane AF_TABBEDPANE_NO_AUTO_HIDE_LABEL
- Do not hide attribute label when it is single on the tab
- (atktimeattribute ) AF_TIME_SECONDS
- Display seconds after hours & minutes
- (atktimeattribute ) AF_CLEAR_TOUCH_BUTTONS
- Display buttons to clear and 'touch' date
- (atkurlattribute ) AF_URL_ALLOWWRAP
- Add one space after each "/", "?" and "&" to fit a (long) url into .
- (atkurlattribute ) AF_URL_STRIPHTTP
- Don't display "http://". Link remains intact.
- (atkweekdayattribute ) AF_WEEKDAY_SMALL_EDIT
- ????