function _drush_views_data_export_generate_display_id in Views data export 7.4
Same name and namespace in other branches
- 6.3 views_data_export.drush.inc \_drush_views_data_export_generate_display_id()
- 6 views_data_export.drush.inc \_drush_views_data_export_generate_display_id()
- 6.2 views_data_export.drush.inc \_drush_views_data_export_generate_display_id()
- 7 views_data_export.drush.inc \_drush_views_data_export_generate_display_id()
- 7.3 views_data_export.drush.inc \_drush_views_data_export_generate_display_id()
Generate a display id of a certain plugin type. See http://drupal.org/files/issues/348975-clone-display.patch
Parameters
$type: Which plugin should be used for the new display id.
1 call to _drush_views_data_export_generate_display_id()
- _drush_views_data_export_clone_display in ./
views_data_export.drush.inc - Helper function that takes a view and returns a clone of it that has cloned a given display to one of type views_data_export
File
- ./
views_data_export.drush.inc, line 341
Code
function _drush_views_data_export_generate_display_id($view, $type) {
// 'default' is singular and is unique, so just go with 'default'
// for it. For all others, start counting.
if ($type == 'default') {
return 'default';
}
// Initial id.
$id = $type . '_1';
$count = 1;
// Loop through IDs based upon our style plugin name until
// we find one that is unused.
while (!empty($view->display[$id])) {
$id = $type . '_' . ++$count;
}
return $id;
}