<?php if(isset($this->demo) && $this->demo == 1 ): ?>
	Disabled in online demo
<?php 
		return; 
	endif ?>
<?php
	if( $this->errorCode == 2 ) 
	{                             
		
		echo $this->translate( 'Problem uploading file.' );
		
	}
	elseif( $this->errorCode == 4 )
	{                             
		
		echo $this->translate( 'Uploaded file not a valid Plugin package.' );
		
	}
	elseif( $this->errorCode == 8 )
	{                             
		
		if( $this->error == 'Plugin already installed.' )
		{
			
			echo $this->translate( 'Plugin already installed.' );
			
		}
		elseif( $this->error == 'Unable to create plugin folder.' )
		{
			
			echo $this->translate( 'Unable to create plugin folder.' );
			
		}
		elseif( $this->error == 'Extraction of plugin package failed or invalid plugin structure.' )
		{
			
			echo $this->translate( 'Extraction of plugin package failed or invalid plugin structure.' );
			
		}
		elseif( $this->error == 'Unable to find expected plugin class file.' )
		{
			
			echo $this->translate( 'Unable to find expected plugin class file.' );
			
		}
		elseif( $this->error == 'Unable to create temporary folder to unpack plugin.' )
		{
			
			echo $this->translate( 'Unable to create temporary folder to unpack plugin.' );
			
		}
		else
		{
			
			echo $this->error;
			
		}
		
	}
	elseif( $this->errorCode != 16 && $this->errorCode != 0 )
	{
		
		echo $this->translate('Unknown error.');
		
	}
?>
<?php 	if( $this->errorCode == 0 || $this->errorCode == 16 ): ?>
<table class="settings" style="margin-top:10px;">
	<tr>
		<td colspan="2">
<?php 		echo $this->render('plugins/info.phtml', $this) ?>
		</td>
	</tr>
<?php 		if( $this->errorCode == 0 ): ?>
	<tr>
		<td></td>
		<td>
			<div id="back_button_install_plugin">
			   <br />
			   <a href="#"><span class="stronglastword"><?php echo $this->translate("Install") ?> <strong><?php echo htmlentities($this->plugin['name'], ENT_QUOTES, "UTF-8") ?></strong></span></a>
		   </div>
		</td>
	</tr>
<?php 		endif; ?>
</table>
<?php 	endif; ?>
<?php 	if( $this->errorCode == 0): ?>
<script>
	setTimeout('$("#back_button_install_plugin").bind("click", function() { $("#add_plugins").load("<?php echo $this->moduleBaseUrl ?>/plugins/add/file/<?php echo base64_encode($this->plugin['tgzPath']) ?>"); });',300);
</script>       
<?php 	elseif( $this->errorCode == 16 ): ?>
<script>
	setTimeout("$.simpleFlash('<?php echo addslashes($this->translate('Uploaded plugin not compatible with this version of Atmail')) ?>', 'error');",300)
</script>       
<?php 	endif; ?>