You are here

function _swftools_imagerotator_settings in SWF Tools 6.3

These are the default settings as they are stored in the database and displayed on the settings page.

2 calls to _swftools_imagerotator_settings()
swftools_imagerotator_profile_form in imagerotator/swftools_imagerotator.admin.inc
Returns a form definition for use by the profile system.
_swftools_imagerotator_flashvars in imagerotator/swftools_imagerotator.module
This function is called from swftools_imagerotator_swftools_flashvars() which is called from swf() It will return the default flashvar configuration, just prior to any overrides passed into swf(). We start with the settings defined on…

File

imagerotator/swftools_imagerotator.module, line 56
Enables SWF Tools support for the LongTail ImageRotator.

Code

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

  /**
   * SWFTOOLS_MINIMUM_SETTINGS is the minimum set of variables required to put a functional
   * player on the page. It should include any required variables that must be passed to
   * the player creation function to avoid notice errors because of undefined variables.
   *
   * SWFTOOLS_FULL_SETTINGS is the full complement of variables, as assigned on the input
   * page. It is normally only retrieved when the admin page requests them.
   */
  $defaults = array(
    SWFTOOLS_MINIMUM_SETTINGS => array(
      'basic' => array(
        'width' => '400',
        'height' => '320',
      ),
      'imagecache' => array(
        'imagecache' => SWFTOOLS_UNDEFINED,
      ),
    ),
    SWFTOOLS_FULL_SETTINGS => array(
      'basic' => array(
        'width' => '400',
        'height' => '320',
      ),
      'color' => array(
        'backcolor' => '',
        'frontcolor' => '',
        'lightcolor' => '',
      ),
      'appearance' => array(
        'logo' => '',
        'overstretch' => 'default',
        'showicons' => 'default',
        'shownavigation' => 'default',
        'transition' => 'default',
      ),
      'playback' => array(
        'rotatetime' => '3',
        'shuffle' => 'default',
      ),
      'interaction' => array(
        'enablejs' => 'default',
        'link' => '',
        'linkfromdisplay' => 'default',
        'linktarget' => 'default',
      ),
      'imagecache' => array(
        'imagecache' => SWFTOOLS_UNDEFINED,
      ),
    ),
  );

  // Retrieve default settings
  $settings = swftools_variable_get('swftools_imagerotator', $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 resulting defaults
  return $settings;
}