You are here

function acquia_lift_goal_rename_form in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 acquia_lift.admin.unibar.inc \acquia_lift_goal_rename_form()

Form handler to generate a form to change a goal name.

This form is called within a ctools modal window.

Parameters

array $action: The goal's underlying visitor action.

1 string reference to 'acquia_lift_goal_rename_form'
acquia_lift_goal_rename_modal_callback in ./acquia_lift.admin.unibar.inc
Page callback to generate a goal rename modal window.

File

./acquia_lift.admin.unibar.inc, line 1372
acquia_lift.admin.unibar.inc

Code

function acquia_lift_goal_rename_form($form, &$form_state, $action) {
  ctools_include('modal');
  ctools_include('ajax');
  ctools_add_js('ajax-responder');
  $form = array();
  $form['action'] = array(
    '#type' => 'value',
    '#value' => $action,
  );
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('New name'),
    '#default_value' => $action['label'],
    '#required' => TRUE,
    '#maxlength' => PERSONALIZE_MACHINE_NAME_MAXLENGTH,
  );
  $form['actions']['submit_form'] = array(
    '#type' => 'submit',
    '#attributes' => array(
      'class' => array(
        'action-item-primary-active',
        'acquia-lift-submit-button',
      ),
    ),
    '#value' => t('Rename'),
  );
  $form['actions']['reset'] = array(
    '#markup' => ctools_ajax_text_button(t('Cancel'), 'admin/structure/acquia_lift/cancel/nojs', t('Cancel'), 'acquia-lift-cancel-button'),
  );
  return $form;
}