Example #1
0
    function front_show_gallery($id)
    {
        $fout = '';
        $this->sliders_index++;
        $fullscreen = 'off';
        if ($this->mainitems == '') {
            return;
        }
        //echo $id;
        $i = 0;
        $k = 0;
        for ($i = 0; $i < count($this->mainitems); $i++) {
            if (isset($id) && $id == $this->mainitems[$i]['settings']['id']) {
                $k = $i;
            }
        }
        $its = $this->mainitems[$k];
        $user_feed = '';
        $yt_playlist_feed = '';
        if ($its['settings']['youtubefeed'] == 'on' && $its['settings']['youtubefeed_user'] != '') {
            $user_feed = $its['settings']['youtubefeed_user'];
            if ($its['settings']['youtubefeed_playlist'] == '') {
                $its['settings']['youtubefeed'] = 'off';
            }
        }
        if ($its['settings']['youtubefeed'] == 'on' && $its['settings']['youtubefeed_playlist'] != '') {
            $yt_playlist_feed = $its['settings']['youtubefeed_playlist'];
            $its['settings']['youtubefeed'] = 'on';
            $user_feed = '';
        }
        $skin = 'deploy/preview.swf';
        if ($its['settings']['skin'] == 'light') {
            $skin = "deploy/preview_skin_overlay.swf";
        }
        if ($its['settings']['skin'] == 'rouge') {
            $skin = "deploy/preview_skin_rouge.swf";
        }
        if ($its['settings']['skin'] == 'complete_allchars') {
            $skin = "deploy/preview_allchars.swf";
        }
        if ($its['settings']['designgenerator'] == 'on') {
            $skin = 'deploy/preview.swf';
        }
        $swfloc = $this->abspath . $skin;
        $wmode = 'opaque';
        $wmode = $its['settings']['windowmode'];
        $fout .= '<object type="application/x-shockwave-flash" data="' . $swfloc . '" width="' . $its['settings']['width'] . '" height="' . $its['settings']['height'] . '" id="flashcontent' . $this->sliders_index . '" style="visibility: visible;">
<param name="movie" value="' . $swfloc . '"><param name="menu" value="false"><param name="allowScriptAccess" value="always">
<param name="scale" value="noscale"><param name="allowFullScreen" value="true"><param name="wmode" value="' . $wmode . '">
<param name="flashvars" value="';
        //print_r($its[$k]);
        //..youtube user feed..
        if ($user_feed != '') {
            for ($i = 0; $i < count($its) - 1; $i++) {
                unset($its[$i]);
            }
            $target_file = "http://gdata.youtube.com/feeds/api/users/" . $user_feed . "/uploads?v=2&alt=jsonc";
            //echo $target_file;
            $ida = dzs_get_contents($target_file);
            $idar = json_decode($ida);
            //print_r($idar);
            //print_r(count($idar->data->items));
            $i = 0;
            if ($its['settings']['youtubefeed_maxvideos'] == '') {
                $its['settings']['youtubefeed_maxvideos'] = 100;
            }
            $yf_maxi = $its['settings']['youtubefeed_maxvideos'];
            foreach ($idar->data->items as $ytitem) {
                //print_r($ytitem);
                $its[$i]['source'] = $ytitem->id;
                $its[$i]['thethumb'] = "";
                $its[$i]['type'] = "youtube";
                $aux = $ytitem->title;
                $lb = array('"', "\r\n", "\n", "\r", "&", "-", "`", '�', "'", '-');
                $aux = str_replace($lb, ' ', $aux);
                $its[$i]['title'] = $aux;
                $aux = $ytitem->description;
                $lb = array('"', "\r\n", "\n", "\r", "&", "-", "`", '�', "'", '-');
                $aux = str_replace($lb, ' ', $aux);
                $its[$i]['description'] = $aux;
                $i++;
                if ($i > $yf_maxi + 1) {
                    break;
                }
            }
            $its[$i]['source'] = " ";
            $its[$i]['thethumb'] = " ";
            //$its[$i]['type'] = " ";
        }
        //http://vimeo.com/api/v2/blakewhitman/videos.json
        if (isset($its['settings']['vimeofeed']) && $its['settings']['vimeofeed'] == 'on') {
            for ($i = 0; $i < count($its) - 1; $i++) {
                unset($its[$i]);
            }
            $target_file = "http://vimeo.com/api/v2/" . $its['settings']['vimeofeed_user'] . "/videos.json";
            $ida = dzs_get_contents($target_file);
            $idar = json_decode($ida);
            $i = 0;
            foreach ($idar as $item) {
                $its[$i]['source'] = $item->id;
                $its[$i]['thethumb'] = $item->thumbnail_small;
                $its[$i]['type'] = "vimeo";
                $aux = $item->title;
                $lb = array('"', "\r\n", "\n", "\r", "&", "-", "`", '�', "'", '-');
                $aux = str_replace($lb, ' ', $aux);
                $its[$i]['title'] = $aux;
                $aux = $item->description;
                $lb = array('"', "\r\n", "\n", "\r", "&", "-", "`", '�', "'", '-');
                $aux = str_replace($lb, ' ', $aux);
                $its[$i]['description'] = $aux;
                $i++;
            }
        }
        if ($its['settings']['youtubefeed'] == 'on' && $its['settings']['youtubefeed_playlist'] != '') {
            for ($i = 0; $i < count($its) - 1; $i++) {
                unset($its[$i]);
            }
            $target_file = "http://gdata.youtube.com/feeds/api/playlists/" . $yt_playlist_feed . "?alt=json&start-index=1&max-results=40";
            $ida = dzs_get_contents($target_file);
            $idar = json_decode($ida);
            //print_r(count($idar->data->items));
            $i = 0;
            if ($its['settings']['youtubefeed_maxvideos'] == '') {
                $its['settings']['youtubefeed_maxvideos'] = 100;
            }
            $yf_maxi = $its['settings']['youtubefeed_maxvideos'];
            foreach ($idar->feed->entry as $ytitem) {
                $aux = array();
                parse_str($ytitem->link[0]->href, $aux);
                //print_r($aux['http://www_youtube_com/watch?v']);
                $its[$i]['source'] = $aux['http://www_youtube_com/watch?v'];
                $its[$i]['thethumb'] = "";
                $its[$i]['type'] = "youtube";
                //print_r($ytitem);
                $aux2 = get_object_vars($ytitem->title);
                $aux = $aux2['$t'];
                $lb = array("\r\n", "\n", "\r", "&", "-", "`", '�', "'", '-');
                $aux = str_replace($lb, ' ', $aux);
                /*
                $aux = $ytitem->description;
                $lb   = array("\r\n", "\n", "\r", "&" ,"-", "`", '�', "'", '-');
                $aux = str_replace($lb, ' ', $aux);
                $its['settings']['description'] = $aux;
                */
                $i++;
                if ($i > $yf_maxi) {
                    break;
                }
            }
        }
        $videos = '';
        $thumbs = '';
        $titles = '';
        $descriptions = '';
        $types = '';
        for ($i = 0; $i < count($its) - 1; $i++) {
            $videos .= $its[$i]['source'];
            if ($i != count($its) - 2) {
                $videos .= ';';
            }
            if ($its[$i]['thethumb'] == '' && $its[$i]['type'] == 'vimeo') {
                $imgid = $its[$i]['source'];
                $url = "http://vimeo.com/api/v2/video/{$imgid}.php";
                $cache = dzs_get_contents($url);
                $imga = unserialize($cache);
                $img = $imga[0]['thumbnail_small'];
                $its[$i]['thethumb'] = $img;
            }
            $thumbs .= $its[$i]['thethumb'];
            if ($i != count($its) - 2) {
                $thumbs .= ';';
            }
            $types .= $its[$i]['type'];
            if ($i != count($its) - 2) {
                $types .= ';';
            }
            $titles .= $its[$i]['title'];
            if ($i != count($its) - 2) {
                $titles .= ';';
            }
            $descriptions .= $its[$i]['description'];
            if ($i != count($its) - 2) {
                $descriptions .= ';';
            }
        }
        //echo 'ceva';
        //echo $videos;
        //print_r($its);
        $iosbackup = '';
        $iosbackup .= '
<div id="ios-vg' . $this->sliders_index . '" class="ios-vg" style="width:' . $its['settings']['width'] . 'px; height:' . $its['settings']['height'] . 'px;">';
        $iosbackup .= '
<ul class="videos">';
        $vw = $its['settings']['width'] - 200;
        if ($its['settings']['menuposition'] == 'none') {
            $vw = $its['settings']['width'];
            $iosbackup .= '<style>#ios-vg' . $this->sliders_index . ' .videos-menu{ display:none; }</style>';
        }
        for ($i = 0; $i < count($its) - 1; $i++) {
            if ($its[$i]['type'] == "video") {
                $iosbackup .= '<li style="width:' . $vw . 'px; height:' . $its['settings']['height'] . 'px;"><video width="' . $vw . '" height="' . $its['settings']['height'] . '" controls="" webkit-playsinline><source src="' . $its[$i]['source'] . '" /></video></li>';
            }
            if ($its[$i]['type'] == "youtube") {
                $iosbackup .= '<li style="width:' . $vw . 'px; height:' . $its['settings']['height'] . 'px;"><iframe width="' . $vw . '" height="' . $its['settings']['height'] . '" src="http://www.youtube.com/embed/' . $its[$i]['source'] . '" frameborder="0" allowfullscreen></iframe></li>';
            }
            if ($its[$i]['type'] == "vimeo") {
                $iosbackup .= '<li style="width:' . $vw . 'px; height:' . $its['settings']['height'] . 'px;"><iframe src="http://player.vimeo.com/video/' . $its[$i]['source'] . '?portrait=0&amp;color=ffffff" width="' . $vw . '" height="' . $its['settings']['height'] . '" frameborder="0"></iframe></li>';
            }
            if ($its[$i]['type'] == "audio") {
                $iosbackup .= '<li style="width:' . $vw . 'px; height:' . $its['settings']['height'] . 'px;"><audio width="' . $vw . '" height="' . $its['settings']['height'] . '" src="' . $its[$i]['source'] . '"></audio></li>';
            }
            if ($its[$i]['type'] == "image") {
                $iosbackup .= '<li style="width:' . $vw . 'px; height:' . $its['settings']['height'] . 'px;"><img width="' . $vw . '" height="' . $its['settings']['height'] . '" src="' . $its[$i]['source'] . '"/></li>';
            }
            if ($its[$i]['type'] == "inline") {
                $iosbackup .= $its[$i]['source'];
            }
        }
        $iosbackup .= '</ul>';
        $iosbackup .= '<ul class="videos-menu">';
        for ($i = 0; $i < count($its) - 1; $i++) {
            $iosbackup .= '<li';
            if ($i == 1) {
                $iosbackup .= ' class="selected"';
            }
            $iosbackup .= '><img class="the-thumb" src="' . $its[$i]['thethumb'] . '"><div class="the-title">' . $its[$i]['title'] . '</div><div class="the-content">' . $its['settings']['description'] . '</div></li>';
        }
        $iosbackup .= '</ul>';
        $iosbackup .= '</div>';
        $iosbackup .= '<script>
	jQuery(document).ready(function($){
        if(is_ios()==true){
        $("#ios-vg' . $this->sliders_index . '").iosgallery();
            }
	})
        </script>';
        //echo $this->abspath;
        $fout .= dzs_addSwfAttr('video', $videos, true);
        $fout .= dzs_addSwfAttr('totalWidth', $its['settings']['width']);
        $fout .= dzs_addSwfAttr('totalHeight', $its['settings']['height']);
        $fout .= dzs_addSwfAttr('thumbs', $thumbs);
        $fout .= dzs_addSwfAttr('types', $types);
        $fout .= dzs_addSwfAttr('titles', $titles);
        $fout .= dzs_addSwfAttr('menuDescriptions', $descriptions);
        $fout .= dzs_addSwfAttr('menuPosition', $its['settings']['menuposition']);
        $fout .= dzs_addSwfAttr('autoplay', $its['settings']['autoplay']);
        $fout .= dzs_addSwfAttr('shareButton', "on");
        $fout .= dzs_addSwfAttr('shareIcons', $this->abspath . 'img/twitter.png;' . $this->abspath . 'img/facebook.png');
        $fout .= dzs_addSwfAttr('shareTooltips', "Tweet It;Share on Facebook");
        $fout .= dzs_addSwfAttr('shareLinks', "http://twitter.com/sharecr63urlcr61" . dzs_curr_url() . "cr38textcr61Awesome%20VideoGallery;http://www.facebook.com/sharer.phpcr63ucr61" . dzs_curr_url() . "cr38tcr61Awesome%20VideoGallery");
        if ($its['settings']['embedbutton'] == 'on') {
            $fout .= dzs_addSwfAttr('embedButton', "on");
            $fout .= dzs_addSwfAttr('htmlEmbedCode', "cr60iframe src=cr34" . $this->abspath . 'bridge.phpcr63actioncr61viewcr38idcr61' . $its['settings']['id'] . "cr34 width=cr34" . $its['settings']['width'] . "cr34 height=cr34" . $its['settings']['height'] . "cr34 style=cr34overflow:hidden;cr34 cr62cr60/iframecr62");
        }
        if (isset($its['settings']['thumbnail']) && $its['settings']['thumbnail'] != '') {
            $fout .= dzs_addSwfAttr('cueFirstVideo', "off");
            $fout .= dzs_addSwfAttr('thumb', $its['settings']['thumbnail']);
        }
        if ($its['settings']['designgenerator'] == 'on') {
            $fout .= dzs_addSwfAttr('designXML', $this->abspath . 'deploy/xml/design.xml');
        }
        $fout .= '">';
        $fout .= $iosbackup . '</object>';
        /*
            
            if($zs1_ispreview=='on' && $this->sliders_index<2){
                if(isset ($_GET['opt1']))
                    $its['settings']['width'] = $_GET['opt1'];
                if(isset ($_GET['opt2']))
                    $its['settings']['height'] = $_GET['opt2'];
                if(isset ($_GET['opt3']))
                    $its['settings']['menuposition'] = $_GET['opt3'];
                if(isset ($_GET['opt4']))
                    $its['settings'][4] = $_GET['opt4'];
                if(isset ($_GET['opt5']))
                    $its['settings']['youtubefeed'] = $_GET['opt5'];
                if(isset ($_GET['opt6']))
                    $its['settings']['youtubefeed_user'] = $_GET['opt6'];
            }
            
        
            
            
            
            
            //if(isset($its['settings'][14])&& $its['settings'][14]!='')
            if($its['settings'][13]=='wall'){
                
                $fout.='<style>
                    .dzs-gallery-container .item{ width:23%; margin-right:1%; float:left; position:relative; }
                    .dzs-gallery-container .item-image{ width:100%; }
                    .dzs-gallery-container h4{  color:#D26; }
                    .dzs-gallery-container h4:hover{ background: #D26; color:#fff; }
                    .clear { clear:both; }
                    </style>';
                $fout.='<div class="dzs-gallery-container">';
                
                for ($i = 1; $i < count($its) - 1; $i++) {
                    $fout.='<div class="item">';
                    $fout.='<a href="'.$zs1_path.'ajax.php?height='.$its['settings']['height'].'&width='.$its['settings']['width'].'&type='.$its[$i]['type'].'&source='.$its[$i]['source'].'" title="'.$its[$i]['type'].'" class="thickbox"><img class="item-image" src="';
                    if($its[$i]['thethumb']!='')
                        $fout.=$its[$i]['thethumb'];
                    else{
                        if($its[$i]['type']=="youtube"){
                          $fout.='http://img.youtube.com/vi/'.$its[$i]['source'].'/0.jpg';
                          $its[$i]['thethumb']='http://img.youtube.com/vi/'.$its[$i]['source'].'/0.jpg';
                        }
                    }
                    $fout.='"/></a>';
                    $fout.='<h4>'.$its[$i]['type'].'/<h4>';
                    $fout.='</div>';
                }
                $fout.='<div class="clear"></div>';
                $fout.='</div>';
                $fout.='<div class="clear"></div>';
                $fout.='<script>
                    jQuery(".dzs-gallery-container").masonry({
          itemSelector: ".item"
        });</script>';
            }else{
        
            $fout = '<script type="text/javascript">';
        
        
            //VIDEOS
            $fout.="var fv1='";
        
            
        
            for ($i = 1; $i < count($its) - 1; $i++) {
                $fout.=$its[$i]['source'];
        
                if ($i < count($its) - 2)
                    $fout.=';';
            }
        
            //TYPES
            $fout.="';
        	var fv2='";
        
            //TYPES
            for ($i = 1; $i < count($its) - 1; $i++) {
                $fout.=$its[$i]['type'];
                if ($i < count($its) - 2)
                    $fout.=';';
            }
        
            //THUMBS
            $sw1 = false;
            for ($i = 1; $i < count($its) - 1; $i++)
                if ($its[$i]['thethumb'] != '')
                    $sw1 = true;
        
            $fout.="';
        	var fv3='";
        
        
        for ($i = 1; $i < count($its) - 1; $i++) {
                    $sw=false;
                    $fout.=$its[$i]['thethumb'];
                    if($its[$i]['thethumb']!='')
                        $sw=true;
                    if ($its[$i]['thethumb'] == '' && $its[$i]['type'] == 'vimeo') {
                        
                        
                    }
                    if ($its[$i]['thethumb'] == '' && $its[$i]['type'] == 'youtube') {
                        $imgid = $its[$i]['source'];
                        //$fout.="http://img.youtube.com/vi/".$imgid."/2.jpg";
                        $its[$i]['thethumb']='http://img.youtube.com/vi/'.$its[$i]['source'].'/0.jpg';
        
                        $sw=true;
                    }
        
                    if ($i < count($its) - 2 && $sw==true)
                        $fout.=';';
                }
            
        
        
        
        
            //TITLES
            $sw1 = false;
            for ($i = 1; $i < count($its) - 1; $i++)
                if ($its[$i]['type'] != '')
                    $sw1 = true;
        
            $fout.="';
        	var fv4='";
            if ($sw1 == true) {
        
                for ($i = 1; $i < count($its) - 1; $i++) {
                    $fout.=$its[$i]['type'];
        
                    if ($i < count($its) - 2)
                        $fout.=';';
                }
            }
        
        
            //MENU DESCRIPTIONS
            $sw1 = false;
            for ($i = 1; $i < count($its) - 1; $i++)
                if ($its['settings']['description'] != '')
                    $sw1 = true;
        
            $fout.="';
        	var fv5='";
            if ($sw1 == true) {
        
                for ($i = 1; $i < count($its) - 1; $i++) {
                    $fout.=$its['settings']['description'];
        
                    if ($i < count($its) - 2)
                        $fout.=';';
                }
            }
        
            $fout.="'";
            $fout.=';
        	var width = ' . $its['settings']['width'] . ';
        		var height =' . $its['settings']['height'] . ';
        		var flashvars = {
        		totalWidth:width,
        		totalHeight:height,
        		autoplay:"' . $its['settings'][4] . '",
        		autoplayNextVideo:"on",
        		menuPosition:"' . $its['settings']['menuposition'] . '",
                        youtubeFeed:"' . $its['settings']['youtubefeed'] . '",
                        youtubeFeed_user:"******",
                        youtubeFeed_playlistId:"' . $its['settings']['youtubefeed_playlist'] . '",
                        scrollbar:"' . $its['settings'][9] . '",
        		video:fv1,
        		types:fv2,
        		thumbs:fv3,
        		titles:fv4,
        		menuDescriptions:fv5';
            
            if(isset($its['settings'][14])&& $its['settings'][14]!='')
                $fout.=',
                    defaultVolume:"'.$its['settings'][14].'"';
            
            if(isset($its['settings'][17])&& $its['settings'][17]!='')
                $fout.=',
                    suggestedQuality:"'.$its['settings'][17].'"';
            
            if(isset($its['settings'][18])&& $its['settings'][18]=='on'){
                $fout.=',
                    designXML:"'.$zs1_path.'deploy/xml/design.xml"';
                $its['settings']['skin'] = 'complete';
            }
            if(isset($its['settings'][19])&& $its['settings'][19]=='on'){
                $fout.=',
                    player_design_disable_description:"on"';
            }
            if(isset($its['settings'][20])&& $its['settings'][20]=='on'){
                $fout.=',
                    settings_deeplinking:"on"';
            }
            if(isset($its['settings'][21]) && $its['settings'][21]!=''){
                $fout.=',
                    menu_scroll_animation_time:' . $its['settings'][21];
            }
            
        
            $zs1_targetswf = "deploy/preview.swf";
        
            //SCRIPT CONTINUE
        
            
            $fout.='
                };
        		var params = {
        			menu: "false",
        			allowScriptAccess: "always",
        			scale: "noscale",
        			allowFullScreen: "true",
        			wmode:"'.$its['settings'][12].'",
        			base:' . $c_singlequote . $zs1_path . $c_singlequote . '
        		};';
            if ($its['settings'][9] == 'on' && $its['settings']['menuposition'] == 'down')
                $fout.='
                    height+=12
                    ';
            if ($its['settings'][9] == 'on' && $its['settings']['menuposition'] == 'right')
                $fout.='
                    width+=12
                    ';
            if (!(isset($_GET['viewAlt']) && $_GET['viewAlt'] == 'true'))
                $fout.='var attributes = {}; 
                    swfobject.embedSWF("' . $zs1_path . $zs1_targetswf . '", "flashcontent' . $this->sliders_index . '", width, height, "9.0.0", "expressInstall.swf", flashvars, params, attributes);';
            $fout.='
        	
        <div class="alternate-content">
        
            
            $fout.='</ul>';
        $fout.='</div>
        </div>
        <div class="clearfix">&nbsp;</div>
        </div>';
        
        
            }
        */
        //echo $k;
        return $fout;
    }
