<?php $u_setting = get_user_settings($id); ?>
<div class="gallery_area style_1">
	<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" id="masonry31">
		<?php foreach ($portfolio as $key => $row): ?>
			<div class ="grid-item <?= $row['type_id']?> <?= $row['is_video']==1?"":"portfolio_single_img";?> " data-filter="<?= $row['type_id']?>"  >
				<?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 ">
						<img src="<?php echo base_url($row['thumb']); ?>" alt="" />
						<?php if(!empty(html_escape($row['title']))): ?>
							<p class="port_flex"><?= html_escape($row['title']);?> 
							<?php if($u_setting['is_download']==1): ?>
								<a data-fancybox="images" href="<?php echo base_url($row['image']); ?>"><i class="fa fa-eye"></i></a>
							<?php endif ?>
						</p> 
						<?php endif ?>
						<a href="<?=!empty($row['link'])?html_escape($row['link']):'javascript:;'?>" class="port_link"><i class="fa fa-link"></i></a>
					</div>
				<?php endif;?>
			</div>
		<?php endforeach; ?>
	</div>
</div>

