You are here

function skinr_context_ui_group_add_form in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_context/skinr_context_ui.edit.inc \skinr_context_ui_group_add_form()
1 string reference to 'skinr_context_ui_group_add_form'
skinr_context_ui_group_add in skinr_context/skinr_context_ui.edit.inc
Menu callback; adds a skin settings group to an element.

File

skinr_context/skinr_context_ui.edit.inc, line 80
Page callbacks for the Skinr Context UI module related to editing skins and groups.

Code

function skinr_context_ui_group_add_form($form, $form_state, $module, $element) {
  $form['module'] = array(
    '#type' => 'hidden',
    '#value' => $module,
  );
  $form['element'] = array(
    '#type' => 'hidden',
    '#value' => $element,
  );
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Group title'),
    '#required' => TRUE,
    '#description' => t('Descriptive title for this skin settings group.'),
  );
  $form['gid'] = array(
    '#type' => 'machine_name',
    '#title' => t('Group name'),
    // '#maxlength' => MENU_MAX_MENU_NAME_LENGTH_UI,
    '#description' => t('A unique name to identify this group. It must only contain lowercase letters, numbers, hyphens and underscores.'),
    '#field_prefix' => $module . ':' . $element . ':',
    '#machine_name' => array(
      'exists' => 'skinr_context_ui_group_name_exists',
      'source' => array(
        'title',
      ),
      'replace_pattern' => '[^a-z0-9-_]+',
    ),
  );
  $form['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#description' => t('A description for this group.'),
  );
  $form['actions'] = array(
    '#tree' => FALSE,
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add group'),
  );
  return $form;
}