summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bulk_export/bulk_export.module21
-rw-r--r--drush/ctools.drush.inc2
2 files changed, 13 insertions, 10 deletions
diff --git a/bulk_export/bulk_export.module b/bulk_export/bulk_export.module
index ad8f67a..314d33b 100644
--- a/bulk_export/bulk_export.module
+++ b/bulk_export/bulk_export.module
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Perform bulk exports.
@@ -70,20 +71,23 @@ function bulk_export_export($cli = FALSE, $options = array()) {
// If called from drush_ctools_export, get the module name and
// select all exportables and call the submit function directly.
if ($cli) {
- $module_name = $options['module'];
+ $module_name = $options['name'];
$form_state['values']['name'] = $module_name;
$form_state['values']['tables'] = array();
foreach ($exportables as $table => $names) {
- $form_state['values']['tables'][$table] = array();
- foreach ($names as $name => $title) {
- $form_state['values']['tables'][$table][$name] = $name;
+ if (!empty($names)) {
+ $form_state['values']['tables'][] = $table;
+ $form_state['values'][$table] = array();
+ foreach ($names as $name => $title) {
+ $form_state['values'][$table][$name] = $name;
+ }
}
}
$output = bulk_export_export_form_submit($form, $form_state);
}
else {
$output = drupal_build_form('bulk_export_export_form', $form_state);
- $module_name = $form_state['module'];
+ $module_name = $form_state['name'];
}
if (!empty($form_state['submitted']) || $cli) {
@@ -108,7 +112,7 @@ function bulk_export_export($cli = FALSE, $options = array()) {
$dependencies[$module] = TRUE;
$file = $module_name . '.' . $api . '.inc';
- $code = "<?php\n";
+ $code = "<?php\n\n";
$code .= "/**\n";
$code .= " * @file\n";
$code .= " * Bulk export of $api objects generated by Bulk export module.\n";
@@ -139,14 +143,14 @@ function bulk_export_export($cli = FALSE, $options = array()) {
}
if ($module_code) {
- $module = "<?php\n";
+ $module = "<?php\n\n";
$module .= "/**\n";
$module .= " * @file\n";
$module .= " * Bulk export of objects generated by Bulk export module.\n";
$module .= " */\n";
$module .= $module_code;
if ($cli) {
- $file_data[$module_name . '.module'] = $module;
+ $file_data[$module_name . '.module'] = $module;
}
else {
$export_form = drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module')));
@@ -188,7 +192,6 @@ function bulk_export_export($cli = FALSE, $options = array()) {
*/
function bulk_export_export_form($form, &$form_state) {
-
$files = system_rebuild_module_data();
$form['additional_settings'] = array(
diff --git a/drush/ctools.drush.inc b/drush/ctools.drush.inc
index 0b5b4c8..61ffdaa 100644
--- a/drush/ctools.drush.inc
+++ b/drush/ctools.drush.inc
@@ -72,7 +72,7 @@ function drush_ctools_export($module = 'foo') {
// We create an array, because maybe in the future we can pass in more
// options to the export function (pre-selected modules and/or exportables).
$options = array(
- 'module' => $module,
+ 'name' => $module,
);
$files = bulk_export_export(TRUE, $options);