Example #2
0
    function show_shortcode($atts)
    {
        //[zoomfolio]
        $fout = '';
        $taxonomy = 'categoryportfolio';
        $margs = array('settings_wpqargs' => '', 'width' => '940', 'height' => '300', 'type' => 'bannerrotator', 'menu_position' => 'right', 'settings_mode' => 'masonry', 'design_item_width' => '280', 'design_item_height' => 'auto', 'design_item_height_same_as_width' => 'off', 'design_thumbw' => '', 'design_thumbh' => '', 'settings_posttype' => 'default', 'design_categories_pos' => 'top', 'menuitem_height' => '70', 'settings_disablecats' => 'off', 'settings_ajax' => 'off', 'skin' => 'skin-default', 'sortable' => 'on', 'excerptlen' => '300', 'bgcolor' => 'transparent', 'cats' => '', 'color_main' => '', 'color_highlight' => '', 'settings_specialgrid' => '', 'posts_per_page' => '100', 'settings_lightboxlibrary' => 'zoombox', 'settings_preloadall' => 'off', 'disable_itemmeta' => 'off', 'fullscreen' => 'off', 'orderby' => 'date', 'defaultcategory' => '', 'sort_order' => 'ASC', 'design_categories_style' => 'normal', 'design_pageContent_pos' => 'top', 'settings_specialgrid_chooser_enabled' => 'off', 'settings_extraclasses' => '', 'settings_ajax_loadmoremethod' => 'scroll', 'settings_mode_masonry_layout' => 'masonry', 'design_preloader_bottom' => 'off', 'design_total_height_full' => 'off', 'settings_mode_masonry_layout_straightacross_setitemsoncenter' => 'off', 'is_rtl' => 'off', 'maxlen' => 'default', 'settings_hide_category_all' => 'off', 'settings_uselinksforcategories' => 'off', 'settings_uselinksforcategories_enablehistoryapi' => 'off');
        if (!isset($atts) || $atts == false) {
            $atts = array();
        }
        $margs = array_merge($margs, $atts);
        //        print_r($atts);
        //        print_r($margs);
        //===if is set to fullscreen we pass the arguments to the fullscreen call waiting in the footer
        if ($margs['fullscreen'] == 'on') {
            $this->fullscreen_cache_args = $margs;
            return;
        }
        if ($margs['skin'] == 'skin-default' || $margs['skin'] == 'skin-corporate') {
            if ($margs['design_item_height'] == '') {
                $margs['design_item_height'] = 'auto';
            }
        }
        if ($margs['skin'] == 'skin-blog') {
            if ($margs['design_item_height'] == '') {
                $margs['design_item_height'] = '280';
            }
            if ($margs['design_thumbh'] == '') {
                $margs['design_thumbh'] = 'auto';
            }
        }
        $tw = $margs['width'];
        $th = $margs['height'];
        $this->front_scripts();
        if ($margs['settings_lightboxlibrary'] == 'prettyphoto') {
            wp_enqueue_script('jquery.prettyphoto', $this->thepath . 'prettyphoto/prettyphoto.js');
            wp_enqueue_style('jquery.prettyphoto', $this->thepath . 'prettyphoto/prettyphoto.css');
        }
        if ($margs['settings_mode'] == 'wall') {
            wp_enqueue_script('dzs.wall', $this->thepath . 'dzswall/wall.js');
            wp_enqueue_style('dzs.wall', $this->thepath . 'dzswall/wall.css');
        }
        if ($margs['settings_mode'] == 'masonry') {
            wp_enqueue_script('jquery.isotope', $this->thepath . 'dzsportfolio/jquery.isotope.min.js');
        }
        if ($margs['skin'] == 'skin-blog') {
            //wp_enqueue_style('font.open.sans', 'http://fonts.googleapis.com/css?family=Open+Sans');
        }
        $settings_ajax_loadmoremethod = $margs['settings_ajax_loadmoremethod'];
        if ($margs['settings_ajax'] !== 'on' && $margs['settings_ajax_loadmoremethod'] == 'pages') {
            $settings_ajax_loadmoremethod = 'normal';
        }
        //=====start the LOOP
        $args_wpqargs = array();
        //print_r($margs); echo '<br><br>';        print_r($atts); echo '<br><br>';        print_r($margs['wpqargs']);
        //===lets parse custom wp query args
        $margs['settings_wpqargs'] = html_entity_decode($margs['settings_wpqargs']);
        parse_str($margs['settings_wpqargs'], $args_wpqargs);
        //        $args_wpqargs = array('tax_query' => array(
        //            array(
        //                'taxonomy' => 'dzsvideo_category',
        //                'field'    => 'tag_id',
        //                'terms'    => array( 11 ),
        //            ),
        //        ));
        //
        //        echo http_build_query($args_wpqargs);
        $wpqargs = array('post_type' => 'dzs_portfolio', 'posts_per_page' => '100');
        if (!isset($args_wpqargs) || $args_wpqargs == false || is_array($args_wpqargs) == false) {
            $args_wpqargs = array();
        }
        $wpqargs = array_merge($wpqargs, $args_wpqargs);
        $pageNumber = get_query_var('paged') ? get_query_var('paged') : 1;
        $wpqargs['paged'] = $pageNumber;
        //print_r($atts);
        if (isset($atts['posts_per_page']) && $atts['posts_per_page'] > 0) {
            //print_r($atts);
            $wpqargs['posts_per_page'] = $margs['posts_per_page'];
        }
        if ($margs['settings_posttype'] != '' && $margs['settings_posttype'] != 'default') {
            //print_r($atts);
            $wpqargs['post_type'] = $margs['settings_posttype'];
        }
        //print_r($wpqargs);
        $thecustomcats = array();
        $original_thecustomcats = $thecustomcats;
        //=======custom categories
        if ($margs['cats'] != '') {
            //$wpqargs['cat'] = $margs['cats'];
            $thecustomcats = explode(',', $margs['cats']);
            $original_thecustomcats = $thecustomcats;
            if (isset($_GET['dzsp_defCategory_port' . $this->sliders_index]) && $margs['settings_uselinksforcategories'] == 'on' && $margs['settings_uselinksforcategories_enablehistoryapi'] != 'on' && count($thecustomcats) > 1) {
                $nr_selected_cat = $_GET['dzsp_defCategory_port' . $this->sliders_index];
                $nr_selected_cat = (int) $nr_selected_cat;
                $nr_selected_cat--;
                $ij = 0;
                $len = count($thecustomcats);
                for ($ij = 0; $ij < $len; $ij++) {
                    if ($ij != $nr_selected_cat) {
                        unset($thecustomcats[$ij]);
                    }
                }
                $thecustomcats = array_values($thecustomcats);
                //                print_r($original_thecustomcats);
            }
            if ($wpqargs['post_type'] == 'post') {
                $wpqargs['cat'] = $margs['cats'];
            }
            if ($wpqargs['post_type'] == 'dzs_portfolio') {
                $wpqargs['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $thecustomcats));
            }
        }
        //=======custom categories END
        if ($margs['orderby']) {
            $wpqargs['orderby'] = $margs['orderby'];
            if ($margs['orderby'] == 'meta order') {
                $wpqargs['orderby'] = 'meta_value_num';
                $wpqargs['meta_key'] = 'dzsp_meta_order';
                //$wpqargs['meta_query'] = array(array('key' => ''));
            }
        }
        if ($margs['sort_order'] != '') {
            $wpqargs['order'] = $margs['sort_order'];
        }
        //print_r($wpqargs);
        if ($wpqargs['post_type'] == 'post') {
            $taxonomy = 'category';
        }
        //echo urlencode(json_encode($wpqargs));
        //$wpqargs['paged']=2;
        if (isset($_GET['dzsp_paged'])) {
            $wpqargs['paged'] = $_GET['dzsp_paged'];
        }
        //        print_r($wpqargs);
        $query = new WP_Query($wpqargs);
        //print_r($query->max_num_pages);
        //print_r($query);
        $its = $query->posts;
        //        print_r($query);
        if ($margs['color_main'] != '' || $margs['color_highlight']) {
            $fout .= '<style class="custom-dzsp-styling">';
            if ($margs['color_main'] != '') {
                $fout .= ' #port' . $this->sliders_index . ', #port' . $this->sliders_index . ' a { color: ' . $margs['color_main'] . '; }';
            }
            if ($margs['color_highlight'] != '') {
                $fout .= ' #port' . $this->sliders_index . ' .portitem:hover .the-title, 
                    #port' . $this->sliders_index . ' .selector-con .categories .a-category.active { color: ' . $margs['color_highlight'] . '; }';
            }
            $fout .= '</style>';
            $fout .= "\n";
        }
        $fout .= '<div id="port' . $this->sliders_index . '" class="dzsportfolio';
        if ($margs['sortable'] == 'on') {
            $fout .= ' is-sortable';
        } else {
            $fout .= ' is-not-sortable';
        }
        if ($margs['fullscreen'] == 'justdoit') {
            $fout .= ' portfolio-is-fullscreen';
        }
        if ($margs['settings_specialgrid'] != '' && $margs['settings_specialgrid'] != 'none') {
            // echo 'ceva' . $margs['settings_specialgrid'];
            $fout .= ' ' . $margs['settings_specialgrid'];
            $margs['design_item_width'] = "";
        }
        $fout .= ' ' . $margs['skin'];
        $fout .= ' ' . $margs['settings_extraclasses'];
        $fout .= '" style="';
        if ($margs['bgcolor'] != '') {
            $fout .= ' background-color: ' . $margs['bgcolor'] . '';
        }
        $fout .= '">';
        $fout .= '<div class="items">';
        $fout .= $this->parse_items($its, $margs, $wpqargs);
        $fout .= '</div>';
        $fout .= '<div class="preloader';
        if ($margs['design_preloader_bottom'] == 'on') {
            $fout .= ' bottom';
        }
        $fout .= '"></div>';
        $fout .= '</div>';
        if ($margs['settings_ajax'] !== 'on' && $margs['settings_ajax_loadmoremethod'] == 'pages') {
            if ($query->max_num_pages > 1) {
                //
                $fout .= '<div class="con-dzsp-pagination">';
                for ($ip = 0; $ip < $query->max_num_pages; $ip++) {
                    $fout .= '<a href="' . add_query_arg('dzsp_paged', $ip + 1, dzs_curr_url()) . '" class="dzsp-pagination-number pagination-number';
                    if (isset($_GET['dzsp_paged'])) {
                        if ($_GET['dzsp_paged'] == $ip + 1) {
                            $fout .= ' active';
                        }
                    } else {
                        if ($ip == 0) {
                            $fout .= ' active';
                        }
                    }
                    $fout .= '">' . ($ip + 1) . '</a>';
                }
                $fout .= '</div>';
            }
        }
        $jreadycall = 'jQuery(document).ready(function($){';
        if (isset($margs['wall_settings_thumbs_per_row']) && $margs['wall_settings_thumbs_per_row'] != '') {
        } else {
            $margs['wall_settings_thumbs_per_row'] = 5;
        }
        if ($margs['fullscreen'] == 'justdoit') {
            $fout .= '<div class="wall-close" style="z-index: 50006">CLOSE PORTFOLIO</div>';
        }
        $fout .= '<script>';
        if ($margs['fullscreen'] == 'justdoit') {
            $fout .= 'var dzsp_videofs = true; ';
        }
        $fout .= $jreadycall;
        ///====jQuery document ready
        if ($margs['is_rtl'] == 'on') {
            $fout .= '$.Isotope.prototype._positionAbs = function( x, y ) {
    return { right: x, top: y };
}; ';
            //$("body").attr("dir", "rtl");
        }
        if ($margs['settings_mode'] == 'wall') {
            $fout .= 'var wall_settings = {
    settings_thumbs_per_row:"' . $margs['wall_settings_thumbs_per_row'] . '",
    settings_width:0,
    settings_height:0,
    thumb_width:"' . $margs['design_item_width'] . '",
    thumb_height:"' . $margs['design_item_height'] . '",
    thumb_space:"' . $margs['wall_thumb_space'] . '"
};';
        }
        if ($margs['fullscreen'] == 'justdoit') {
            $fout .= 'jQuery(".wall-close").click(handle_wall_close);
        function handle_wall_close(){
var _t = jQuery(this);
if(dzsp_videofs==true){
    _t.html("OPEN PORTFOLIO");
    jQuery(".portfolio-is-fullscreen").fadeOut("slow");
    jQuery("body > .cat-selector").fadeOut("slow");
    dzsp_videofs = false;
}else{
    _t.html("CLOSE PORTFOLIO");
    jQuery(".portfolio-is-fullscreen").fadeIn("slow");
    jQuery("body > .cat-selector").fadeIn("slow");
    dzsp_videofs = true;
}
}';
        }
        if ($margs['settings_mode'] == 'masonry' && $margs['settings_mode_masonry_layout'] == 'straightAcross') {
            wp_enqueue_script('dzs.scroller', $this->thepath . 'dzsscroller/scroller.js');
            wp_enqueue_style('dzs.scroller', $this->thepath . 'dzsscroller/scroller.css');
        }
        $fout .= ' window.dzsp_init("#port' . $this->sliders_index . '",{
