You are here

function deploy_adhoc_plan_create in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 modules/deploy_adhoc_plan/deploy_adhoc_plan.module \deploy_adhoc_plan_create()

Helper function to create ad hoc plan if default is defined.

1 call to deploy_adhoc_plan_create()
deploy_adhoc_plan_init in modules/deploy_adhoc_plan/deploy_adhoc_plan.module
Implements hook_init().

File

modules/deploy_adhoc_plan/deploy_adhoc_plan.module, line 97
Code for ad hoc deployment plans.

Code

function deploy_adhoc_plan_create($adhoc) {
  $default = variable_get('deploy_adhoc_plan_name');
  if ($default) {
    $plan = deploy_plan_load($default);
    unset($plan->pid);
    $plan->export_type = NULL;
    $plan->name = $adhoc;
    $plan->title = $adhoc;
    $plan->description = t('Ad hoc deployment plan');
    return deploy_plan_save($plan);
  }
}