<?php
/**
 * @version    $Id$
 * @package    IT_Theme_Framework
 * @author     InnoThemes Team <support@innothemes.com>
 * @copyright  Copyright (C) 2012 InnoThemes.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.innothemes.com
 */

// Globalize comment object
$GLOBALS['comment'] = $comment;

switch ( $comment->comment_type ) :

case 'pingback'  :
case 'trackback' :
	?>
	<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
		<p>
			<?php
			_e( 'Pingback:', IT_THEME_TEXTDOMAIN );
			comment_author_link();
			edit_comment_link( __( '(Edit)', IT_THEME_TEXTDOMAIN ), '<span class="edit-link">', '</span>' );
			?>
		</p>
	<?php
break;

default :
	global $post;
	?>
	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
		<article id="comment-<?php comment_ID(); ?>" class="comment">
			<header class="comment-meta comment-author vcard">
				<?php
				echo get_avatar( $comment, 44 );

				printf(
					'<cite class="fn">%1$s %2$s</cite>',
					get_comment_author_link(),
					( $comment->user_id == $post->post_author ) ? '<span>' . __( 'Post author', IT_THEME_TEXTDOMAIN ) . '</span>' : ''
				);

				printf(
					'<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
					esc_url( get_comment_link( $comment->comment_ID ) ),
					get_comment_time( 'c' ),
					sprintf( __( '%1$s at %2$s', IT_THEME_TEXTDOMAIN ), get_comment_date(), get_comment_time() )
				);
				?>
			</header><!-- .comment-meta -->

			<?php if ( '0' == $comment->comment_approved ) : ?>
			<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', IT_THEME_TEXTDOMAIN ); ?></p>
			<?php endif; ?>

			<section class="comment-content comment">
				<?php
				comment_text();
				edit_comment_link( __( 'Edit', IT_THEME_TEXTDOMAIN ), '<p class="edit-link">', '</p>' );
				?>
			</section><!-- .comment-content -->

			<div class="reply">
				<?php
				comment_reply_link(
					array_merge(
						$args,
						array(
							'reply_text' => __( 'Reply', IT_THEME_TEXTDOMAIN ),
							'after'      => '<span>&darr;</span>',
							'depth'      => $depth,
							'max_depth'  => $args['max_depth'],
						)
					)
				);
				?>
			</div><!-- .reply -->
		</article><!-- #comment-## -->
	<?php
break;

endswitch;
