function hansel_domain_action_add_domain_config_form in Hansel breadcrumbs 8
Same name and namespace in other branches
- 7 domain/hansel_domain.module \hansel_domain_action_add_domain_config_form()
 
Callback for "add domain" action to generate the config form.
Parameters
array $arguments:
Return value
array
1 string reference to 'hansel_domain_action_add_domain_config_form'
- hansel_domain_hansel_action_types in domain/
hansel_domain.module  - Implements hook_hansel_action_types().
 
File
- domain/
hansel_domain.module, line 86  - Hansel domain integration
 
Code
function hansel_domain_action_add_domain_config_form($arguments) {
  $form = array();
  $options = array(
    0 => t('Current domain'),
  );
  $domains = db_select('domain', 'd')
    ->fields('d', array(
    'domain_id',
    'sitename',
  ))
    ->orderBy('d.is_default', 'desc')
    ->orderBy('d.sitename', 'asc')
    ->execute()
    ->fetchAllKeyed();
  foreach ($domains as $domain_id => $sitename) {
    $options[$domain_id] = $sitename;
  }
  $form['domain_id'] = array(
    '#type' => 'select',
    '#title' => t('Domain'),
    '#options' => $options,
    '#default_value' => empty($arguments['domain_id']) ? 0 : $arguments['domain_id'],
  );
  return $form;
}