You are here

function backup_migrate_ui_profile_display_profiles in Backup and Migrate 5.2

List the the available profiles in the UI.

1 string reference to 'backup_migrate_ui_profile_display_profiles'
backup_migrate_menu in ./backup_migrate.module
Implementation of hook_menu().

File

includes/profiles.inc, line 111
All of the settings profiles handling code for Backup and Migrate.

Code

function backup_migrate_ui_profile_display_profiles() {
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/destinations.inc';
  $out = array();
  foreach (backup_migrate_get_profiles() as $profile) {
    $source = backup_migrate_get_destination($profile['source_id']);
    $row = array(
      check_plain($profile['name']),
      $source ? $source['name'] : t("Missing"),
      check_plain($profile['filename']),
      $profile['exclude_tables'] ? implode(", ", $profile['exclude_tables']) : t("No Tables"),
      $profile['nodata_tables'] ? implode(", ", $profile['nodata_tables']) : t("No Tables"),
      implode(" | ", _backup_migrate_profile_get_links($profile['profile_id'])),
    );
    if (!$profile['enabled']) {
      foreach ($row as $key => $field) {
        $row[$key] = array(
          'data' => $field,
          'class' => 'profile-list-disabled',
        );
      }
    }
    $out[] = $row;
  }
  $headers = array(
    t('Name'),
    t('Source'),
    t('Filename'),
    t('Exclude'),
    t('No Data'),
    t('Operations'),
  );
  drupal_add_css(drupal_get_path('module', 'backup_migrate') . '/backup_migrate.css');
  if ($out) {
    $out = theme("table", $headers, $out);
  }
  else {
    $out = t('There are no profiles to display.');
  }
  return $out . ' ' . l(t("Create new profile..."), 'admin/content/backup_migrate/profile/add');
}