You are here

function properties_compare_add_form in Dynamic properties 7

Form builder function; displays a form to add an entity to the compare list.

1 string reference to 'properties_compare_add_form'
properties_compare_forms in properties_compare/properties_compare.module
Implements hook_forms().

File

properties_compare/properties_compare.module, line 109
Module file for privatemsg_compare module.

Code

function properties_compare_add_form($form, &$form_state, $entity_type, $entity) {
  $form['entity_type'] = array(
    '#type' => 'value',
    '#value' => $entity_type,
  );
  $form['entity'] = array(
    '#type' => 'value',
    '#value' => $entity,
  );
  $exists = properties_compare_list_exists($entity_type, $entity);
  $full = properties_compare_list_is_full();
  $form['submit'] = array(
    '#type' => 'submit',
    '#disabled' => $exists || $full,
    '#value' => $exists ? t('In comparison') : ($full ? t('Comparison list full') : t('Add to compare list')),
  );
  return $form;
}