<?php $u_setting = get_user_settings($id); ?>
<div class="gallery_area style_4">
	<div class="gallery_top_menu">
		<ul class="gallery_sort">
			<li><button  data-filter='*' class="active default-button"><?= !empty(lang('all'))?lang('all'):"All"?></button></li>
			<?php foreach ($portfolio_type as $key => $type): ?>
				<li><button  data-filter='.<?= html_escape($type['id']);?>' class="default-button"><?= html_escape($type['name']);?></button></li>
			<?php endforeach ?>
		</ul>
	</div>
	<div class="grid">
		<?php foreach ($portfolio as $key => $row): ?>
			<div class =" grid-item <?= $row['type_id']?> <?= $row['is_video']==1?"":"portfolio_single_img";?>">
				<?php if($row['is_video']==1): ?>
					<div class="videoWrapper portfolioVideo">
						<iframe src="<?= $row['link']; ;?>" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
						<?php if(!empty(html_escape($row['title']))): ?>
							<p class="video_title"><?= html_escape($row['title']);?> </p> 
						<?php endif ?>
					</div>
				<?php else: ?>
					<div class="portfolio_img">
						<div class="port_img">
							<a data-fancybox="gallery" href="<?php echo base_url($row['image']); ?>"><img src="<?php echo base_url($row['thumb']); ?>"></a>
						</div>
						<div class="portfolio_hover_area">
							<div class="portfolio_top_text">
								<?php if(!empty(html_escape($row['title']))): ?>
									<h5><?= html_escape($row['title']);?> 
									<?php if($u_setting['is_download']==1): ?>
										<a download href="<?= $row['image'];?>" class="fz-12"><i class="fa fa-download"></i></a> 
									<?php endif ?>
								</h5> 
								<?php endif ?>
								<h6><?= get_portfolio_type_name(html_escape($row['type_id']));?></h6>

							</div>
							
							<div class="">
								<a href="<?=!empty($row['link'])?html_escape($row['link']):'javascript:;'?>" class="portfolio_link"><i class="fa fa-plus-square-o"></i></a>
							</div>
						</div>
					</div>
				<?php endif;?>
			</div>
		<?php endforeach; ?>
	</div>
</div>