You are here

function _swftools_flexpaper_settings in SWF Tools 6.3

Returns the player default settings, or customised settings from the configuration page.

2 calls to _swftools_flexpaper_settings()
swftools_flexpaper_profile_form in flexpaper/swftools_flexpaper.admin.inc
Returns a form definition for use by the profile system.
_swftools_flexpaper_flashvars in flexpaper/swftools_flexpaper.module
Retrieves the player default settings and unsets any that are empty.

File

flexpaper/swftools_flexpaper.module, line 77
Enables SWF Tools support for the FlexPaper PDF viewer.

Code

function _swftools_flexpaper_settings($profile = '', $mode = SWFTOOLS_MINIMUM_SETTINGS) {

  // Set up defaults
  $defaults = array(
    SWFTOOLS_MINIMUM_SETTINGS => array(
      'height' => 500,
      'width' => 600,
      'Scale' => 0.6,
      'PrintEnabled' => 'true',
      'FullScreenAsMaxWindow' => 'false',
    ),
    SWFTOOLS_FULL_SETTINGS => array(
      'height' => 500,
      'width' => 600,
      'Scale' => 0.6,
      'ZoomTransition' => '',
      'ZoomTime' => '',
      'ZoomInterval' => '',
      'FitPageOnLoad' => 'default',
      'FitWidthOnLoad' => 'default',
      'PrintEnabled' => 'true',
      'localeChain' => 'default',
      'FullScreenAsMaxWindow' => 'true',
    ),
  );

  // Retrieve settings from the database if available
  $settings = swftools_variable_get('swftools_flexpaper', $defaults[SWFTOOLS_MINIMUM_SETTINGS], $profile);

  // If a full set of settings are requested for the admin page then merge with full defaults
  if ($mode == SWFTOOLS_FULL_SETTINGS) {
    $settings = swftools_array_merge($defaults[SWFTOOLS_FULL_SETTINGS], $settings);
  }

  // Return result
  return $settings;
}