You are here

function eck_language_property_bundle_form in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7.2 plugins/property_behavior/language.inc \eck_language_property_bundle_form()

Setting multilingual options in bundle form.

@todo Why is the behavior setting things in the bundle form?

1 string reference to 'eck_language_property_bundle_form'
language.inc in plugins/property_behavior/language.inc

File

plugins/property_behavior/language.inc, line 132

Code

function eck_language_property_bundle_form($property, $vars) {
  if (module_exists('locale')) {
    $entity_type = $vars['form']['entity_type']['#value'];
    $bundle = $vars['form']['bundle']['#value'];
    $property_info = $entity_type->properties[$property];
    $vars['form']['config_multilingual'] = array(
      '#type' => 'radios',
      '#title' => t('Multilingual support'),
      '#default_value' => isset($bundle->config["multilingual"]) ? $bundle->config["multilingual"] : 0,
      '#options' => array(
        t('Disabled'),
        t('Enabled'),
      ),
      '#description' => t('Enable multilingual support for this bundle. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array(
        '!languages' => url('admin/config/regional/language'),
      )),
    );
  }
  return $vars;
}