You are here

function ctools_export_default_list in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/export.inc \ctools_export_default_list()

Default function for listing bulk exportable objects.

1 call to ctools_export_default_list()
bulk_export_export in bulk_export/bulk_export.module
FAPI gateway to the bulk exporter.

File

includes/export.inc, line 1010
Contains code to make it easier to have exportable objects.

Code

function ctools_export_default_list($table, $schema) {
  $list = array();
  $items = ctools_export_crud_load_all($table);
  $export_key = $schema['export']['key'];
  foreach ($items as $item) {

    // Try a couple of possible obvious title keys:
    if (!empty($item->admin_title)) {
      $string = "{$item->admin_title} (" . $item->{$export_key} . ")";
    }
    elseif (!empty($item->title)) {
      $string = "{$item->title} (" . $item->{$export_key} . ")";
    }
    else {
      $string = $item->{$export_key};
    }
    $list[$item->{$export_key}] = check_plain($string);
  }
  return $list;
}