You are here

function _ldapdata_attribute_form in LDAP integration 5.2

Same name and namespace in other branches
  1. 5 ldapdata.module \_ldapdata_attribute_form()
  2. 6 ldapdata.module \_ldapdata_attribute_form()
1 call to _ldapdata_attribute_form()
ldapdata_user_form in ./ldapdata.module
Only used for editable LDAP attributes with no Drupal equivalents

File

./ldapdata.module, line 725

Code

function _ldapdata_attribute_form($attrname, $value, $info) {
  $type = array_shift($info);
  switch ($type) {
    case 'textfield':
      $form = array(
        '#type' => 'textfield',
        '#title' => array_shift($info),
        '#default_value' => $value,
        '#size' => array_shift($info),
        '#maxlength' => array_shift($info),
        '#description' => array_shift($info),
        '#attributes' => array_shift($info),
        '#required' => array_shift($info),
      );
      break;
    case 'password':

      // TODO: fix this
      $form = array(
        '#type' => 'password',
        '#title' => array_shift($info),
        '#default_value' => $value,
        '#size' => array_shift($info),
        '#maxlength' => array_shift($info),
        '#description' => array_shift($info),
      );
      break;
  }
  return $form;
}