<?php
/**
 * @version $Id$
 * @package    Contact_Enhanced
 * @subpackage Views
 * @author     Douglas Machado {@link http://ideal.fok.com.br}
 * @author     Created on 04-Dec-09
 * @license		GNU/GPL, see license.txt
 * Contact Enhanced  is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses. */

//-- No direct access
defined('_JEXEC') or die('=;)');

JHTML::_('behavior.tooltip');
JHTML::_('behavior.modal');
$doc =& JFactory::getDocument();
//$doc->addScript( 	JURI::root(). 'components/com_contact_enhanced/assets/js/validate.js' );
//$doc->addStyleSheet(JURI::root(). 'components/com_contact_enhanced/assets/css/validate.css');
$doc->addStyleSheet(JURI::base(). 'components/com_contact_enhanced/assets/css/contact_enhanced.css'); //administrator

?>
<div class="message-header">
	<span class="message-name"><?php echo $this->message->from_name; ?> </span>
	<span class="message-email"> &laquo;<?php echo $this->message->from_email; ?>&raquo; </span>
	
<?php 
	$attachments = '';
	/*
	if(count($this->attachments) > 0): 
	$fileList = ''; //'<ul>';
	foreach($this->attachments as $attachments){
		$attachments	= explode('|',$attachments->value);
		foreach($attachments as $attachment){
			$attachment	= trim($attachment);
			//$fileList .= '<li>'.$attachment.'</li>';
			$fileList .= ''.ceHelper::removePrefix($attachment,$this->message->id.'_').'<br />';
		}
	}
	//$fileList .= '</ul>';
	
	$attachments	= JHTML::_('image',JURI::root().'components/'.COMPONENT_FOLDER.'/assets/images/attachment.png', JText::_('Attachments'));
	$attachments	= JHTML::_('link','#attachments'.$this->message->id, $attachments);
*/
?>	
	<span class="message-attachment">
		<span style="text-decoration: none; color: rgb(51, 51, 51)" class="editlinktip hasTip" title="<?php  echo $fileList; ?>">
			<?php echo $attachments; //JHTML::_('tooltip',$fileList,JText::_('Attachments'), '',$attachments ); ?>
		</span>
	</span>
<?php /* endif;*/ ?>
<?php 
	$date			=& JFactory::getDate($this->message->date);
?>
	<span class="editlinktip hasTip" title="<?php  echo $date->toFormat(JText::_('DATE_FORMAT_LC2')); ?>">
		<span class="message-date"><?php echo ceHelper::timeDifference($this->message->date,'full'); ?></span>
	</span>
</div>
<pre class="message"><?php echo $this->message->message; ?></pre>
<a name="attachments<?php echo $this->message->id; ?>"> </a>
<?php //echo ceHelper::formatAttachmentList($this->attachments,$this->message->id); ?>
<div id="reply-actions">
	<a class="reply modal" rel="{handler:'iframe',size:{x:850,y:500}}"  
		href="index.php?option=<?php echo COMPONENT_FOLDER; ?>&controller=messages&task=reply&tmpl=component&cid[]=<?php echo $this->message->id; ?>&parent=<?php echo ($this->message->parent ? $this->message->parent : $this->message->id); ?>"><?php echo JText::_( 'Reply' ); ?></a>
</div>