=versions
, the actual custom function that is executed is custom_function_*_enum_versions(). The reason why the "enum_" is not included is to have a fixed prefix for all custom functions used for this purpose and protect against users using custom functions that were not intended for this purpose.
/** * Construct an enumeration for all categories for the current project. * * The enumeration will be empty if current project is ALL PROJECTS. * Enumerations format is: "abc|lmn|xyz" * To use this in a custom field type "=categories" in the possible values field. */ function custom_function_override_enum_categories() { $t_categories = category_get_all_rows( helper_get_current_project() ); $t_enum = array(); foreach( $t_categories as $t_category ) { $t_enum[] = $t_category['category']; } $t_possible_values = implode( '|', $t_enum ); return $t_possible_values; }
Note
mine
, you will have to define it with the following signature:
/** * Use this in a custom field type "=mine" in the possible values field. */ function custom_function_override_enum_mine() { # Populate $t_enum values as appropriate here $t_enum = array(); $t_possible_values = implode( '|', $t_enum ); return $t_possible_values; }
Note