You are here

function swftools_profiles_configure_settings in SWF Tools 6.3

Returns a settings form for configuring a specific player within a given profile.

Parameters

array $form_state: The current form state.

array $profile: An array of profile settings loaded from the {swftools_profile} table.

string $settings: The name of the variable that stores the settings in a non-profiled context, e.g. swftools_wpaudio.

string $module: The module that provides the settings form.

string $file: The file that contains the settings form.

string $function: The name of the function that will return the settings form.

Return value

array A form definition array to render the settings form.

1 string reference to 'swftools_profiles_configure_settings'
swftools_profiles_menu in profiles/swftools_profiles.module
Implementation of hook_menu().

File

profiles/swftools_profiles.admin.inc, line 201
Configuration settings for SWF Tools profiles.

Code

function swftools_profiles_configure_settings($form_state, $profile, $settings, $module, $file, $function) {

  // Load support file if required
  if ($module && $file) {
    require_once drupal_get_path('module', $module) . '/' . $file;
  }

  // Get the form definition
  $form = $function($profile['profile']);

  // Add profile and settings tracking variables
  $form['profile'] = array(
    '#type' => 'value',
    '#value' => $profile['profile'],
  );

  // See if this form is linked to global settings by checking if the profile variable for the first setting is not set
  if ($settings && variable_get(swftools_profiles_variable_name($settings[0], $profile['profile']), SWFTOOLS_UNDEFINED) == SWFTOOLS_UNDEFINED) {
    $form['mirror'] = array(
      '#type' => 'markup',
      '#value' => t('<p>The settings on this page are mirroring the SWF Tools global defaults.</p>'),
      '#weight' => -10,
    );
  }

  // Return the resulting form
  return swftools_profiles_configure_settings_form($form);
}