settings_slideshowTime:3
,settings_mode: "' . $margs['settings_mode'] . '"
,title: ""
,design_item_width: "' . $margs['design_item_width'] . '"
,design_item_height: "' . $margs['design_item_height'] . '"
,design_categories_style: "' . $margs['design_categories_style'] . '"
,design_categories_pos: "' . $margs['design_categories_pos'] . '"
,design_pageContent_pos: "' . $margs['design_pageContent_pos'] . '"
,settings_disableCats: "' . $margs['settings_disablecats'] . '"
,settings_lightboxlibrary: "' . $margs['settings_lightboxlibrary'] . '"
,settings_preloadall: "' . $margs['settings_preloadall'] . '"
,audioplayer_swflocation: "' . $this->thepath . 'ap.swf"
,videoplayer_swflocation: "' . $this->thepath . 'preview.swf"
,disable_itemmeta: "' . $margs['disable_itemmeta'] . '"
,settings_ajax_loadmoremethod: "' . $settings_ajax_loadmoremethod . '"
    ,settings_useLinksForCategories : "' . $margs['settings_uselinksforcategories'] . '"
    ,settings_useLinksForCategories_enableHistoryApi : "' . $margs['settings_uselinksforcategories_enablehistoryapi'] . '"
,settings_mode_masonry_layout: "' . $margs['settings_mode_masonry_layout'] . '"
,design_total_height_full: "' . $margs['design_total_height_full'] . '"
,settings_mode_masonry_layout_straightacross_setitemsoncenter: "' . $margs['settings_mode_masonry_layout_straightacross_setitemsoncenter'] . '"
,design_item_height_same_as_width : "' . $margs['design_item_height_same_as_width'] . '"';
        if ($margs['cats'] != '') {
            $fout .= ',settings_forceCats:[';
            //echo 'hmmdada';
            $iaux = 0;
            foreach ($original_thecustomcats as $customcatid) {
                //print_r($customcat);
                $customcat = get_term($customcatid, $taxonomy);
                if (isset($customcat->name)) {
                    //print_r($customcat);
                    if ($iaux > 0) {
                        $fout .= ',';
                    }
                    $aux = $customcat->name;
                    $aux = str_replace('"', '', $aux);
                    $fout .= '"' . $aux . '"';
                    $iaux++;
                }
            }
            $fout .= ']';
        }
        if ($margs['defaultcategory'] != '') {
            $auxcat = get_term($margs['defaultcategory'], $taxonomy);
            $fout .= ' ,settings_defaultCat:"' . $auxcat->name . '"';
        }
        if ($margs['settings_hide_category_all'] == 'on') {
            $fout .= ',settings_categories_strall:""';
        }
        if ($margs['design_thumbw'] != '') {
            $fout .= ',design_thumbw:"' . $margs['design_thumbw'] . '"';
        }
        if ($margs['design_thumbh'] != '') {
            $fout .= ',design_thumbh:"' . $margs['design_thumbh'] . '"';
        }
        if ($margs['settings_specialgrid_chooser_enabled'] == 'on') {
            $fout .= ',settings_specialgrid_chooser: ["special-grid-4","special-grid-5"]';
        }
        if ($margs['settings_ajax'] == 'on' && $query->max_num_pages > 1) {
            $fout .= ',settings_ajax_enabled:"on"';
            $fout .= ',settings_ajax_pages:[';
            for ($i = 1; $i < $query->max_num_pages; ++$i) {
                if ($i > 1) {
                    $fout .= ',';
                }
                $aux_wpqargs = $wpqargs;
                if (isset($aux_wpqargs['paged'])) {
                }
                $fout .= '"' . $this->thepath . 'ajaxreceiver.php?wpqargs=' . urlencode(json_encode($aux_wpqargs)) . '&args=' . urlencode(json_encode($margs)) . '&paged=' . ($i + 1) . '"';
            }
            $fout .= ']';
        }
        if ($margs['is_rtl'] == 'on') {
            $fout .= ',settings_isotope_settings: {transformsEnabled: false}';
        }
        $fout .= ',zoombox_settings: { settings_disablezoom: "' . $this->db_mainoptions['zoombox_settings_disablezoom'] . '", settings_zoom_doNotGoBeyond1X: "' . $this->db_mainoptions['zoombox_settings_zoom_donotgobeyond1x'] . '"}';
        $fout .= '})
});
</script>';
        $this->sliders_index++;
        return $fout;
    }
    function admin_page()
    {
        ?>
        <div class="wrap">
            <div class="import-export-db-con">
                <div class="the-toggle"></div>
                <div class="the-content-mask" style="overflow:hidden; height: 0px; position:relative;">
                    <div class="arrow-up"></div>
                    <div class="the-content">
                        <h3>Export Database</h3>
                        <form action="" method="POST"><input type="submit" name="dzsts_exportdb" value="Export"/></form>
                        <h3>Import Database</h3>
                        <form enctype="multipart/form-data" action="" method="POST">
                            File Location: <input name="dzsts_importdbupload" type="file" /><br />
                            <input type="submit" name="dzsts_importdb" value="Import" />
                        </form>
                        <h3>General Options</h3>
                        <form enctype="multipart/form-data" action="" method="POST">
                            <h5>Use WordPress Uploader ?</h5>
                            <?php 
        $onsel = '';
        $offsel = '';
        if ($this->mainoptions['usewordpressuploader'] == 'on') {
            $onsel = ' selected';
        } else {
            $offsel = ' selected';
        }
        ?>
                            <select name="usewordpressuploader">
                                <option<?php 
        echo $onsel;
        ?>
>on</option>
                                <option<?php 
        echo $offsel;
        ?>
>off</option>
                            </select><br></br>
                            <h5>Embed Prettyphoto ?</h5>
                            <?php 
        $onsel = '';
        $offsel = '';
        if ($this->mainoptions['embed_prettyphoto'] == 'on') {
            $onsel = ' selected';
        } else {
            $offsel = ' selected';
        }
        ?>
                            <select name="embed_prettyphoto">
                                <option<?php 
        echo $onsel;
        ?>
>on</option>
                                <option<?php 
        echo $offsel;
        ?>
>off</option>
                            </select><br></br>
                            <input type="submit" class="button-primary" name="dzsts_saveoptions" value="Save Options" />

                        </form>
                    </div>
                </div>
            </div>
            <h2>DZS <?php 
        _e('Timeline Slider Admin');
        ?>
 <img alt="" style="visibility: visible;" id="main-ajax-loading" src="<?php 
        bloginfo('wpurl');
        ?>
/wp-admin/images/wpspin_light.gif"/></h2>
            <noscript>You need javascript for this.</noscript>
            <a href="<?php 
        echo $this->theurl;
        ?>
readme/index.html" class="button-secondary action">Documentation</a>
            <table cellspacing="0" class="wp-list-table widefat dzs_admin_table main_sliders">
                <thead> 
                    
                    <tr> 
                        <th style="" class="manage-column column-name" id="name" scope="col"><?php 
        echo __('ID', 'dzsts');
        ?>
</th>
                        <th class="column-edit"><?php 
        echo __('Edit', 'dzsts');
        ?>
</th>
                        <th class="column-edit"><?php 
        echo __('Embed', 'dzsts');
        ?>
</th>
                        <th class="column-edit"><?php 
        echo __('Export', 'dzsts');
        ?>
</th>
                        <th class="column-edit"><?php 
        echo __('Duplicate', 'dzsts');
        ?>
</th>
                        <th class="column-edit"><?php 
        echo __('Delete', 'dzsts');
        ?>
</th> 
                    </tr>
                </thead> 
                <tbody>
                </tbody>
            </table>
            <?php 
        $url_add = '';
        $items = $this->mainitems;
        //echo count($items);
        $aux = remove_query_arg('deleteslider', dzs_curr_url());
        $nextslidernr = count($items);
        if ($nextslidernr < 1) {
            $nextslidernr = 1;
        }
        $params = array('currslider' => $nextslidernr);
        $url_add = add_query_arg($params, $aux);
        ?>
            <a class="button-secondary add-slider" href="<?php 
        echo $url_add;
        ?>
"><?php 
        _e('Add Slider', 'dzsts');
        ?>
</a>
            <form class="master-settings">
            </form>
            <div class="dzs-multi-upload">
                <h2>DZS Multi Uploader</h2>
                <h3>Choose file(s)</h3>
                <div>
                    <input id="files-upload" class="multi-uploader" name="file_field" type="file" multiple/>
                </div>
                <div class="droparea">
                    <div class="instructions">drag & drop files here</div>
                </div>
                <div class="upload-list-title">The Preupload List</div>
                <ul class="upload-list">
                    <li class="dummy">add files here from the button or drag them above</li>
                </ul>
                <button class="primary-button upload-button">Upload All</button>
            </div>
            <div class="notes">
                <div class="curl">Curl: <?php 
        echo function_exists('curl_version') ? 'Enabled' : 'Disabled' . '<br />';
        ?>
                </div>
                <div class="fgc">File Get Contents: <?php 
        echo ini_get('allow_url_fopen') ? "Enabled" : "Disabled";
        ?>
                </div>
                <div class="sidenote">
                </div>
            </div>
            <div class="saveconfirmer">Loading...</div>
            <div class="saveconfirmer"><?php 
        _e('Loading...', 'dzsts');
        ?>
</div>
            <a href="#" class="button-primary master-save"></a> <img alt="" style="position:fixed; bottom:18px; right:125px; visibility: hidden;" id="save-ajax-loading" src="<?php 
        bloginfo('wpurl');
        ?>
/wp-admin/images/wpspin_light.gif"/>

            <a href="#" class="button-primary master-save"><?php 
        echo __('Save All Galleries', 'dzsts');
        ?>
</a>
            <a href="#" class="button-secondary slider-save"><?php 
        echo __('Save Gallery', 'dzsts');
        ?>
</a>

        </div>
        <script>
        <?php 
        //$jsnewline = '\\' + "\n";
        echo "window.dzs_upload_path = '" . $this->theurl . "admin/dzsuploader/upload/';\r\n";
        echo "window.dzs_php_loc = '" . $this->theurl . "admin/dzsuploader/upload.php';\r\n";
        $aux = str_replace(array("\r", "\r\n", "\n"), '', $this->sliderstructure);
        echo "var sliderstructure = '" . $aux . "';\r\n";
        $aux = str_replace(array("\r", "\r\n", "\n"), '', $this->itemstructure);
        echo "var itemstructure = '" . $aux . "';\r\n";
        ?>
            jQuery(document).ready(function($) {
                sliders_ready();
        <?php 
        $items = $this->mainitems;
        for ($i = 0; $i < count($items); $i++) {
            //print_r($items[$i]);
            $aux = '';
            if (isset($items[$i]) && isset($items[$i]['settings']) && isset($items[$i]['settings']['id'])) {
                //echo $items[$i]['settings']['id'];
                $aux_id = $items[$i]['settings']['id'];
                $aux_id = stripslashes($aux_id);
                $aux_id = str_replace('"', "&apos;&apos;", $aux_id);
                $aux = '{ name: "' . $aux_id . '"}';
            }
            echo "sliders_addslider(" . $aux . ");";
        }
        if (count($items) > 0) {
            echo 'sliders_showslider(0);';
        }
        for ($i = 0; $i < count($items); $i++) {
            //echo $i . $this->currSlider . 'cevava';
            if (($this->mainoptions['is_safebinding'] != 'on' || $i == $this->currSlider) && is_array($items[$i])) {
                //==== jsi is the javascript I, if safebinding is on then the jsi is always 0 ( only one gallery )
                $jsi = $i;
                if ($this->mainoptions['is_safebinding'] == 'on') {
                    $jsi = 0;
                }
                for ($j = 0; $j < count($items[$i]) - 1; $j++) {
                    echo "sliders_additem(" . $jsi . ");";
                }
                foreach ($items[$i] as $label => $value) {
                    if ($label === 'settings') {
                        if (is_array($items[$i][$label])) {
                            foreach ($items[$i][$label] as $sublabel => $subvalue) {
                                $subvalue = (string) $subvalue;
                                $subvalue = stripslashes($subvalue);
                                $subvalue = str_replace(array("\r", "\r\n", "\n", '\\', "\\"), '', $subvalue);
                                $subvalue = str_replace(array("'"), '"', $subvalue);
                                echo 'sliders_change(' . $jsi . ', "settings", "' . $sublabel . '", ' . "'" . $subvalue . "'" . ');';
                            }
                        }
                    } else {
                        if (is_array($items[$i][$label])) {
                            foreach ($items[$i][$label] as $sublabel => $subvalue) {
                                $subvalue = (string) $subvalue;
                                $subvalue = stripslashes($subvalue);
                                $subvalue = str_replace(array("\r", "\r\n", "\n", '\\', "\\"), '', $subvalue);
                                $subvalue = str_replace(array("'"), '"', $subvalue);
                                $subvalue = str_replace(array('
'), '', $subvalue);
                                // --zwc
                                //                                $subvalue = str_replace('&#8203','',$subvalue);// --zwc
                                if ($label == '') {
                                    $label = '0';
                                }
                                echo 'sliders_change(' . $jsi . ', ' . $label . ', "' . $sublabel . '", ' . "'" . $subvalue . "'" . ');';
                            }
                        }
                    }
                }
                if ($this->mainoptions['is_safebinding'] == 'on') {
                    break;
                }
            }
        }
        ?>
                jQuery('#main-ajax-loading').css('visibility', 'hidden');
                if (dzsts_settings.is_safebinding == "on") {
                    jQuery('.master-save').remove();
                    if (dzsts_settings.addslider == "on") {
                        sliders_addslider();
                        window.currSlider_nr = -1;
                        sliders_showslider(0);
                    }
                }
                //check_global_items();
                sliders_allready();
            });
        </script>
        <?php 
    }
Example #4
0
    function show_gui($pargs = array())
    {
        $margs = array('title' => "Page Builder");
        $margs = array_merge($margs, $pargs);
        // --- no reason to return anything if user does not have tinymce
        if (!(current_user_can('edit_posts') || current_user_can('edit_pages'))) {
            return;
        }
        $currSlider = 'none';
        if (isset($_REQUEST['currslider'])) {
            $currSlider = $_REQUEST['currslider'];
        } else {
        }
        //        print_r($this->maintemplates);
        $templatename = '';
        if ($currSlider != 'none') {
            if (isset($this->maintemplates[$currSlider])) {
                $its = $this->maintemplates[$currSlider];
                $templatename = $its['settings']['name'];
            }
        }
        //        print_r($its);
        //        echo 'templatename'.$templatename;
        wp_enqueue_script('dzs.zoomdropdown', $this->thepath . 'zoomdropdown/zoomdropdown.js');
        wp_enqueue_style('dzs.zoomdropdown', $this->thepath . 'zoomdropdown/zoomdropdown.css');
        wp_enqueue_style('fontawesome', $this->thepath . 'tinymce/fontawesome/font-awesome.min.css');
        $layoutbody = $this->insert_layout_body();
        $layoutbody = str_replace(array("\r", "\r\n", "\n"), '', $layoutbody);
        if ($this->pageoptions['page'] != '') {
            //$this->mainpagessliders[$this->pageoptions['page']] = $currSlider;
            //update_option($this->db_pagesliders, $this->mainpagessliders);
        }
        $i = 0;
        $k = 0;
        $id = $this->pageoptions['page'];
        //        echo 'id '.$id . ' '; print_r($this->mainpagessliders);
        if (is_array($this->mainpagessliders)) {
            foreach ($this->mainpagessliders as $lab => $mainpagesslider) {
                if (isset($id) && $id == $mainpagesslider['settings']['name']) {
                    $k = $lab;
                }
            }
        } else {
            $this->mainpagessliders = array();
        }
        //        print_r($this->mainpagessliders);
        //        echo 'def currSlider '.$currSlider;
        //        print_r($its);
        if ($currSlider == 'none' || $currSlider == '') {
            if (isset($this->mainpagessliders[$k])) {
                $its = $this->mainpagessliders[$k];
            } else {
                $its = array();
            }
        }
        //print_r($its);
        if (isset($_GET['addslider']) && $_GET['addslider'] == 'on') {
            //echo 'ceva'; echo $this->maintemplates[$currSlider]=='';
            $this->maintemplates[$currSlider] = $its;
            $this->maintemplates[$currSlider]['settings']['name'] = 'template' . rand(1, 900);
        }
        $aux = remove_query_arg('addslider', dzs_curr_url());
        $aux = remove_query_arg('deleteslider', $aux);
        $params = array('currslider' => '_currslider_');
        $newurl = add_query_arg($params, $aux);
        $params = array('deleteslider' => $currSlider);
        //'_currslider_'
        $delurl = add_query_arg($params, $aux);
        $san_struct_layoutbody = $this->insert_layout_body();
        $san_struct_layoutbody = str_replace(array("\r", "\r\n", "\n", "'"), '', $san_struct_layoutbody);
        $currurl_noslider = remove_query_arg('currslider', dzs_curr_url());
        $struct_chooserlayout = '<div class="zoomdropdown-con chooser-layout" style="display:inline-block; position:absolute; top:3px; width: 150px; margin-left: -75px; text-align: center; left:50%; background:rgba(255,255,255,0.9); border: 1px solid rgba(100,100,100,0.3); padding: 7px 5px;"><div class="aux-padder"></div>
<div class="the-label" style="color: #aaa; font-size:11px; position:relative; top: -3px;">1/1</div>
<ul class="zoomdropdown" style="z-index:999; width: 300px; box-shadow: 0 0 5px 0 rgba(101,100,100,0.2)">
    <li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/1</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/2+1/2</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/3+2/3</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">2/3+1/3</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/4+3/4</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">3/4+1/4</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/3+1/3+1/3</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/2+1/4+1/4</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/4+1/2+1/4</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block; ">1/4+1/4+1/2</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block;  ">1/4 * 4</li><li class="dd-selectitem-layout" style="width:100px; text-align: center; display:inline-block;  ">raw</li>
</ul>
</div>';
        ?>
            <div class="pagebuilder-wrap mode-<?php 
        echo $this->mainoptions['mode'];
        ?>
">
                <div class="clear"></div>
                <p>&nbsp;</p>
                <h2 class="title-builder"><?php 
        echo __($margs['title'], 'dzspb');
        ?>
</h2>
                <div class="wrap-thebuilder">
                    <div class="wrap-widgets">
                        <h4 class='header-tools'><?php 
        echo __('Layouts', 'dzspb');
        ?>
</h4>
                        <div class="dzs-layout static clearfix" rel="1/1">
                            <div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
        <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/1"/>
                        </div>

                        <div class="dzs-layout static clearfix" rel="1/2+1/2"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                            <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/2+1/2"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="2/3+1/3"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                            <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="2/3+1/3"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="1/3+2/3"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                            <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/3+2/3"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="1/3+1/3+1/3"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
        <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/3+1/3+1/3"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="1/2+1/4+1/4"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                            <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/2+1/4+1/4"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="1/4+1/2+1/4"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                        <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/4+1/2+1/4"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="1/4+1/4+1/2"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                        <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/4+1/4+1/2"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="1/4+1/4+1/4+1/4"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                        <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="1/4+1/4+1/4+1/4"/>
                        </div>
                        <div class="dzs-layout static clearfix" rel="raw"><div class="dzs-layout-head"><div></div><div></div><div></div><div></div><div class="item-close"></div><?php 
        echo $struct_chooserlayout;
        ?>
</div>
                        <?php 
        echo $layoutbody;
        ?>
                            <input class="field-rel" type="hidden" value="raw"/>
                        </div>
                    </div>
                    <div class="wrap-build">
                        <h4 class='header-tools'><?php 
        echo __('Layout ', 'dzspb');
        echo '<span class="px15">';
        echo $this->pageoptions['page'];
        echo '</span>';
        if ($templatename != '') {
            ?>
                                <span class="sidenote"><?php 
            echo __('from template ', 'dzspb');
            ?>
<strong><?php 
            echo $templatename;
            ?>
</strong></span>
                                <p><a class="button-secondary" href="<?php 
            echo $currurl_noslider;
            ?>
"><?php 
            echo __('Discard Template', 'dzspb');
            ?>
</a></p>
                        <?php 
        }
        ?>
                        </h4>
                        <?php 
        /// === template zone
        //print_r($currSlider); print_r($this->maintemplates); print_r($this->maintemplates[$currSlider]);
        echo '<input type="hidden" name="settings[name]" value="' . $this->pageoptions['page'] . '"/>';
        //echo 'cevaalceva';
        if (is_array($its)) {
            foreach ($its as $lab => $val) {
                //print_r($lab); print_r($val);
                if ($lab == 'settings') {
                    continue;
                }
                foreach ($val as $layout) {
                    //print_r($layout);
                    echo '<div class="dzs-layout clearfix" rel="' . $layout['settings']['rel'] . '">
                        <div class="dzs-layout-head"><div></div><div></div><div></div><div></div>
                        <div class="item-close"></div>' . $struct_chooserlayout . '</div>';
                    //print_r($layout);;
                    foreach ($layout as $layout_lab => $layout_val) {
                        if ($layout_lab === 'settings') {
                            continue;
                        }
                        //echo 'ceva';print_r($layout_val);
                        $args = array('title' => $layout_val['title'], 'content' => '');
                        if (isset($layout_val['content'])) {
                            $args['content'] = $layout_val['content'];
                        }
                        //echo $layout_lab; echo 'ceva'; print_r($layout_val);
                        echo $this->insert_layout_body($args);
                    }
                    echo '<input class="field-rel" type="hidden" value="' . $layout['settings']['rel'] . '"/>';
                    echo '</div>';
                }
            }
        }
        ?>
                    </div>
                </div>
            </div>
            <div class="saveconfirmer" style=""><img alt="" style="" id="save-ajax-loading2" src="<?php 
        echo site_url();
        ?>
/wp-admin/images/wpspin_light.gif"/></div>

            <div class="templates-wrap">
                <?php 
        //print_r($this->maintemplates);
        //echo count($this->maintemplates);
        if (is_array($this->maintemplates) && count($this->maintemplates) > 0) {
            echo '<div class="templates-title">Templates <span class="sidenote">hold click for one second to change template name</span></div>';
            echo '<div class="wrap-templates">';
            $is = 0;
            //print_r($this->maintemplates);
            foreach ($this->maintemplates as $maintemplate) {
                //echo $currSlider . ' cevava ' . $is;
                if (!isset($maintemplate['settings'])) {
                    continue;
                }
                $aux = $newurl;
                $aux = str_replace('_currslider_', $is, $aux);
                echo '<a href="' . $aux . '" class="template-item';
                echo '">';
                echo '<input type="text" class="template-item-input" value="' . $maintemplate['settings']['name'] . '"/>';
                echo '</a>';
                //'<a class="template-item">';
                $is++;
            }
            $aux = $newurl;
            $params = array('addslider' => 'on');
            $aux = add_query_arg($params, $aux);
            $aux = str_replace('_currslider_', $is, $aux);
            echo '</div>';
            //<div class="wrap-templates">
            if ($templatename != '') {
                echo '<a href="' . $aux . '" class="savetemplate ui-layout-button';
                echo '">';
                echo 'save ' . $templatename;
                echo '</a>';
                //'<a class="template-item addlayout">';
            }
        }
        echo '<a href="' . $aux . '" class="savetemplate ui-layout-button';
        echo '">';
        echo __('make template from this layout', $this->translatevar);
        echo '</a>';
        //'<a class="template-item addlayout">';
        ?>
            </div>
        <?php 
    }