Created
January 4, 2010 17:34
-
-
Save msonnabaum/268675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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