<?php
/**
 * @Package: WordPress Plugin
 * @Subpackage: Ultra Portfolio
 * @Since: Ultra Portfolio 1.0
 * @Current Version: Ultra Portfolio 3.1
 * @WordPress Version: 3.5 or above
 * This file is part of Ultra Portofolio WordPress Plugin.
 */
wp_register_style('effect-g1-common-css', plugins_url('/../templates/effect-g1-common.min.css', __FILE__));
wp_enqueue_style('effect-g1-common-css');
wp_register_style('effect-g1-' . $effcss . '-css', plugins_url('/../templates/effect-g1-' . $effcss . '.min.css', __FILE__));
wp_enqueue_style('effect-g1-' . $effcss . '-css');

if (isset($requesttype) && $requesttype == "ajax") {
    echo '<link rel="stylesheet" id="effect-g1-common-css-css" href="' . plugins_url('/../templates/effect-g1-common.min.css', __FILE__) . '" type="text/css" media="all">';
    echo '<link rel="stylesheet" id="effect-g1-' . $effcss . '-css-css" href="' . plugins_url('/../templates/effect-g1-' . $effcss . '.min.css', __FILE__) . '" type="text/css" media="all">';
}

if (!isset($classstr)) {
    $classstr = "";
}

//print_r($val4arr);
$classstr .= " uport-view " . $subeffcss . " ";
if ($effcss == "effect1") {
    $classstr .= " uport-view-first ";
}
if ($effcss == "effect2") {
    $classstr .= " uport-view-second ";
}
if ($effcss == "effect3") {
    // - ,v1, v2, v3
    $classstr .= " uport-view-third ";
}
if ($effcss == "effect4") {
    // - ,v1, v2, v3
    $classstr .= " uport-view-fourth";
}
if ($effcss == "effect5") {
    // - ,v1, v2, v3
    $classstr .= " uport-view-fifth ";
}
if ($effcss == "effect6") {
    // - ,v1
    $classstr .= " uport-view-sixth ";
}
if ($effcss == "effect7") {
    // - ,v1
    $classstr .= " uport-view-seventh ";
}
if ($effcss == "effect8") {
    // - ,v1, v2, v3
    $classstr .= " uport-view-eighth ";
}
if ($effcss == "effect10") {
    // - ,v1
    $classstr .= " uport-view-tenth";
}
if ($effcss == "effect101") {
    // - ,v1, v2
    $classstr .= " uport-view-hone ";
}
if ($effcss == "effect102") {
    $classstr .= " uport-view-htwo ";
}
?>


<?php
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'responsive');
?>

<style type='text/css'>

    .uport-view-<?php echo $pid; ?> .mask,.uport-view-<?php echo $pid; ?> .content {width: 100%;height: 100%;max-width:100%;min-width:100%;}
    .uport-view-<?php echo $pid; ?> img{width: 100%;height: auto;max-width:100%;min-width:100%;}
    .uport-view-<?php echo $pid; ?> {text-align: center;}

</style>   

<?php
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'item');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'border');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'shadow');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'maskbg');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'outbg');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'title');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'slug');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'desc');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'but');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'buthover');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'catul');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'catli');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'catlihover');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'price');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'above');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'wrapper');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'portbg');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'wrappercatul');
echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'area');

if ($effcss == "effect102") {
    //echo uport_common_css($pid, $val2arr, $val3arr, '1', 'g1', 'effect102maskbg');
}
?>



<style type="text/css">

    .uport-cats-<?php echo $pid; ?> a.filter{float:none!important;}

    .uport-grid-<?php echo $pid; ?> .mix{
        display: none;
        opacity: 0;
        vertical-align: top;
    }

</style>
<?php include("uport-g-script.php"); ?>

<div class="uport-wrapout uport-wrapout-<?php echo $pid; ?> uport-wrapout-mainid-<?php echo $id; ?>">
  <div class="uport-wrapper uport-wrapper-<?php echo $pid; ?>">

    <?php echo uport_filter_category($pid,$catfilterstr,$val2arr); ?>

    <!-- GRID -->
    <div class="main uport-grid uport-grid-<?php echo $pid; ?> <?php
         if ($loadscript == 'iso') {
             echo 'iso_' . $isoeffect;
         }
         ?> ">

        <?php
//print_r($val2arr);
        $disp = "";
        if (sizeof($allitem) > 0 && is_array($allitem)) {

            $itemcount = 0;
            foreach ($allitem as $detarr) {

                $newimgurl = uport_imageurl($detarr, $val2arr, $val3arr);

                if ($effcss == "effect1" || $effcss == "effect2" || $effcss == "effect3" || $effcss == "effect4" || $effcss == "effect5" || $effcss == "effect6" || $effcss == "effect7" || $effcss == "effect8" || $effcss == "effect10") {
                    $disp .= '<div class=" ' . $scriptclass . ' ' . $detarr['catclass'] . ' ' . $classstr . ' uport-view-' . $pid . ' "><div class="item-wrapper">';
                    $disp .= uport_display_elements('above', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);
                    $disp .= "<div class='mask-wrapper ".$outmaskclass."'>";
                    if (in_array('image', $showthis)) {
                        $disp .= '<img src="' . $newimgurl . '" />';
                    }
                    $disp .= '<div class="mask">';
                    if ($effcss == "effect2") {
                        $disp .= '</div><div class="content">';
                    }

                    $disp .= uport_display_elements('over', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);

                    $disp .= '</div></div>';

                    $disp .= uport_display_elements('out', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);

                    $disp .= '</div></div>';
                    include("uport-lightboxele.php");
                }
                if ($effcss == "effect101") {

                    $disp .= '<div class=" ' . $scriptclass . ' ' . $detarr['catclass'] . ' ' . $classstr . ' uport-view-' . $pid . ' "><div class="item-wrapper">';
                    $disp .= uport_display_elements('above', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);
                    $disp .= "<div class='mask-wrapper ".$outmaskclass."'>";
                    if (in_array('image', $showthis)) {
                        $disp .= '<img src="' . $newimgurl . '" />';
                    }

                    $disp .= '<div class="mask">';

                    $disp .= uport_display_elements('over', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);

                    $disp .= '</div>';

                    $disp .= '</div>';

                    $disp .= uport_display_elements('out', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);

                    $disp .= '</div></div>';

                    include("uport-lightboxele.php");
                }

                if ($effcss == "effect102") {
                    $disp .= '<div class=" ' . $scriptclass . ' ' . $detarr['catclass'] . ' ' . $classstr . ' uport-view-' . $pid . ' "><div class="item-wrapper">';
                    if (in_array('image', $showthis)) {
                        $disp .= '' . $detarr['embed'] . '';
                    }
                    $disp .= '<div class="outer">';

                    $disp .= uport_display_elements('out', $pid, $showthis, $showthissub, $detarr, $effcss, $gtype, $val2arr, $val3arr,$sctype);

                    $disp .= '</div>';
                    $disp .= '</div></div>';
                    include("uport-lightboxele.php");
                }
            
                $itemcount++;
                if(uport_max_items_limit($val1arr,$itemcount) == "break"){
                    break;
                }

            }
        }
        echo $disp;
        ?>
    </div>
</div>
</div>