<?php
/**
 * This file is to get xml code
 *
 * This file is having get xml code
 *
 * PHP version 5.0
 *
 * @category	Anova
 * @package     ansAudioConfigXmlCode
 * @author 		shankar_76ag08
 * @copyright 	Copyright (c) 2009 {@link http://www.agriya.com Agriya Infoway}
 * @license		http://www.agriya.com Agriya Infoway Licence
 * @since 		2008-12-19
 *
 **/
require_once('../common/configs/config.inc.php');
$CFG['lang']['include_files'][] = 'languages/%s/admin/ansAudioConfiguration.php';
$CFG['site']['is_module_page'] = $CFG['admin']['index']['anova_module'];
//compulsory
$CFG['mods']['is_include_only']['non_html_header_files'] = true;
$CFG['mods']['is_include_only']['html_header'] = false;
$CFG['html']['is_use_header'] = false;
/**
 * To include application top file
*/
require_once($CFG['site']['project_path'].'common/application_top.inc.php');
/**
 * XmlCode
 *
 * @package
 * @author selvaraj_35ag05
 * @copyright Copyright (c) 2009
 * @version $Id: $
 * @access public
 **/
class XmlCode extends FormHandler
	{
		/**
		 * XmlCode::changeConfigBooleanValues()
		 *
		 * @return
		 **/
		public function changeConfigBooleanValues()
			{
				$array = array('AutoPlay', 'ToolTip');

				foreach($array as $key=>$value)
					{
						if($this->CFG['admin']['ans_audios'][$value])
							$this->CFG['admin']['ans_audios'][$value] = 'true';
						else
							$this->CFG['admin']['ans_audios'][$value] = 'false';
					}
			}

		/**
		 * XmlCode::getXmlCode()
		 *
		 * @return
		 */
		public function getXmlCode()
			{
				$fields = explode('_', $this->fields_arr['pg']);
				$this->fields_arr['pg'] = $fields[0];
				$this->fields_arr['aid'] = $fields[1];

				if(!($this->fields_arr['pg'] and $this->fields_arr['aid']))
					{
						return;
					}

				$sharing_url = '';
				switch($this->fields_arr['pg'])
					{
						case 'music':
							break;

						case 'previewmusic':
							break;

						case 'smallmusic':
							$this->CFG['admin']['musics']['SelectedSkin'] = 'mini_'.$this->CFG['admin']['musics']['SelectedSkin'];
							break;

						case 'musicactivate':
							$this->CFG['admin']['musics']['SelectedSkin'] = 'mini_'.$this->CFG['admin']['musics']['SelectedSkin'];
							break;
					}
				$this->changeConfigBooleanValues();

				if(!chkIsPaymentUpgradeAllowed())
					$this->LANG['upgrade_alert'] = $this->LANG['upgrade_not_allowed_msg'];

				if(!chkIsPaymentAllowed() or $this->fields_arr['pg'] == 'previewmusic')
					$view_time = 'unlimited';
				elseif(isset($_SESSION['plan']['plan_viewaudio_time']))
					$view_time = $_SESSION['plan']['plan_viewaudio_time'];
				else
					$view_time = 3;
?>
<CONFIG>
	<SETTINGS>
		<PLAYER autoplay="false" />
		<PLAYER toolTip="true" />
		<PLAYER initVolume ="90"/>
		<PLAYER showPlaylist ="yes"/>
		<PLAYER Name="alertTime" Duration="<?php echo $view_time;?>"/>
	</SETTINGS>
	<SKINS>
		<SKIN Name="newskin" recorderPath="<?php echo $this->CFG['site']['url'].$this->CFG['admin']['index']['anova_module'].'/files/flash/mp3_player/skins/'.$this->CFG['admin']['ans_audios']['SelectedSkin'];?>.swf"  enabled="true"/>
	</SKINS>
	<GOTO Name="goto" URL="http://www.ijigg.com/songs/" Target="_blank" />
	<CMT Name="cmt" URL="http://www.yahoo.com/" Target="_blank" />
	<SHARE Name="share" URL="<?php echo $sharing_url;?>" Target="_blank" />
	<LOGIN Name="login" URL="" Target="_blank" />
	<ALERTXML Name="AlertWindow" Url="<?php echo $this->CFG['site']['url'].$this->CFG['admin']['index']['anova_module'].'/paymentUpgrade.php';?>" alertText="<?php echo $this->LANG['upgrade_alert'];?>" clickText ="<?php echo $this->LANG['upgrade_ok'];?>" cancelText ="<?php echo $this->LANG['upgrade_cancel'];?>"/>
	<INTERFACE>
		<TEXT  Tooltip="Play"  Label="<?php echo $this->LANG['common_play'];?>" />
		<TEXT  Tooltip="Pause"  Label="<?php echo $this->LANG['common_pause'];?>" />
		<TEXT  Tooltip="Volume"  Label="<?php echo $this->LANG['VolToolTip'];?>" />
		<TEXT  Tooltip="Repeat"  Label="<?php echo $this->LANG['RepeatToolTip'];?>" />
		<TEXT  Tooltip="Repeatoff"  Label="<?php echo $this->LANG['RepeatoffToolTip'];?>" />
	</INTERFACE>
</CONFIG>
<?php
			}
	}
//<<<<<-------------- Class XmlCode begins ---------------//
//-------------------- Code begins -------------->>>>>//
$XmlCode = new XmlCode();
$XmlCode->includeAjaxHeader();
$CFG['user']['user_id'] = isset($_SESSION['user']['user_id'])?$_SESSION['user']['user_id']:'0';
$XmlCode->setPageBlockNames(array('get_code_form'));
//default form fields and values...
$XmlCode->setFormField('aid', '');
$XmlCode->setFormField('pg', '');
$XmlCode->setFormField('gurl', '');
$XmlCode->setFormField('full', false);
$XmlCode->setPageBlockShow('get_code_form');
$XmlCode->sanitizeFormInputs($_GET);
//<<<<<-------------------- Code ends----------------------//
//-------------------- Page block templates begins -------------------->>>>>//
if ($XmlCode->isShowPageBlock('get_code_form'))
    {
		$XmlCode->getXmlCode();
	}
//<<<<<-------------------- Page block templates ends -------------------//
$XmlCode->includeAjaxFooter();
?>