You are here

function _entityconnect_admin_form in Entity connect 7.2

Same name and namespace in other branches
  1. 7 includes/entityconnect.admin.inc \_entityconnect_admin_form()

Defines the settings form.

1 string reference to '_entityconnect_admin_form'
entityconnect_menu in ./entityconnect.module
Implements hook_menu().

File

includes/entityconnect.admin.inc, line 10
Handles all form alters and submit functions for entityconnect.

Code

function _entityconnect_admin_form($form, &$form_state) {
  $form = array();
  $form['entityconnect'] = array(
    '#type' => 'fieldset',
    '#title' => t('EntityConnect default Parameters'),
  );
  $form['entityconnect']['cache_lifetime'] = array(
    '#default_value' => variable_get('entityconnect_cache_lifetime', CACHE_PERMANENT),
    '#description' => t('Set cache lifetime in second.<br />
                        Set to 0 to CACHE_PERMANENT.'),
    '#element_validate' => array(
      'element_validate_integer',
    ),
    '#weight' => '0',
    '#type' => 'textfield',
    '#title' => t('Entity Connect cache lifetime'),
  );
  $form['entityconnect']['button'] = array(
    '#type' => 'fieldset',
    '#title' => t('Buttons display Parameters'),
  );
  $form['entityconnect']['button']['button_add'] = array(
    '#required' => '1',
    '#key_type_toggled' => '1',
    '#default_value' => variable_get('entityconnect_unload_add_default', 1),
    '#description' => t('Default: "off"<br />
                          Choose "on" if you want the "add" buttons displayed by default.<br />
                          Each field can override this value.'),
    '#weight' => '0',
    '#type' => 'radios',
    '#options' => array(
      '0' => t('on'),
      '1' => t('off'),
    ),
    '#title' => t('Default Entity Connect "add" button display'),
  );
  $form['entityconnect']['button']['button_edit'] = array(
    '#required' => '1',
    '#key_type_toggled' => '1',
    '#default_value' => variable_get('entityconnect_unload_edit_default', 1),
    '#description' => t('Default: "off"<br />
                          Choose "on" if you want the "edit" buttons displayed by default.<br />
                          Each field can override this value.'),
    '#weight' => '1',
    '#type' => 'radios',
    '#options' => array(
      '0' => t('on'),
      '1' => t('off'),
    ),
    '#title' => t('Default Entity Connect "edit" button display'),
  );
  $form['entityconnect']['icon'] = array(
    '#type' => 'fieldset',
    '#title' => t('Icons display Parameters'),
  );
  $form['entityconnect']['icon']['icon_add'] = array(
    '#required' => '1',
    '#key_type_toggled' => '1',
    '#default_value' => variable_get('entityconnect_show_add_icon_default', 0),
    '#description' => t('Default: "Icon only"<br />
                         Choose "Icon + Text" if you want to see the edit (pencil) icon + the text displayed by default.<br />
                         Choose "Text only" if you don\'t want to see the edit (pencil) icon displayed by default.<br />
                         Each field can override this value.'),
    '#weight' => '2',
    '#type' => 'radios',
    '#options' => array(
      '0' => t('Icon only'),
      '1' => t('Icon + Text'),
      '2' => t('Text only'),
    ),
    '#title' => t('Default Entity Connect "add (+) icon" display'),
  );
  $form['entityconnect']['icon']['icon_edit'] = array(
    '#required' => '1',
    '#key_type_toggled' => '1',
    '#default_value' => variable_get('entityconnect_show_edit_icon_default', 0),
    '#description' => t('Default: "Icon only"<br />
                         Choose "Icon + Text" if you want to see the edit (pencil) icon + the text displayed by default.<br />
                         Choose "Text only" if you don\'t want to see the edit (pencil) icon displayed by default.<br />
                         Each field can override this value.'),
    '#weight' => '3',
    '#type' => 'radios',
    '#options' => array(
      '0' => t('Icon only'),
      '1' => t('Icon + Text'),
      '2' => t('Text only'),
    ),
    '#title' => t('Default Entity Connect "edit (pencil) icon" display'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save',
    '#weight' => '2',
  );
  $form['reset'] = array(
    '#type' => 'submit',
    '#value' => 'Reset to default',
    '#weight' => '3',
  );
  return $form;
}