function ctools_export_default_list

cis7 export.inc ctools_export_default_list($table, $schema)
cle7 export.inc ctools_export_default_list($table, $schema)
elmsmedia7 export.inc ctools_export_default_list($table, $schema)
icor7 export.inc ctools_export_default_list($table, $schema)
meedjum_blog7 export.inc ctools_export_default_list($table, $schema)
mooc7 export.inc ctools_export_default_list($table, $schema)

Default function for listing bulk exportable objects.

3 calls to ctools_export_default_list()
bulk_export_export in sites/all/modules/ulmus/ctools/bulk_export/bulk_export.module
FAPI gateway to the bulk exporter.
_ctools_drush_export_info in sites/all/modules/ulmus/ctools/drush/ctools.drush.inc
Return array of CTools exportable info based on available tables returned from ctools_export_get_schemas().
_ctools_features_export_default_list in sites/all/modules/ulmus/features/includes/features.ctools.inc
Wrapper around ctools_export_default_list() for < 1.7 compatibility.

File

sites/all/modules/ulmus/ctools/includes/export.inc, line 1241
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:
    $keys = array('admin_title', 'title');
    if (isset($schema['export']['admin_title'])) {
      array_unshift($keys, $schema['export']['admin_title']);
    }

    $string = '';
    foreach ($keys as $key) {
      if (!empty($item->$key)) {
        $string = $item->$key . " (" . $item->$export_key . ")";
        break;
      }
    }

    if (empty($string)) {
      $string = $item->$export_key;
    }
    $list[$item->$export_key] = check_plain($string);
  }
  return $list;
}