atkColorPickerAttribute atkColorPickerAttribute(
string
$name, [array
$userColors = ""], [int
$flags = 0]
)
|
|
Constructor
Example: $this->add(new atkColorPickerAttribute("naam",Array,AF_OBLIGATORY|AF_POPUP));
Parameters:
|
string |
$name: |
Name of the attribute |
|
array |
$userColors: |
Array with max. 12 user defined colors |
|
int |
$flags: |
Flags for the attribute |
True checkHexColor(
String
$colors
)
|
|
Check the hex color (also based on the mode).
Parameters:
API Tags:
| Return: | if valid, false otherwise |
Boolean checkNumArgs(
Integer
$numargs
)
|
|
Check the amount of arguments that were passed
Parameters:
|
Integer |
$numargs: |
The number of arguments that were passed |
API Tags:
| Return: | True if the number of arguments is valid, False otherwise |
True checkTypeAndMode(
String
$type
)
|
|
Check if the determined type matches the mode that was set.
Parameters:
API Tags:
| Return: | if valid, false otherwise |
Function to check if a color is correct (default is hex colors)
Example: check_color("#zff, "hex"") check_color("rgb(204,255,0)", "rgb")
API Tags:
| Return: | valid color or not |
| Access: | private |
Return the database field type of the attribute.
Note that the type returned is a 'generic' type. Each database vendor might have his own types, therefor, the type should be converted to a database specific type using $db->fieldType().
If the type was read from the table metadata, that value will be used. Else, the attribute will analyze its flags to guess what type it should be. If AF_AUTO_INCREMENT is set, the field is probaly "number". If not, it's probably "string".
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.
String 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: |
The record that holds the value for this attribute. |
|
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: | A piece of htmlcode for editing this attribute |
Redefinition of:
- atkAttribute::edit()
- Returns a piece of html code that can be used in a form to edit this attribute's value.
Get the colormode for this colorpicker.
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.
void setColorMode(
[String
$mode = NULL]
)
|
|
Set the colormode (The value is checked according to the colormode that is set).
Supported values are: default (rgb, hex with 6 characters digits, hex with 3 characters, text etc.). hex6 (only 6 digit hexadecimal)
Other modes are not supported yet, but could be implemented in the future.
Parameters:
void validate(
&$record, String
$mode, array
$record
)
|
|
Checks if a value is valid.
Parameters:
|
array |
$record: |
The record that holds the value for this attribute. If an error occurs, the error will be stored in the 'atkerror' field of the record. |
|
String |
$mode: |
The mode for which should be validated ("add" or "update") |
|
|
&$record: |
|
Redefinition of:
- atkAttribute::validate()
- Checks if a value is valid.