You are here

function configuration_ui_tracking_form in Configuration Management 7.2

1 string reference to 'configuration_ui_tracking_form'
configuration_ui_menu in ui/configuration_ui.module
Implements hook_menu().

File

ui/configuration_ui.admin.inc, line 11
User interface functions for Configuration Management.

Code

function configuration_ui_tracking_form($form, &$form_state) {
  $configurations = ConfigurationManagement::trackedConfigurations();
  $form_state['table_header'] = array(
    'names' => t('Configuration'),
    'status' => t('Status'),
    'operations' => t('Operations'),
  );
  configuration_ui_configuration_list('tracking', $configurations, $form, $form_state);
  if (!empty($form_state['component_exists'])) {
    $form['buttons'] = array(
      '#theme' => 'configuration_ui_form_buttons',
      '#tree' => FALSE,
    );

    // Do not allow writing to datastore if on remote server.
    if (variable_get('configuration_remote_server', 0) < 1) {
      $form['buttons']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Write Activestore to Datastore'),
        '#submit' => array(
          'configuration_ui_export_to_datastore_form_submit',
        ),
      );
    }
    else {
      $form['buttons']['export'] = array(
        '#type' => 'submit',
        '#value' => t('Export All Tracked Configurations'),
        '#submit' => array(
          'configuration_ui_export_traked_to_tar_file_form_submit',
        ),
      );
    }
    $form['buttons']['stop_tracking'] = array(
      '#type' => 'submit',
      '#value' => t('Stop Tracking'),
      '#submit' => array(
        'configuration_ui_stop_tracking_form_submit',
      ),
    );
    $form['buttons']['import'] = array(
      '#type' => 'submit',
      '#value' => t('Import Datastore to Activestore'),
      '#submit' => array(
        'configuration_ui_activate_form_submit',
      ),
    );
  }
  else {
    $form['no_configs'] = array(
      '#markup' => t('No Configurations were found. Please use the
      !export_link page to begin tracking new Configurations.', array(
        '!export_link' => l(t('Not Tracking'), 'admin/config/system/configuration/notracking'),
      )),
    );
  }
  return $form;
}