You are here

function swftools_simpleviewer_playlist in SWF Tools 5

Same name and namespace in other branches
  1. 6 simpleviewer/simpleviewer.module \swftools_simpleviewer_playlist()

File

simpleviewer/simpleviewer.module, line 106

Code

function swftools_simpleviewer_playlist($playlist_data, &$method, &$vars) {
  $sv_vars = _simpleviewer_vars(TRUE);

  /*
    $width = 0;
    $height = 0;
    foreach ($playlist_data['playlist'] AS $key => $file) {
      $info = swftools_get_info($file['filepath']);
      $height = max($info['height'], $height);
      $width = max($info['width'], $width);
    }
  */
  $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) {
    $xml .= '
    <image>
    	<filename>' . $details['filename'] . '</filename>
    	<caption>' . $details['description'] . '</caption>
    </image>';
  }
  $xml .= "\n</simpleviewerGallery>";
  return $xml;
}