You are here

function video_customfields_settings_form in Video 5

Same name and namespace in other branches
  1. 6 plugins/video_customfields/video_customfields.module \video_customfields_settings_form()

Settings Hook

Return value

string of form content or error message

1 string reference to 'video_customfields_settings_form'
video_customfields_menu in plugins/video_customfields/video_customfields.module
Implementation of hook_menu().

File

plugins/video_customfields/video_customfields.module, line 54
Enable addition of custom fileds on video nodes created by video module.

Code

function video_customfields_settings_form() {

  //Must have "administer site configuration" and "administer video" privilages.
  if (!user_access('administer video')) {
    drupal_access_denied();
  }
  $form['customfields'] = array(
    '#type' => 'fieldset',
    '#weight' => -1,
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#title' => t('Custom display fields'),
    '#description' => t('Creates custom fields. Fields only show up if you give them a name.'),
  );
  $form['customfields']['video_customfieldtitle'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field group title'),
    '#default_value' => variable_get('video_customfieldtitle', ''),
    '#description' => t('Title of the group of all custom fields.'),
  );
  $form['customfields']['video_customfield1'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field 1 title'),
    '#default_value' => variable_get('video_customfield1', ''),
  );
  $form['customfields']['video_customfield2'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field 2 title'),
    '#default_value' => variable_get('video_customfield2', ''),
  );
  $form['customfields']['video_customfield3'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field 3 title'),
    '#default_value' => variable_get('video_customfield3', ''),
  );
  $form['customfields']['video_customfield4'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field 4 title'),
    '#default_value' => variable_get('video_customfield4', ''),
  );
  $form['customfields']['video_customfield5'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field 5 title'),
    '#default_value' => variable_get('video_customfield5', ''),
  );
  $form['customfields']['video_customfield6'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom field 6 title'),
    '#default_value' => variable_get('video_customfield6', ''),
  );
  $options = array(
    1 => 'Yes',
    0 => 'No',
  );
  $form['customfields']['video_customgroupcollapsed'] = array(
    '#type' => 'radios',
    '#title' => t('Start group initially collapsed'),
    '#options' => $options,
    '#default_value' => variable_get('video_customgroupcollapsed', 1),
    '#description' => t('Should the custom fields group be initially collapsed when creating and editing video nodes?'),
  );
  return system_settings_form($form);
}