atkListAttribute atkListAttribute(
string
$name, array
$optionArray, [array
$valueArray = ""], [int
$flags = 0], [int
$size = 0]
)
|
|
Constructor.
Warning: very old versions of this attribute supported passing the parameters in a different order: $name, $flags, $optionArray. This order used to be supported even when the new order was implemented, but it has now been removed. Keep this in mind when upgrading from a very old ATK version (pre ATK4).
Parameters:
|
string |
$name: |
Name of the attribute |
|
array |
$optionArray: |
Array with options |
|
array |
$valueArray: |
Array with values. If you don't use this parameter, values are assumed to be the same as the options. |
|
int |
$flags: |
Flags for this attribute |
|
int |
$size: |
Size of the attribute. |
void addOption(
string
$option, [string
$value = ""]
)
|
|
Add option/value to dropdown
Parameters:
|
string |
$option: |
|
|
string |
$value: |
|
void createLookupArray(
array
$optionArray, array
$valueArray
)
|
|
Creates a lookup array to speedup translations
Parameters:
|
array |
$optionArray: |
|
|
array |
$valueArray: |
|
Return the database field type of the attribute.
API Tags:
| Return: | The 'generic' type of the database field for this attribute. |
Redefinition of:
- atkAttribute::dbFieldType()
- Return the database field type of the attribute.
Redefined in descendants as:
text display(
array
$record
)
|
|
Display's text version of Record
Parameters:
API Tags:
| Return: | string of $record |
Redefinition of:
- atkAttribute::display()
- Returns a displayable string for this value, to be used in HTML pages.
Redefined in descendants as:
piece edit(
[array
$record = ""], [String
$fieldprefix = ""], [String
$mode = ""]
)
|
|
Returns a piece of html code that can be used in a form to edit this attribute's value.
Parameters:
|
array |
$record: |
Array with fields |
|
String |
$fieldprefix: |
The fieldprefix to put in front of the name of any html form element for this attribute. |
|
String |
$mode: |
The mode we're in ('add' or 'edit') |
API Tags:
| Return: | of html code with a checkbox |
Redefinition of:
- atkAttribute::edit()
- Returns a piece of html code that can be used in a form to edit this attribute's value.
Redefined in descendants as:
Gets the value for the empty entry in the list attribute
void getLookup(
[array
$rec = null]
)
|
|
Get functions to access the member variable for lookup.
For backwards compatibility we also check the old member variable m_lookup
Parameters:
void getOptions(
[array
$rec = null]
)
|
|
Get function to access the member variable for options.
For backwards compatibility we also check the old member variable m_options
Parameters:
String getSearchCondition(
&$query, String
$table, mixed
$value, String
$searchmode, atkQuery
$query
)
|
|
Creates a searchcondition for the field, was once part of searchCondition, however, searchcondition() also immediately adds the search condition.
Parameters:
|
atkQuery |
$query: |
The query object where the search condition should be placed on |
|
String |
$table: |
The name of the table in which this attribute is stored |
|
mixed |
$value: |
The value the user has entered in the searchbox |
|
String |
$searchmode: |
The searchmode to use. This can be any one of the supported modes, as returned by this attribute's getSearchModes() method. |
|
|
&$query: |
|
API Tags:
| Return: | The searchcondition to use. |
Redefinition of:
- atkAttribute::getSearchCondition()
- Creates a searchcondition for the field, was once part of searchCondition, however, searchcondition() also immediately adds the search condition.
Redefined in descendants as:
Retrieve the list of searchmodes supported by the attribute.
API Tags:
| Return: | List of supported searchmodes |
Redefinition of:
- atkAttribute::getSearchModes()
- Retrieve the list of searchmodes supported by the attribute.
Redefined in descendants as:
Gets the selected listattribute
API Tags:
| Return: | the selected listitem |
| See: | atkNode::initial_values |
| Deprecated: | |
void getValues(
[array
$rec = null]
)
|
|
Get functions to access the member variable for values For backwards compatibility we also check the old member variable m_values
Parameters:
Gets the width of the dropdown list in pixels
API Tags:
| Return: | The width of the dropdown list in pixels |
Internal parseStringValue(
String
$stringvalue
)
|
|
Convert a String representation into an internal value.
This implementation search for the value first in the valueArray, then in the optionArray All other values are converted to the first of the valueArray
Parameters:
|
String |
$stringvalue: |
The value to parse. |
API Tags:
| Return: | value (from valueArray) |
Redefinition of:
- atkAttribute::parseStringValue()
- Convert a String representation into an internal value.
void removeOption(
string
$option
)
|
|
Remove option from dropdown
Parameters:
void removeValue(
string
$value
)
|
|
Remove value from dropdown
Parameters:
String search(
[array
$record = ""], [boolean
$extended = false], [string
$fieldprefix = ""], [
$grid = null]
)
|
|
Returns a piece of html code that can be used to get search terms input from the user.
The framework calls this method to display the searchbox in the search bar of the recordlist, and to display a more extensive search in the 'extended' search screen.
Parameters:
|
array |
$record: |
Array with values |
|
boolean |
$extended: |
if set to false, a simple search input is returned for use in the searchbar of the recordlist. If set to true, a more extended search may be returned for the 'extended' search page. The atkAttribute does not make a difference for $extended is true, but derived attributes may reimplement this. |
|
string |
$fieldprefix: |
The fieldprefix of this attribute's HTML element. |
|
|
$grid: |
|
API Tags:
| Return: | A piece of html-code with a checkbox |
Information Tags:
Redefinition of:
- atkAttribute::search()
- Returns a piece of html code that can be used to get search terms input from the user.
void setAutoHide(
string
$attrib, array
$valuearr
)
|
|
Set autohide for the given attribute
Parameters:
|
string |
$attrib: |
|
|
array |
$valuearr: |
|
void setAutoSearch(
[bool
$auto = false]
)
|
|
When autosearch is set to true, this attribute will automatically submit the search form onchange. This will only happen in the admin action.
Parameters:
API Tags:
void setEmptyValue(
string
$value
)
|
|
Sets the value for the empty entry in the list attribute In normal cases you would just leave this empty, but certain cases might demand you set a value.
Parameters:
|
string |
$value: |
the value we set for empty value |
object reference setOptions(
array
$optionArray, array
$valueArray
)
|
|
Set the option and value array
Parameters:
|
array |
$optionArray: |
array with options |
|
array |
$valueArray: |
array with values |
API Tags:
| Return: | to this attribute |
void setSelected(
string
$selected
)
|
|
Sets the selected listitem
Parameters:
|
string |
$selected: |
the listitem you want to have selected |
API Tags:
| See: | atkNode::initial_values |
| Deprecated: | |
void setWidth(
int
$width
)
|
|
Set the width of the dropdown list in pixels
Parameters:
|
int |
$width: |
The width of the dropdown list in pixels |
The _addEmptyListOption(
)
|
|
If this attribute is NOT obligatory
Or if the attribute is obligatory and we set a config saying all obligatory lists should have a null item and we didn't add the flag AF_LIST_NO_OBLIGATORY_NULL_ITEM Or if the AF_LIST_OBLIGATORY_NULL_ITEM is set ... we add an empty list option
API Tags:
| Return: | empty list option or an empty string |
array _get(
string
$type, [array
$rec = null]
)
|
|
Returns one of the following arrays
options => optionarray values => valuearray lookup => lookuparray
Parameters:
|
string |
$type: |
("options", "values" or "lookup") |
|
array |
$rec: |
The record |
API Tags:
| Return: | with options, values or lookup |
true _set(
string
$type, array
$value
)
|
|
Set's one of the following arrays
options => optionarray values => valuearray lookup => lookuparray
Parameters:
|
string |
$type: |
("options", "values" or "lookup) |
|
array |
$value: |
|
string _translateValue(
string
$value, [array
$rec = null]
)
|
|
Translates the database value
Parameters:
|
string |
$value: |
|
|
array |
$rec: |
The record |