function eck__default_properties__form in Entity Construction Kit (ECK) 7.3
Same name and namespace in other branches
- 7.2 eck.default_properties.inc \eck__default_properties__form()
Implements hook_form().
1 call to eck__default_properties__form()
- eck__entity_type__form in ./
eck.entity_type.inc - Entity type form callback.
File
- ./
eck.default_properties.inc, line 75 - Default properties are a grouping of a property and a behavior.
Code
function eck__default_properties__form($form, &$state, $entity_type) {
// DEFAULT PROPERTIES.
// Now we want to display the default properties.
$default_properties = eck_get_default_properties();
$options = array();
foreach ($default_properties as $property_name => $property_info) {
$options[$property_name] = $property_info['label'];
}
$form['default_properties'] = array(
'#type' => 'checkboxes',
'#options' => $options,
'#title' => t('Default Properties'),
);
$properties = $entity_type->properties;
$defaults = array();
foreach ($properties as $property => $info) {
$defaults[$property] = $property;
}
$form['default_properties']['#default_value'] = $defaults;
// :S
return $form;
}