You are here

function simpleviewer_simpleviewer_swftools_playlist in SWF Tools 6.2

File

simpleviewer/simpleviewer.module, line 108

Code

function simpleviewer_simpleviewer_swftools_playlist($playlist_data, &$method, &$vars) {
  $sv_vars = _simpleviewer_vars();
  $xml_vars = array_merge($sv_vars['xml'], $vars->flashvars);
  $xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
  $xml .= '<simpleviewerGallery ' . 'maxImageWidth="' . $xml_vars['maxImageWidth'] . '" ' . 'maxImageHeight="' . $xml_vars['maxImageHeight'] . '" ' . 'textColor="' . str_replace('#', '0x', $xml_vars['textColor']) . '" ' . 'frameColor="' . str_replace('#', '0x', $xml_vars['frameColor']) . '" ' . 'frameWidth="' . $xml_vars['frameWidth'] . '" ' . 'stagePadding="' . $xml_vars['stagePadding'] . '" ' . 'thumbnailColumns="' . $xml_vars['thumbnailColumns'] . '" ' . 'thumbnailRows="' . $xml_vars['thumbnailRows'] . '" ' . 'navPosition="' . $xml_vars['navPosition'] . '" ' . 'title="' . $xml_vars['title'] . '" ' . 'imagePath="' . $vars->params['base'] . '" ' . 'thumbPath="' . $vars->params['base'] . '" ' . 'enableRightClickOpen="' . $xml_vars['enableRightClickOpen'] . '" ' . 'backgroundImagePath="' . $xml_vars['backgroundImagePath'] . '">';
  foreach ($playlist_data['playlist'] as $track => $details) {

    // Strip default sites path if it is present
    if (strpos($details['filename'], file_create_path()) === 0) {
      $details['filename'] = str_replace(file_create_path() . '/', '', $details['filename']);
    }
    $xml .= '
    <image>
      <filename>' . $details['filename'] . '</filename>
      <caption>' . $details['description'] . '</caption>
    </image>';
  }
  $xml .= "\n</simpleviewerGallery>";
  return $xml;
}