You are here

function panopoly_default_content in Panopoly 7

Apps installer default content callback.

1 string reference to 'panopoly_default_content'
panopoly_install_tasks in ./panopoly.profile
Implements hook_install_tasks()

File

./panopoly.profile, line 91

Code

function panopoly_default_content(&$modules) {

  // TODO: It would be better to figure out which apps have demo content
  // modules by looking at the app manifest. Unfortunately, this doesn't qute
  // work because the manifest doesn't know about the default content module
  // until the app has actually been enabled, since that data only comes in
  // from hook_apps_app_info().
  //
  // apps_include('manifest');
  // $apps = apps_apps('panopoly');
  // foreach ($modules as $module) {
  //   if (!empty($apps[$module]['demo content module'])) {
  //     $modules[] = $apps[$module]['demo content module'];
  //   }
  // }
  //
  // This workaround assumes a pattern MYMODULE_demo.
  $files = system_rebuild_module_data();
  foreach ($modules as $module) {
    if (isset($files[$module . '_demo'])) {
      $modules[] = $module . '_demo';
    }
  }
}