<?php
include_once XOOPS_ROOT_PATH . "/modules/neothemesadmin/block_function.php";
include_once XOOPS_ROOT_PATH . "/modules/neillibrary/function.php";
include_once XOOPS_ROOT_PATH . "/modules/neillibrary/function/blocksfunction.php";	



function neilqrcodebox_block_show($options){
global $xoopsDB, $xoTheme,$xoopsModule,$xoopsConfig;	

$setting=neil_modulessetting($modulesid="neothemesadmin");	



//QRCODE區塊
$block['qrcodebox']=neillibrary_qrcodrebox($qrcodeimg="webqrcode",$alt=$xoopsConfig['sitename'].'-'._MS_SHARED190,$class="",$type="2",$url=XOOPS_URL);



//顯示裝置判斷
foreach(explode(',', $options[0]) as  $val){
if($val=='1' && $setting['themefolder']=='computer'){
return $block;
}
if($val=='2' && $setting['themefolder']=='phone'){
return $block;
}
}
if(empty($options[0])){
return $block;
}
 
//     return $block; 
}




//區塊編輯函式
function neilqrcodebox_block_edit($options)
{
  global $xoopsDB, $xoTheme;

//顯示裝置
$blockvar['0']=neillibrary_displaydevice($oval=$options[0],$nameval="options[0][]");

 $form = "{$option['js']} 
 <table class='table table-striped'>
  
    <tbody>
  	

       <tr >          	
        <th style='width: 13%;'>"._MS_SHARED248."</th>
        <td> <div class='col-sm-12'>
    ".$blockvar['0']."	
    <br />
           </div></td>   
      </tr> 
       
   
    </tbody>
  </table>
	 				
  ";
    return $form;
}
