You are here

function farm_plan_add in farmOS 7

Add new plan page callback.

Parameters

string $type: The farm plan type.

Return value

array Returns a form array.

1 string reference to 'farm_plan_add'
farm_plan_menu in modules/farm/farm_plan/farm_plan.module
Implements hook_menu().

File

modules/farm/farm_plan/farm_plan.pages.inc, line 57
Farm plan pages.

Code

function farm_plan_add($type) {
  $farm_plan_type = farm_plan_types($type);
  $farm_plan = entity_create('farm_plan', array(
    'type' => $type,
  ));
  drupal_set_title(t('Add @name', array(
    '@name' => entity_label('farm_plan_type', $farm_plan_type),
  )));
  $output = drupal_get_form('farm_plan_form', $farm_plan);
  return $output;
}