You are here

function icon_bundle_configure_form in Icon API 7

Same name and namespace in other branches
  1. 8 includes/admin.inc \icon_bundle_configure_form()

Menu callback for 'icon_bundle_configure_form'.

2 string references to 'icon_bundle_configure_form'
icon_menu in ./icon.module
Implements hook_menu().
icon_provider_import_form_submit in includes/import.inc
Submit callback for 'icon_provider_import_form'.

File

includes/admin.inc, line 238
admin.inc Provides administrative callbacks and tasks.

Code

function icon_bundle_configure_form($form, &$form_state, $bundle) {
  drupal_set_title(t('Configure %bundle icons', array(
    '%bundle' => $bundle['title'],
  )), PASS_THROUGH);
  $form_state['bundle'] = $bundle;
  $form['status'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enabled'),
    '#default_value' => $bundle['status'],
  );
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Bundle settings'),
    '#tree' => TRUE,
  );
  foreach (icon_extension_implements('icon_bundle_configure') as $extension => $type) {
    icon_extension_invoke($type, $extension, 'icon_bundle_configure', $form['settings'], $form_state, $form);
  }
  $settings = element_children($form['settings']);
  if (empty($settings)) {
    $form['settings']['#access'] = FALSE;
  }
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save bundle'),
  );
  if (!empty($bundle['import'])) {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete bundle'),
    );
  }
  elseif (!empty($bundle['overridden'])) {
    $form['actions']['reset'] = array(
      '#type' => 'submit',
      '#value' => t('Reset bundle'),
    );
  }
  return $form;
}