<?php 
defined('C5_EXECUTE') or die(_("Access Denied."));
Loader::model("attribute/categories/collection");
Loader::model('file_set');
Loader::model('file_list');
$ih = Loader::helper('image');
$date = date('F j, Y', strtotime($c->getCollectionDatePublic()));
$fileSetID = $c->getAttribute('portfolio_gallery'); //<-- change this to the file set id you want to use
$fs = FileSet::getByID($fileSetID);
$fl = new FileList();      
$fl->filterBySet($fs);
$fl->filterByType(FileType::T_IMAGE);
$fl->sortByFileSetDisplayOrder();
$images = $fl->get(); 
$this->inc('elements/header.php'); ?>
    
    <div id="wrapper" class="fade-in three">
    	<div class="row">
            <div id="content" class="large-12 columns" role="main">
                <article class="post">
                    <div class="row">
                        <div class="large-8 push-4 columns">
                        	<?php if( !empty($images) ) : ?>
                        	<ul data-orbit>
                            	<?php $i=0; foreach($images as $image) : 
									$title = $image->getApprovedVersion()->getTitle();
									$caption = $image->getApprovedVersion()->getDescription();
									$thumb = $ih->getThumbnail($image, 700, 9999, false);
								?>
                                <li>
                                    <img src="<?php echo $thumb->src; ?>" width="<?php echo $thumb->width; ?>" height="<?php echo $thumb->height; ?>" align="<?php echo $title ?>" />
                                    <div class="orbit-caption">
                                        <h3><?php echo $title; ?></h3>
                                        <p><?php echo $caption; ?></p>
                                    </div>
                                </li>
                                <?php $i++; endforeach; ?>
                            </ul>
                            <?php endif; ?>
                            <br />
                        </div>
                        <div class="large-4 pull-8 columns">
                            <small class="meta">
                                <span><i class="icon-calendar"></i> <?php echo $date; ?></span>
                            </small>
                            <?php if ($c->getAttribute('portfolio_services')) { ?>
                            <ul class="check-list">
								<?php
								$selectedOptions = $c->getCollectionAttributeValue('portfolio_services');
								if (is_object($selectedOptions)) {
									foreach ($selectedOptions as $opt) {
									echo '<li><i class="icon-ok"></i> '.$opt.'</li>';
									}
								}
                                ?>
                            </ul>
                            <?php } ?>
                            <hr>
                            <?php 
							$a = new Area('Main');
							$a->display($c);
							?>
                        </div>
                    </div><!-- .row ends -->
                    <hr>
                    <div class="row">
                        <div class="large-12 columns">
                        	<?php 
							$a = new Area('Aside');
							$a->display($c);
							?>
                        </div>
                    </div><!-- .row ends -->
                </article><!-- .post ends -->
            </div><!-- #content ends -->
        </div><!-- #wrapper .row ends -->
    </div><!-- #wrapper ends -->
    
<?php $this->inc('elements/footer.php'); ?>