<?php

if (!isset($gCms)) exit;

switch ($oldversion) {
	case "0.1.0" : case "0.2.0" : case "0.2.1":
		include_once dirname(__FILE__).'/class.player.php';
		$player = new pPlayer();
		if (!$player->loaddb(2)) break;

		$player->name = "Neolao MP3 Player Multi";
		$player->location = "modules/Play/bin/player_mp3_multi.swf";
		$player->params = array();
		$player->width = 200;
		$player->height = 100;
		$player->template =  <<<EOF
<object type="application/x-shockwave-flash" data="{\$location}" width="{\$width}" height="{\$height}">
	<param name="movie" value="{\$location}" />
	<param name="FlashVars" value="{strip}
		mp3={foreach from=\$files item=file name=foo}{if \$smarty.foreach.foo.first}{else}|{/if}{\$file}{/foreach}
		&amp;title={foreach from=\$files key=title item=file name=foo}{if \$smarty.foreach.foo.first}{else}|{/if}{\$title}{/foreach}
		{foreach from=\$player_params key=n item=v}&amp;{\$n}={\$v}{/foreach}
		{/strip}" />
	<param name="wmode" value="transparent" />
</object>
EOF;

		$player->paramlist = array('autoplay','bgcolor','bgcolor1','bgcolor2','buttoncolor','buttonovercolor','buttonwidth','currentmp3color','loadingcolor','loop','playlistalpha','playlistcolor','playlistrss','scrollbarcolor','scrollbarovercolor','showinfo','showlist','showloading','showplaylistnumbers','showslider','showvolume','shuffle','skin','slidercolor1','slidercolor2','sliderheight','sliderovercolor','sliderwidth','textcolor','volume','volumeheight','volumewidth');
		$result = $player->updatedb();
		
	case "0.3.0" : case "0.3.1" : case "0.3.2" :
		$dict = NewDataDictionary($db);
		$sqlarray = $dict->AddColumnSQL(cms_db_prefix()."module_play_players", "locked L");
		$dict->ExecuteSQLArray($sqlarray);
		
		include_once dirname(__FILE__).'/class.player.php';
		$player = new pPlayer();
		if (!$player->loaddb(1)) break;
		$player->locked = true;
		$player->updatedb();
		if (!$player->loaddb(2)) break;
		$player->locked = true;
		$player->updatedb();
}

$this->Audit( 0, $this->Lang('friendlyname'), $this->Lang('upgraded',$newversion));

?>