<div class="blocknav" style="padding-bottom:20px">

	<div class="blocksearch">

		  <form onsubmit="javascript:return checkbksearch(this)" id="search_form" action="mod_block.php?lang=<?php echo LANG?>&ppid=jtblock_bkcustom&type=search" method="post" accept-charset="UTF-8">
          搜索： <input class="navsearch_input" type="text" name="searchword" value="请输入标题或区块标识" style="width:250px;padding:5px;" onfocus="javascript:this.value='';" />
            <input type="submit" name="Submit" value="搜索" class="searchgo" style="padding:5px 10px;cursor:pointer" />
            </form>
 
 </div>

 
 

 <script>
    function checkbksearch(thisForm) {
        if (thisForm.searchword.value == "" || thisForm.searchword.value == "请输入标题或区块标识" )
        {
            alert("请输入标题或区块标识");
            thisForm.searchword.focus();
            return (false);
        }
        // return;
    }
</script>

    <div class="blocknavlist" style="padding-top:15px">

    <?php

    $num = numrecords(TABLE_BLOCK,$curstyle,'pidstylebh');
    $numv = $num==0?'':' <span class="num">('.$num.')</span>';

    $vlink = ' href="'.$jumpv.'&ppid='.$curstyle.'"';

    $curv = $ppid==$curstyle?' class="active"':'';
   // echo '<a '.$curv.$vlink.'>当前模板'.$numv.'</a>  ';


    //require_once('plugin_block_jteffect.php');
    $jtblockarr = dmgetDir(BLOCKROOT.'jtblock/');
    if(is_dir(BLOCKROOT.'jthome')) {
        $jtblockarr2 = dmgetDir(BLOCKROOT.'jthome/');
        $jtblockarr = array_merge($jtblockarr,$jtblockarr2);
    }
    if(is_dir(TPLCURROOT.'selfblock/mbhome')) {
      $jtblockarr2 = dmgetDir(TPLCURROOT.'selfblock/mbhome/');
      $jtblockarr = array_merge($jtblockarr,$jtblockarr2);
    }

     if(is_dir(BLOCKROOT.'jteffect')) {
        $jtblockarr2 = dmgetDir(BLOCKROOT.'jteffect/');
        $jtblockarr = array_merge($jtblockarr,$jtblockarr2);
    }


    //array_push($jtblockarr,$curstyle);
     //pre($jtblockarr2);
    $exarr = ['jtblock_zother','','oldbak---','z','zstatic','vendor'];
     foreach($jtblockarr as $v){

        if(in_array($v,$exarr)) continue;

     // if($v=='jtblock_zother' || $v=='') continue;

        if(is_file(BLOCKROOT.'jthome/'.$v.'/vv_noblock.php')) continue;
        if(is_file(BLOCKROOT.'jteffect/'.$v.'/vv_noblock.php')) continue;

       
       $stylev = '';

   
       $curv = $ppid==$v?' active':'';

         if(substr($v,0,10)=='jtblock_dh')  $curv .= ' border_dh ';
         else if(substr($v,0,12)=='jtblock_bkdh')  $curv .= ' border_dh ';
         else if(substr($v,0,10)=='jtblock_bz')  $curv .= ' border_node ';
         else if(substr($v,0,14)=='jtblock_bknode')  $curv .= ' border_node ';
         else if(substr($v,0,9)=='jteffect_')  $curv .= ' border_effect ';



      $num = numrecords(TABLE_BLOCK,$v,'pidstylebh');
      $numv = $num==0?'':' <span class="num">('.$num.')</span>';
     $v2 = $v;
    //pre($arr_blockfolder);
    foreach($arr_blockfolder as $kk=>$vv){
        if($v == $kk) $v2= $vv;
    }




    $vlink = ' href="'.$jumpv.'&ppid='.$v.'"';
    //$vlink = ' target = "_blank" href = "http://dream.demososo.com/site6/dmlink-blockview-'.$v.'-1.html"';

       echo '<a class="'.$curv.'" '.$vlink.$stylev.' >'.$v2.$numv.'</a>  ';
     }
    ?>


    </div>
 
    <div>
    <?php
      //  $linkview =  'dmlink-blockview-'.$ppid.'-1.html';
      $url = 'adminfrom.php?to=preview_all&tov='.$ppid.'='.$langpath;
       // $url =  BASEURL.'adminfrom.php?to='.BASEURLPATH.$linkview;

      //  if(substr($ppid,0,7)=='jthome_')   {  }
      // else
         echo ' <a class="but4" target="_blank" href="'.BASEURL.$url.'">预览</a> &nbsp;&nbsp;';
     
     ?>
    </div>
</div>