You are here

function video_settings_form in Video 6

Same name and namespace in other branches
  1. 5 video.module \video_settings_form()
  2. 6.2 video.module \video_settings_form()

Settings Hook

Return value

string of form content or error message

1 string reference to 'video_settings_form'
video_menu in ./video.module
Implementation of hook_menu().

File

./video.module, line 223
video.module

Code

function video_settings_form() {
  global $base_url;
  $form = array();
  $form['menu'] = array(
    '#type' => 'fieldset',
    '#title' => t('General behavior'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $vtypes = video_get_types_infos();
  if ($vtypes) {

    // no vtype available
    $video_types = array();
    foreach ($vtypes as $vtype => $info) {
      $video_types[$vtype] = $info['#name'];
    }
    $video_types[0] = t('No default type');
    $form['menu']['video_default_video_type'] = array(
      '#type' => 'select',
      '#title' => t('Choose default video type'),
      '#default_value' => variable_get('video_default_video_type', 0),
      '#description' => t('For installations that have more than one video type available, this sets the default video type when a user visits node/add/video'),
      '#options' => $video_types,
    );
  }
  $form['menu']['video_displaydownloadmenutab'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display download menu tab'),
    '#default_value' => variable_get('video_displaydownloadmenutab', 1),
    '#description' => t('Toggle display of menu tab to download video from the node page.'),
  );
  $form['menu']['video_displaydownloadlink'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display download link'),
    '#default_value' => variable_get('video_displaydownloadlink', 1),
    '#description' => t('Toggle display of "download" link (below the node content in most themes).'),
  );
  $form['menu']['video_displayplaytime'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display playtime'),
    '#default_value' => variable_get('video_displayplaytime', 1),
    '#description' => t('Toggle the display of the playtime for a video.'),
  );
  $form['menu']['video_displayfilesize'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display filesize'),
    '#default_value' => variable_get('video_displayfilesize', 1),
    '#description' => t('Toggle the display of the filesize for a video.'),
  );
  $form['resolutions'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video resolutions'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['resolutions']["video_resolution_width"] = array(
    '#type' => 'textfield',
    '#title' => t("Default width"),
    '#default_value' => variable_get("video_resolution_width", 400),
    '#description' => t('The width which will be used to scale video during playing. This let all videos on the website look the same'),
  );
  $i = 1;
  while ($i <= 4) {
    $form['resolutions']["video_resolution_{$i}_name"] = array(
      '#type' => 'textfield',
      '#title' => t("Resolution {$i} name"),
      '#default_value' => variable_get("video_resolution_{$i}_name", ''),
    );
    $form['resolutions']["video_resolution_{$i}_value"] = array(
      '#type' => 'textfield',
      '#title' => t("Resolution {$i} value"),
      '#default_value' => variable_get("video_resolution_{$i}_value", ''),
      '#description' => t('The resolution: two numbers representing width and height separated by an "x"'),
    );
    $i++;
  }

  // statistics stuff
  $form['counters'] = array(
    '#type' => 'fieldset',
    '#title' => t('Statistics counters'),
    '#description' => t('To allow users to view counters visit: ') . l(t('access control'), 'admin/access'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['counters']['video_playcounter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Count play hits'),
    '#default_value' => variable_get('video_playcounter', 1),
    '#description' => t('Counts a hit everytime someone views the play page.'),
  );
  $form['counters']['video_downloadcounter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Count downloads'),
    '#default_value' => variable_get('video_downloadcounter', 1),
    '#description' => t('Counts a hit everytime someone downloads a video.'),
  );
  $form['flash'] = array(
    '#type' => 'fieldset',
    '#title' => t('Flash settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['flash']['video_flvplayerloader'] = array(
    '#type' => 'textfield',
    '#title' => t('Filename of Flash loader'),
    '#default_value' => variable_get('video_flvplayerloader', 'FlowPlayer.swf'),
    '#description' => t('The name of the Shockwave file that manages loading the FLV movie. This is relative to the website root.'),
  );
  $form['ogg'] = array(
    '#type' => 'fieldset',
    '#title' => t('Ogg Theora settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['ogg']['video_cortado'] = array(
    '#type' => 'textfield',
    '#title' => t('Filename of Cortado Java Applet'),
    '#default_value' => variable_get('video_cortado', $base_url . '/cortado.jar'),
    '#description' => t('The path to the Cortado Applet to play Ogg Theora Files.'),
  );
  return system_settings_form($form);
}