<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 = getDir(BLOCKROOT.'jtblock/');
    if(is_dir(BLOCKROOT.'jthome')) {
        $jtblockarr2 = getDir(BLOCKROOT.'jthome/');
        $jtblockarr = array_merge($jtblockarr,$jtblockarr2);
    }
    if(is_dir(TPLCURROOT.'selfblock/mbhome')) {
      $jtblockarr2 = getDir(TPLCURROOT.'selfblock/mbhome/');
      $jtblockarr = array_merge($jtblockarr,$jtblockarr2);
    }
    //array_push($jtblockarr,$curstyle);
     //pre($jtblockarr2);
     foreach($jtblockarr as $v){
      if($v=='jtblock_zother' || $v=='') continue;
     $stylev = '';
     if(substr($v,0,10)=='jtblock_dh')  $stylev = ' style="border:1px solid blue" ';
     else if(substr($v,0,12)=='jtblock_node')  $stylev = ' style="border:1px solid red" ';

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

      $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 '.$curv.$vlink.$stylev.' >'.$v2.$numv.'</a>  ';
     }
    ?>


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

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