<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 9/20/2017
 * Time: 10:43 AM
 */
$single_portfolio_detail_configs = g5plusRubyBuild()->options()->get_single_portfolio_details();
$prefix = g5plusRubyBuild()->getMetaPrefix();
?>
<ul class="gsf-portfolio-meta">
    <?php foreach ($single_portfolio_detail_configs as $config): ?>
        <?php
        $meta_type = isset($config['type']) ? $config['type'] : 'text';
        $meta_title = isset($config['title']) ? $config['title'] : '';
        $meta_id = isset($config['id']) ? $config['id'] : '';
        $meta_value = '';
        $meta_value_url = '';
        if (!empty($meta_id)) {
            if ($meta_type === 'text') {
                $meta_value = g5plusRubyBuild()->metaBoxPortfolio()->getMetaValue("{$prefix}{$meta_id}");
            } else {
                $meta_value = g5plusRubyBuild()->metaBoxPortfolio()->getMetaValue("{$prefix}{$meta_id}_text");
                $meta_value_url = g5plusRubyBuild()->metaBoxPortfolio()->getMetaValue("{$prefix}{$meta_id}");
            }
        }
        ?>

        <?php if (!empty($meta_title)): ?>
            <li>
            <label><?php echo  esc_html($meta_title) ?></label>
                <?php if ($meta_type === 'text'): ?>
                    <span><?php echo esc_html($meta_value) ?></span>
                <?php else: ?>
                    <a href="<?php echo esc_url($meta_value_url) ?>"
                       title="<?php echo esc_attr($meta_value); ?>"><?php echo esc_html($meta_value); ?></a>
                <?php endif; ?>
        </li>
        <?php endif; ?>
    <?php endforeach; ?>
    <li><label><?php esc_html_e('Category','g5plus-ruby-build') ?></label> <?php g5plusRubyBuild()->portfolio()->the_category(', ') ?> </li>
</ul>
