Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created January 4, 2010 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msonnabaum/268675 to your computer and use it in GitHub Desktop.
Save msonnabaum/268675 to your computer and use it in GitHub Desktop.
<?php
function apci_media_mover_import($config_filename) {
if (module_exists('media_mover_api')) {
$config_code = file_get_contents(drupal_get_path('module', 'apci_media_mover') . '/' . $config_filename . '.mm');
// evaluate imported code
ob_start();
eval($config_code);
ob_end_clean();
// create a cache id
$id = time();
// Store the configuration
cache_set("media_mover_config_$id", $configuration, 'cache');
$form_state = array();
$add_config_form = media_mover_api_add_config_form(array(),$id);
// use form_builder to populate form_state
form_builder('media_mover_api_add_config_form', $add_config_form, $form_state);
media_mover_api_add_config_form_submit($add_config_form, $form_state);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment